LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

state machine stuck in one state

Solved!
Go to solution

Hi all,

 

I'm having problems with a state machine getting stuck in one of the states. It is supposed to execute in a cool state for X number of seconds, then a hot state for Y number of seconds. This cool-heat cycle repeats until the time elapsed since running the machine = the time set by the user.

Currently my machine is stuck in a cycle of cool -> heat -> heat-> heat.... etc. until the timer elapses. Under inspection with highlighted mode, it doesn't show an error (shows cool-heat-cool-heat cycle), however when running without it wont.

Any help is greatly appreciated.

 

Cheers

Download All
0 Kudos
Message 1 of 5
(3,335 Views)

In your heat and cool cycles, you are comparing the tick count function to the number 30,000.  Tick count is the number of milliseconds since your PC has been turned on.  It has nothing to do with how long that VI has been running or a particular state has been running.

 

You need to use the elapsed time express VI, or store the initial tick count when the state starts in a shift register and compare the new tick count to that.

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

Ooops, I uploaded the old version of the VI. I'm now using the time elapsed function rather  than tickcount- the problem is occuring on the VI I have uploaded in this post.


0 Kudos
Message 3 of 5
(3,271 Views)
Solution
Accepted by topic author rwills

Hi,

 

Maybe you coud do it like this:

 

Reseting elapsed time via state transition.

 

Regards

andreas

 

Certified-LabVIEW-Associate-Dev_rgb-1.jpg

 

0 Kudos
Message 4 of 5
(3,250 Views)

Yes i thin that "Reseting elapsed time via state transition" is the best solution 😉

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