Showing results for 
Search instead for 
Did you mean: 

How to plot data during an acquisition task ?

Go to solution

Hi y'all


This is a trivial problem but I couldn't find a very straighful answer (or too many to make my mind) and example related to this question. What is the best solution to plot the data that have been already collected while the acquisition is still going on?


At first, I thought that it will be easy to start the task and read a buffer used by the task to refresh a chart....But I couldn't come with an easy way to do that. Is this strategy impossible or just upon my skills? If that is possible, I'll give my weigh in kudos to the person that can show me how to do it. 


Second, I started to use a previously described strategy consisting into fragmenting my acquisition period in smaller periods, and refreshing my chart after each of these smaller period.  My question about this solution is do I risk to miss some value between two cycles (I/I+1) of my time loop or that is just impossible by construction?


The sampling rate for this project should be around 5K Hz and the environment is Labview 9.0f2 (32 bits).


I joint my modest vi of beginner for clarifying my problem, feel free to start your solution from scratch or modify my vi.


Thanks for helping and for your time!



0 Kudos
Message 1 of 4



if I understand you correctly, you are trying to acquire data for a given time period at a given sampling rate and display the already gathered data on a waveform chart, while the acquisition is still going on. You wired the sampling rate to the 'number of samples' terminal of the DAQmx Read so I presume you want to display the data gathered so far every second. For that task the timed loop and the shift register is unnecessary, cause the DAQmx VI will only continue when the desired number of samples is collected. You just have to set the history length of the waveform chart high enough to see the desired number of samples. If you want to all your data from the whole period, history length should be for example [sampling rate] * [duration in seconds].You can do this programmatically with a property node or by double clicking the waveform chart on the front panel and picking the Chart Histort Length menu item. Also don't forget to set the min and max values and input terminal configuration on the DAQmx Create Channel VI.

Feel free to any further questions!



Dániel Fülöp
Field Application Engineer (CLA, CTA)
National Instruments
0 Kudos
Message 2 of 4
Accepted by topic author OD

One more point to add: since you selected Continuous acquisition as the sample mode in your VI, the DAQ device will do hardware buffered acquisition, this means that you won't lose any samples as long as you read the buffer regularly. You can find further information about the different sample modes in the detailed help of the DAQmx Timing VI.

Dániel Fülöp
Field Application Engineer (CLA, CTA)
National Instruments
Message 3 of 4

Thanks for your time and the clarity of your response. Really appreciate that!


0 Kudos
Message 4 of 4