LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Loop timing (hw, sw, ...)

Hello,

my problem is about loop timing for data acquisition (and computations). As proposed, I use a time critical loop with high priority in LV RT, buffered read of, say, 4 scans (need low latency) at a sampling rate of, say 1500 Hz which will require 375 iterations per second. I set up the acquisition to be hardware timed (4472 board), so that is o.k. Now, to give the rest of the program a chance to operate, I have to introduce a delay in my TCL.

Which delay should I choose? Wait ms might block everything (if I understand right) and definitely takes away the time from my TCL, Wait until multiple ms would not match, as I have a required loop time of 2.66666 ms, hardware timed. Using 3 ms will make the loop too slow, using 2 ms might give
strange results based on the difference to the 2.66666 ms hardware timing, as the counter uses some kind of modulo operation.

How to say "lay back for the other threads a bit at the end of the iteration" without conflicts with the hardware timing?

Thanks,

acoustics
0 Kudos
Message 1 of 2
(2,593 Views)
Hi Acoustics,

If your TCL is set to "time Critical" AND the acq is hardware timed,

THEN you do not have to worry about the wait at all!

What should happen is your TCL will be put to sleep until the I/O completes. Durring the sleep period, your other non-TC code can run.

When the I/O is ready, the driver will wake up the TCL, let it run and then go back to sleep waiting for more data.

The key points are;
1) Only one TCL
2) Your TCL loop functions should wait on the I/O return data.

I may have mis-read your question so please forgive me if this confuses the issue.

Trying to help,

Ben
Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 2 of 2
(2,592 Views)