LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

An example of a state machine with transition array?

I am looking at state machine design patterns and am interested particularly in a state machine with boolean trasition array which defines the next state to be executed using an array. Here, the index of the first “True” boolean in the boolean array corresponds to the index of the new state in the array of enums. Has anyone got an example of this design pattern as it would greatly help in my understanding of it. Refer to figure 3c in http://zone.ni.com/devzone/cda/tut/p/id/3024#toc2 for clarity on what i am asking for.

 

Thanks in advance.

0 Kudos
Message 1 of 3
(3,655 Views)
That seems like a lot of extra work. Why not just use a queue, and queue up the enum you want to go to next? Look up examples on queued state machine. No need for an array and then a boolean to index that array. here is an example
0 Kudos
Message 2 of 3
(3,641 Views)
I agree but if you want to, look at the example called 'Old Event Handler'.
0 Kudos
Message 3 of 3
(3,635 Views)