LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How can this be done? For Loop state Machine question! See attached code.

Solved!
Go to solution

I created a for loop state machine. So I would like my state machine to start from Level 1, then on the "timer state" I want the timer to go up to 10 seconds before moving to the next level which is level 2, then level 3. Then repeat. 

 

Right now, it keeps skipping the state timer without getting to 10 seconds. 

Can someone help? I am also working on it myself. 

 

Thank you!

0 Kudos
Message 1 of 6
(408 Views)

Highly flawed

 

  • You only need toe outer loop
  • Changing state should depend on the elapsed time. a LED does not change states.
0 Kudos
Message 2 of 6
(399 Views)

Hello Mr. Altenbach, Is this what you meant? Yes, I just noticed that led is not even turning on. I am working on it too. Maybe I should just stick with the traditional state machine taught in core 2 or 3.

GRCK5000_0-1715370752796.png

 

0 Kudos
Message 3 of 6
(391 Views)
Solution
Accepted by GRCK5000

Note that you don't want to have the wait depend on the loop rate, so use actual elapsed time as in this example that we already discussed long ago. remember?

 

 

0 Kudos
Message 5 of 6
(375 Views)

Thank you, Mr. Altenbach! Yeah, I remember this. This really helps. 

0 Kudos
Message 6 of 6
(269 Views)