LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Resetting elapsed time in a state machine

Solved!
Go to solution

I'm working on a state machine which includes timed sub-routines that are triggered by Boolean controls. In plain English, the basic structure I have is: user presses button -> go to task 1 (state)-> perform task 1, has time elapsed? no -> go to task 1, has time elapsed? yes -> go to task 2 (state)...

 

The issue arises when I trigger the event a second time where the time aspect is essentially ignored since the time elapsed vi does not reset for all the tasks in the sequence. I created a simplified version of my state machine and managed to find a solution by using a shift register.

 

I am hoping there is a better and more elegant way!

 

In the simplified version, it's not a problem, but I already have 12 shift registers and I would prefer not to use another one if I can avoid it.

0 Kudos
Message 1 of 3
(2,700 Views)
Solution
Accepted by topic author aalansari

In my state machine, I usually have a shift register with a cluster of data in it. Then there may also be a shift register for the error wire and something else, but you should be able to get by with much fewer than 12.

0 Kudos
Message 2 of 3
(2,686 Views)

Good idea! This will definitely help!

0 Kudos
Message 3 of 3
(2,674 Views)