04-16-2008 04:58 AM
04-22-2008 02:24 AM
Hello Thijs,
To use a dutch saying: There are multiple roads leading into Rome . Your sample rates are not that high so I think this is a valid way of doing it. A second solution would be not using the for loop and implementing an elapsed time function which times out every second triggering a case structure for writing the data to disk. At high sample rates you probably would be better of with a producer/consumer structure (parallel loops) with acquisition in the producer and writing the data to disk in the consumer loop.
To wrap it up, at this sample speeds this is a good solution.
Best regards,
RikP
Applications Engineering - National Instruments
04-22-2008 05:15 AM
04-22-2008 06:08 AM
Hello Thijs,
Please take a look at the following KB:
http://digital.ni.com/public.nsf/allkb/6C05A002FAE4F9F68625734C0059B4EF?OpenDocument
It explains a lot about buffer overflows etc. Attached is an example VI which uses the Producer consumer structure. It does a very simple math analisys in the consumer loop. You should replace that with the code you use to write the data to disk. The baseline of using this type of architecture is that the producer loop will only do the acquisition and the consumer loop will do all other tasks. Teh queue mechanism that transfers the data from the producer to the consumer has the abbility to buffer data so no data itme swil be lost at high Acquisition rates.
Hope this helps.
Regards,
RikP - National Instruments Applications Engineering
04-22-2008 06:55 AM
Thanks alot! I think i understand it, so if i am correct i can make a real steady data acquisition in one loop and in the other loop display the aquired data!
Best regards,
Thijs
04-22-2008 07:19 AM