LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

NI DAQmx timing mismatch issue while acquiring data

Solved!
Go to solution

I am trying to acquire AI signal every 1ms and trying to plot it in waveform graph, as shown in the Front panel png file. I have set the elapsed timer to 10 sec, and wired "Time have elapsed" to "stop" function of while loop.

 

But my waveform graph has plotted only till 5000 msec, I require the waveform graph to be till 10000 msec.   

RT AI timing.PNG

0 Kudos
Message 1 of 2
(922 Views)
Solution
Accepted by topic author msabah38

Hi msabah,

 

simple LabVIEW+DAQmx beginner error…

 

Just because you try to read one sample per channel from two DAQmx tasks each millisecond the VI will actually read those samples each millisecond!

 

When you need to acquire samples at a given constant interval then you should setup a timing in your DAQmx tasks.

Please examine all those DAQmx example VIs you can find in the example finder!

 

General recommendations:

Don't use the TimedWhileLoop on a default Windows computer, it does not provide the improvements you most often expect.

Building up large arrays and displaying them in a graph will also need some time - you will not reach 1000Hz loop rate this way.

It does not make sense to update a graph 1000 times a second!

Reading (network) shared variables 1000 times a second also doesn't make sense!

 


@msabah38 wrote:

I am trying to acquire AI signal every 1ms and trying to plot it in waveform graph, as shown in the Front panel png file.

But my waveform graph has plotted only till 5000 msec, I require the waveform graph to be till 10000 msec. 


By thinking about this problem description it seems the VI is working as you have programmed it to work:

The loop iterates at 1kHz and switches between the states "poll" and "read" in this statemachine. In 10s it will achieve about 10k iterations: ~5000 times "read" and ~5000 times "poll". What else do you expect?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 2 of 2
(899 Views)