From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Timing

Hi NI family

 

what is the most effective way to alternate between two or more states in a state machine based on time. I would like to record data in one state , after 5 minutes log the data and after 10hrs or so run a pump,  valve , etc.

 

Thank you

0 Kudos
Message 1 of 5
(2,250 Views)

Hi Charles.m,

   You can use Time Elapsed VI  with Reset after elapsing time to true to switch from one state to another based on timing.

 

Thanks and regards,

SrikrishnaNF

SrikrishnaNF

 

Regards,
Srikrishna


0 Kudos
Message 2 of 5
(2,247 Views)

If i am correct that works if you have two states. How about when you have multiple states that have to execute at different times without conflict using the same timer.

0 Kudos
Message 3 of 5
(2,241 Views)

You can still use the Elapsed Time. Just set the Auto Reset to false. Compare the elapsed time to see if it's a multiple of your required time for that specific state. For example, for the "log" event, see if the elapsed time is at least a multiple of 5 minutes. Instead of the Elapsed Time you could also just use the Tick Count. The difference is that with the Elapsed Time you'll get seconds as a float, whereas with the Tick Count you'll get msec as an integer.

0 Kudos
Message 4 of 5
(2,228 Views)

Here is what i have  so far.

0 Kudos
Message 5 of 5
(2,216 Views)