I am not able to stop the execution of this program by using the stop boolean control. I am using Event structure to act according to user input.
I am not able to figure out what could have gone wrong.
just 'or' compund the stop control and error to the stop terminal
My Stop control is in the cluster. So since everything is in a while loop, should'n the program stop once there is a Value change in the Event Structure ?
EXIT CONDITION -> TRUE TO STOP
Well, the problem is data flow..., but that still will not give you control because you passed the event case..Use 'highlight execution' to see the data flow of sequences
usually put the event structure in a 'wait/idle' case, but since you have a timeout case pointing to another case..It will always go there
I suggest writing down the sequence of events (data flow) and transitions to get there, whether by user interface or timed/finished events.
And also suggest replacing the incremental shift register with an ENUM command pointing to your next case, this is not intuitive to someone else. type def the enum incase you add more cases to the state machine in the future...
Could you please explain what exactly does it mean by a problem in the data flow ?
What will happen if I want an state machine inside another state machine ???
Just like the attached VI
Your sequence executes 0, 1, 2, 3, 3, 3, 3, 3, 3,... forever 3.
Your event structure is in 1, which never executes after the initial time, so you never handle the stop-button event.
I have found two errors regarding the stop button.
1) Avoid splitting the items in a button cluster into different events. Try keeping the event button inside the event case.
2) The time out on your code was 0. remember -1 means no time out and rest means in millisecond. you put 0 that means everytime your code is executing timeout event and repeating the same state again and again.
The modified solution code is attached with this reply. And it works perfectly.
I have developed many applications using advanced programming techniques and recently sat a CLD exam.
Certified LabVIEW Associate Developer.
Thank you. yeah I got that figured out. But now I am facing with the problem of looping it endlessly.
Please take a look here: http://forums.ni.com/t5/LabVIEW/Nested-State-machine-Loops-continuously/td-p/2454710