06-08-2013 05:29 PM
Hi,
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.
06-08-2013 05:41 PM - edited 06-08-2013 05:44 PM
just 'or' compund the stop control and error to the stop terminal
06-08-2013 05:44 PM - edited 06-08-2013 05:49 PM
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 ?
CLUSTER
EVENT STRUCTURE
EXIT CONDITION -> TRUE TO STOP
06-08-2013 05:49 PM - edited 06-08-2013 06:17 PM
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...
06-08-2013 05:51 PM - edited 06-08-2013 05:52 PM
Could you please explain what exactly does it mean by a problem in the data flow ?
06-08-2013 07:34 PM
What will happen if I want an state machine inside another state machine ???
Just like the attached VI
06-09-2013 02:11 AM
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.
06-09-2013 02:13 PM
Hi,
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.
Kind Regards
Ram Gurung,
Certified LabVIEW Associate Developer.
06-09-2013 02:18 PM
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