03-27-2023 04:30 PM
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.
03-27-2023 04:54 PM
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.
03-27-2023 06:19 PM
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.
03-27-2023 06:30 PM