LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

timed loop termination

Solved!
Go to solution

My application involves a closed-loop system where I control current which heats a resistive load.  I want to ramp up the current until a specifed temperature is measured, dwell at that temperature(within a tolerance) for a specified amount of time, and then terminate the VI.  I have attached a VI which simulates the data I expect to see.  How can I make the VI terminate 2 seconds after the data first reaches 10.0?  Counting loop iterations doesn't seem like a good solution since there will be other things going on in my real application.  Seems like I should use a timer.  Any suggestions will be greatly appreciated.

0 Kudos
Message 1 of 4
(2,264 Views)

Hi VI_Joe,

 

Perhaps it should be something like the below?:

timed loop.JPG

 

First, you use the property nodes to initialize the value. Within the while loop, I have a ramp value taken from the number of iterations (based on your code). A boolean function "greater or equals" checked if the number of iterations has reached 10 or past 10. If so, it provides the true value to the "select" function which will switch its output from the number of iterations value to the random number value (based on your code as well). 

 

When the "greater and equal" function is true, the "not" function will provide a false value to the Reset input of the Elapsed Time Express Vi which will then cause that express vi to start counting for 2 seconds. After 2 seconds has passed, the Timed Has Elapsed? output will provide the true value which then terminates the while loop and thus stops the VI.

 

Hope this helps

 

Warmest regards,

Lennard.C

Learning new things everyday...
Message 2 of 4
(2,219 Views)

Looks like a winner to me! Thanks so much for your help/

0 Kudos
Message 3 of 4
(2,210 Views)
Solution
Accepted by topic author VI_Joe

Hi VI_Joe,

 

You're welcome. If this is your solution, do mark it as a solution. 🙂

 

Thank you

 

Warmest regards,

Lennard.C

Learning new things everyday...
0 Kudos
Message 4 of 4
(2,207 Views)