LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Achieve Constant Loop rate for 9213 module

Solved!
Go to solution

Hi everyone, 

 

I use 9213 module with cRIO 9067 and the example code for 9213 in Labview 2019.  The difference between my code and the example code is that I add in tick count and loop timer for FPGA code. I am trying to acheive 100 S/s for 6 channels DAQ, which is acheivable for high speed mode according to the data sheet. 

QianBath_0-1688647953346.png

 

QianBath_0-1688647003324.png

I expect the time difference between sample will be 0.01s, but it varied a lot. It seems to defeat the point of using loop timer.  

QianBath_1-1688647520122.png

How can I achieve constant loop rate in this case?

 

 

0 Kudos
Message 1 of 4
(525 Views)
Solution
Accepted by topic author QianBath

What is the False Case value wired to the Loop Timer? I think that is the source of the issue. The value 10 is only valid once when the Update Conversion Time case is true. The Loop Timer will continue to use the value from the false case for the rest of the time.

You don't need to use a Loop Timer to time the loop if you want it to run at the maximum speed. The while loop will wait for the FPGA I/O Node of NI-9213 to execute. You only use the Loop Timer when you want the loop to run at a lower rate.

-------------------------------------------------------
Control Lead | Intelline Inc
0 Kudos
Message 2 of 4
(509 Views)

Thank you for answering. I wire in the False case like this. The Real time target program will default to true first and then false. 

 

QianBath_0-1688649081286.png

So maybe I should set the timer to 11ms? Without the loop timer, it will be random loop rate. 

 

0 Kudos
Message 3 of 4
(504 Views)

ah, I got it, in order to have contant loop rate, the time loop rate need to be 13ms. that is about 76 S/s.

0 Kudos
Message 4 of 4
(476 Views)