10-28-2011 09:45 AM
How would I use an event to force a jump to a certain case in a state machine? For example, in the attached VI, I have a state machine that will simply blink a green LED indicator on and off for five seconds. I have a case in which the LED turns red for five seconds and a button which I would like to use to jump to this case. In other words, if the state machine is currently halfway (2.5 seconds) through my "Green_Light_ON" case when the button is pressed, I would like the state machine to immediately jump out of the "Green_Light_ON" case and into the "Red_Light_ON" case. This is not my ACTUAL VI, but it's a simplified example that will work for finding my solution. Thank you very much in advance for your help!
10-28-2011 10:01 AM
Sounds like the classic "Producer-Consumer (Events)" design pattern. File>>New...>>VI from template. There is a good shipping example as well as the comments on the template vi
10-28-2011 10:50 AM
I would also suggest investigating Queued State Machines, where you can build "macros" which will carry out a sequence of States based on how the states are queued up. Check out the JKI State Machine, it is a classic example.