LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

run a structure if a specified condition is met for a specific time.

Hello, 

 

I am trying to code a timed sequence; I want to write a case structure to turn off a LED if a condition is true for a specified amount of time. I used get current time in the if statement and I want to see if that case is true for a minute, then turn off the LED. The current time gives me a time stamp how do I get time passed in seconds? 

 

Below is the image of my current program: if the time is above 60 s stop the program. I want to get the updated numerical control value from when the case is true and for how long. 

 

Rubab45512_0-1679952515634.png

 

 

0 Kudos
Message 1 of 4
(824 Views)

Use FGV Timer SubVI.

When the condition is true, set the enum to Start and specify your Target Time. Then poll the timer using Get Time and wait for the Time Elapsed to happen.

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

Way too complicate! You can use this code skeleton and just change the condition according to your needs.

 

(Since you are only interested in relative times, a full timestamp is overkill.)

 

On a side note, you will get much better help if you attach your VI instead of a picture.

0 Kudos
Message 3 of 4
(800 Views)

See if this can give you some ideas....

 

 

altenbach_0-1679959799874.png

 

0 Kudos
Message 4 of 4
(796 Views)