01-17-2019 06:25 AM
Hi together,
in the NI-CLAD preparation guide, a few sample questions are shown. One of these includes following vi:
And the question is, what is the size of the resulting array. The answer is 2 rows, 5 columns and apparently, the While Loop is executed twice (i=0, i=1).
Since acquisition rate is 1Hz and 5 samples are sampled in each loop iteration, each acquisition takes 5 seconds. Shouldn't the Elapsed time have already expired by then?
Thanks
Lysandros
01-17-2019 06:48 AM
The Elapsed time vi doesn't wait. It just checks time and return actual value. So, in first ("0") loop iteration it returns elapsed time "0" sec and "time has elapsed" is False.
I.e. loop goes to second ("1") iteration. And as the "0" iteration taked 5 sec, now "time has elapsed" is true.
01-17-2019 06:51 AM
Think DATAFLOW.
There is no dataflow dependency between DAQmx-Read and Elapsed Time, so these nodes will be executed in parallel.
Elapsed time will not wait for 4 seconds on the first call, it will just check, if 4 seconds since Re-Init have been elapsed. Obviously that is not the case, to the "Time has Elapsed" is false, the while loop will be called a second time, regardless of how long DAQmx-Read needs to take the 5 samples.
Regards, Jens
01-17-2019 06:57 AM
There is no data dependency between the DAQmx Read and the Elapsed Time. Therefore, they run in parallel. Therefore the Elapsed Time will return a FALSE on the first iteration (0 time has passed).
01-17-2019 06:58 AM