LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Time shift/delay using DAQmx Read

Solved!
Go to solution

Hi all. 

I'm having a trouble with DAQmx Read. The VI attached is an oversimplified version of a real application I'm working on, but it shows the same trouble. 

Riccardo_Rea_0-1653478401814.png

In the upper while loop I'm reading a N-channel N-sample simulated signal using the DAQmx Read VI and monitoring the time of the waveform. The loop loop keeps just track of the actual time.

Timing settings are as follow:

- Sampling mode = Continuous

- Samples per channel = 1000  

- Rate = 10000

 

The "number of samples per channel"(NSC) on the Read VI is adjustable by the user. 

 

Well, using low NSCs (1/10/100), the time coming from the waveform and the actual time are pretty much the same. At NSC equal to 1000 it starts to appear a time-shift but is still ok for my needing. Setting NSC = Rate (10000), corresponding to acquire every 1 second, there is a significant time shift of about 1 second in the first set of data acquired and, then, a delay of such amount for coming next acquisitions. Interestingly, going back to lower NSC, i.e =100, the shift disappears and the two times align again. 

 

Any idea on how to troubleshoot that issue?

 

Really thanks.

 

PS: please do not question about having 2 stop buttons for the parallel loops, I know is not a good practice and is used here just for simplicity. 

0 Kudos
Message 1 of 3
(1,159 Views)
Solution
Accepted by topic author Riccardo_Rea

The behavior sounds fine, it's your interpretation that needs troubleshooting.  😁

 

When you read a block of samples, the waveform element t0 is going to represent the time associated with the very first sample in the block.  Thus when you read, say, 1 second worth of samples, t0 will be a time 1 second in the past.  The same thing is going on when you read 0.01 sec worth of samples (100 samples in your case).  It's just too small/fast/subtle to see.

 

 

-Kevin P

ALERT! LabVIEW's subscription-only policy came to an end (finally!). Unfortunately, pricing favors the captured and committed over new adopters -- so tread carefully.
Message 2 of 3
(1,148 Views)

@Kevin_Price thanks, I did suspect that I was the trouble and you've confirmed :D.

 

0 Kudos
Message 3 of 3
(1,122 Views)