05-25-2022 06:52 AM
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.
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.
Solved! Go to Solution.
05-25-2022 07:11 AM
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
05-25-2022 10:38 AM
@Kevin_Price thanks, I did suspect that I was the trouble and you've confirmed :D.