ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Using 2 different timing parameters inside 1 loop

I have one loop with its "Wait Until Next ms Multiple" function. At each 5000 ms, this loop checks the condition of a boolean variable to decide if it's going to run a case structure.
 
My question is: now I want to add another condition to run that case structure. I want that it run at each 20000 ms independently of the boolean variable's condition. How can I inclued this second timing paramenter in my loop? What's the best way to do this?
 
Thanks!
 
Daniel
0 Kudos
Message 1 of 5
(3,047 Views)
Hi Daniel,
since 20s is a multiple of 5s, you can use the loop index with a "quotient & remainder" to check on every fourth loop-count. Then use a case structure independent of the boolean variable.
Greets, dave
Greets, Dave
Message 2 of 5
(3,040 Views)
one way is to say if the current time since the start of the test - the start time of the test / 20000 has a remainder or your button is true and it has ben 5000 ms then to do your true case.

take a look at the attached vi

if you have any questions don't hesitate to ask
Message 3 of 5
(3,038 Views)

Thanks a lot, guys!!

It worked just fine with the "quotient & remainder" function.

Regards,

Daniel

0 Kudos
Message 4 of 5
(3,023 Views)
no problem just ask if you have any other questions
0 Kudos
Message 5 of 5
(3,019 Views)