LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

statemachine with multiple timer, possible?

Solved!
Go to solution

Hi folks,

 

is it possible to have multiple(10/20) timer in a state machine? Timer I meant as a stop watch, every stop watch will be set by queue with state machine and when the timer became 0 it will turn a Boolean on/off also, 20 timer will be on in same time and I have to check periodically all the timer with other command in state machine. Which is easy to use with a parallel while loop but I don't know if its possible to use 20 while loop in parallel in one vi. Is there any hardware timer can I use for this? probably will use cRIO for this.

 

 

thanks in advance.

 

 

0 Kudos
Message 1 of 5
(3,664 Views)

I am not completely clear on what you are asking, but I will attempt to address your questions.

 

Certainly multiple timers are possible.  The biggest issue may be what happens if several timers become 0 at the same time.  One way to approach this is to use multiple copies of the Express timer VI.  Another way would be to have an array of Stop times. Periodically check the current time against the values in the array, setting a boolean for each one where the time has expired. If the timing is too fast for software, it could probably be run on an FPGA system.

 

Lynn

Message 2 of 5
(3,661 Views)

Thanks john for quick response. Can you elaborate little bit more. if i use an express time vi, will it not be stuck in a while loop?

 

and yes i will build an array of timer to check it. can you send me an simple example ?

0 Kudos
Message 3 of 5
(3,659 Views)

The Elapsed Time Express VI does not wait until it has timed out.  Each time it is called it returns immediately with a boolean indicating whether the time has elapsed along with a numeric indiating how much time has elapsed.  It also has several reset options for starting it again.

 

Look at the detailed help and make some simple test VIs to see what it does.  The attached VI has the timer set for 10 seconds.

 

Lynn

0 Kudos
Message 4 of 5
(3,651 Views)
Solution
Accepted by McQuillan

This is very easy with LVOOP. Here is a timer class that I wrote some time ago (no pun intended) and an example of how to use it.

 

 

Test Timer_FP.png

=====================
LabVIEW 2012


Message 5 of 5
(3,644 Views)