LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Timing a State Machine Across States

Solved!
Go to solution

Hi LabView Community,

 

I am running a state machine (attached) in which I want to measure the time the VI is running across multiple states. The VI is used to take power spectra of various samples. My planned execution goes like this: the user selects, on the front panel, how often they would like the data to be taken. After pressing start on the front panel, a timer begins. When the machine gets to the "Wait" state, I would like to have the VI wait the amount of time the user selected minus the amount of time that has already elapsed since the user pressed start. So for example, if the user wanted a spectrum taken every 15 minutes, and the time since starting was 13 minutes, I would want the program to wait 2 minutes, and then repeat.

 

If anybody could help me with this, it would be much appreciated!

 

Thank you in advance.

0 Kudos
Message 1 of 3
(3,578 Views)
Solution
Accepted by topic author WorkerDrone

You just need to store in a shift register either the time the activity originally started.  Or the sum of the amount of time that has already passed.

 

PS:  You've used a lot of local variables and none of your terminals.  Many of those local variables should also be shift registers as well.

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

Ah, of course; shift registers. Thank you so much!

0 Kudos
Message 3 of 3
(3,557 Views)