09-07-2016 07:53 PM
Hey, in my attached program I am checking if two translation stages are in a specific position. If yes, I want my code to execute a sequence of moves. If not, I am prompting the user if he wants to contibue from this position anyway. He has three options: yes, go to load (the specific position) and cancel. If he hits yes, I am using a Value signal property that should update one of the boolean controls to true, allowing the sequence to commence. Canceling and "Go to Load" work fine, but "Yes" does not. I suspect that I need an event structure to ahndle the value change event of the boolean control "x", however, adding this event structure for some reason does not even allow me to click the start procedure button.
Thanks for any help in advance.
Doug
Solved! Go to Solution.
09-07-2016 08:33 PM
You really should look into using a State Machine. You really should not have this much happening inside of an event structure.
Furthermore, I would use a Shift Register to hold that value instead of a front panel control.
09-07-2016 09:29 PM
Thanks for your comment. I have solved the problem by pulling the Boolean control "x" out of the case structure it was in and placing it in the same event structure as the "Start Procedure" control.
As to your comment on a state machine: Do I not need all these case structures? Depending on the output of the booleans I require a different thing to happen. Even a state machine requires several case structures for this, no?
Cheers
Doug
09-08-2016 01:06 PM
@bockdoug wrote:Even a state machine requires several case structures for this, no?
If set up properly, a State Machine should just have the one case structure with many cases to choose from based on the state enum/string.