LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

smooth display / 1 block per second writing

Hi,
 
It has taking me to long now, i want to make a simple but accurate data acquisition program that smoothly displays mij analog input data and writes the data every second to a binairy file...
 
I've come to this vi, can anyone tell me if this is the correct way to do this??
 
Best reagrds,
Thijs
 
Download All
0 Kudos
Message 1 of 6
(2,677 Views)

Hello Thijs,

To use a dutch saying: There are multiple roads leading into Rome Smiley Happy . 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

Rik Prins, CLA, CLED
Software Development Engineer
0 Kudos
Message 2 of 6
(2,646 Views)
Thanks, i am dutch...
Do you have an example for my program with a producer/consumer structure
 
Best regards,
Thijs
0 Kudos
Message 3 of 6
(2,635 Views)

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

Rik Prins, CLA, CLED
Software Development Engineer
Message 4 of 6
(2,630 Views)

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

0 Kudos
Message 5 of 6
(2,620 Views)
Yes you are absolutely right! That is the idea of this setup.
 
Good luck with the rest of your application.
 
Regards,
 
RikP - National Instruments Applications Engineering
Rik Prins, CLA, CLED
Software Development Engineer
Message 6 of 6
(2,615 Views)