01-14-2013 10:27 AM - edited 01-14-2013 10:30 AM
Hello all,
I've got a state machine with a sort of Stand-by state from where a user can select the next state using buttons. I tried using an Event structure with value change to select the next case but when the state machine is in a specific case and the button of an other state is pressed the whole thing blocks. I've attached an example, the LEDs just indicate what state you are in.
Thx for your time,
Bert
edit: Indeed, I miss-clicked
Solved! Go to Solution.
01-14-2013 10:28 AM
You have posted your .lvproj file. That doesn't provide any real information. It is just a description of all the .vi files that make up your project.
Please attach your actual main .vi file.
01-14-2013 10:40 AM
1. You don't need a while loop around your event structure. With the timeout not wired, you will never get a timeout event.
2. Your button events are set to "Lock Front Panel Until Event Completes". Uncheck that.
01-14-2013 01:29 PM - edited 01-14-2013 01:58 PM
All your inner while loop should not be there, they just gum up the gears. It is a bad idea to trap the code inside inner loops, because during that time, events cannot be handled, whil they are still queued up. For example if you are in state 1 and press state 3 100 times, then exit state 1, state 3 will be entered 100 times in a row, witout a possibility of escaping.
Thus the use of an event structure is also ill advised here.
Here's is a quick draft showing the same code without inner loops and without the event structure just to give you an idea what I meant. See if it gets you some ideas. It is still not perfect ...
(Sorry, I had to disconnect the type definitions, because you did not include it)
01-15-2013 01:37 AM
Thanks crossrulz and altenbach. Both your posts were very usefull.