11-29-2011 03:57 PM
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
11-29-2011 04:10 PM
11-29-2011 04:26 PM
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.
11-29-2011 05:21 PM
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.
11-29-2011 09:34 PM
Here is what i have so far.