LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

DAQmx timing question

Hi together,

 

in the NI-CLAD preparation guide, a few sample questions are shown. One of these includes following vi:

DAQmx_1.PNG

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



0 Kudos
Message 1 of 5
(2,744 Views)

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.

Message 2 of 5
(2,732 Views)

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

Kudos are welcome...
Message 3 of 5
(2,730 Views)

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).


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 4 of 5
(2,724 Views)

Hi Lysandros,

 

ElapsedTime is executed in parallel to DAQmxRead.

So in the first iteration the time has NOT elapsed, but in the 2nd…

Best regards,
GerdW


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