LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to configure the loop rates ?

Solved!
Go to solution

Hello,

I am trying to execute two time loop one at a rate of 1000 Hz and other at rate of 200 Hz. The problem I am facing right now is when I am executing the code they are not operating at the assigned frequency. Also I wanted to stop the loop execution when the 1st loop (200) Hz stops, the 2nd should also stop.   

 

loop rate.PNG

 

0 Kudos
Message 1 of 4
(573 Views)
Solution
Accepted by topic author rishab_kr

Hi rishab,

 


@rishab_kr wrote:

I am trying to execute two time loop one at a rate of 1000 Hz and other at rate of 200 Hz. The problem I am facing right now is when I am executing the code they are not operating at the assigned frequency.


Again you failed in attaching all subVIs

 

The loops can only iterate as fast as the code inside can be executed: which loop rates do you achieve in comparison to the "assigned frequency"? (THINK DATAFLOW!)

 


@rishab_kr wrote:

Also I wanted to stop the loop execution when the 1st loop (200) Hz stops, the 2nd should also stop.


Then you need to change the stop condition of the 2nd loop…

 

(Maybe another program structure might be useful: why do you need to output the same values 5 times per calculation of those values?)

 

General recommendation:

Cleanup the block diagram to use straight wires.

Never hide labels in the block diagram.

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 4
(550 Views)

Related to attaching VIs : I am not sure weather it will work or not in your system as it contain lots of file like FPGA and Sub VI.

 

I have shared the final one with one screenshot the upper time loop I executing at 1000 Hz and the lower one is at 200 Hz. Also I am not able to figure out how to stop the upper loop when the bottom one stops executing. 

 

Also I am not able to understand your question about the " why do you need to output the same values 5 times per calculation of those values" ?

 

I wanted to understand the possible reasons of such behavior, like the loop rates  ? 

 

I am really learning a lot out of your comments. Your comments are really crisp and to the point . Waiting for your another valuable guidance. 

Thanks in advanced.

0 Kudos
Message 3 of 4
(528 Views)

Hi rishab,

 


@rishab_kr wrote:

I have shared the final one with one screenshot the upper time loop I executing at 1000 Hz and the lower one is at 200 Hz.

 

I wanted to understand the possible reasons of such behavior, like the loop rates  ? 


You did not answer my question: which loop rates do you achieve?

 


@rishab_kr wrote:

Also I am not able to figure out how to stop the upper loop when the bottom one stops executing. 


You already know how to stop the loops in the first two sequence frames using the STOP button using a boolean function.

You know how to stop the TimedLoops based on the STOP/Stop buttons.

But now you don't know how to stop those loops based on conditions calculated from several boolean values???

 


@rishab_kr wrote:

Also I am not able to understand your question about the " why do you need to output the same values 5 times per calculation of those values" ?


One loop is calculating a matrix at (desired) 5ms intervals.

The other loop is using that matrix at (desired) 1ms intervals.

What happens inside the subVI so you need to use the same calculation result 5 times per calculation?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 4
(518 Views)