05-26-2017 06:47 AM
Dear All,
I have been working on a project. It's an enum controlled State machine. All cases are triggered by individual buttons.
Here is the requirement.
>> When 'Cycle Test button is pressed', user will give different test requirement (Which is stored in FGVs for further use-may be its not needed). I want to run different cases (Tests) in same order as user input (one by one). After running all tests in the same sequence as user demands, return back to 'Wait for events'.
I have tried producer/Consumer but i could not find it useful in enum case (Or may be i don't know how to use it).
Note: I cannot change enum controlled state machine, as it is a large project. What i have attached here is deleted version (where i have deleted all programs inside case structures).
Kindly help me in this regard. I will really appreciate any help.
Kind Regards,
Khan.
05-26-2017 06:58 AM
What I do in my state machines is use a Queue to hold the states I need to go through. So the user can input all of the steps/states needed and you just add a Wait For Event state at the end. Dequeue your states instead of putting them in a shift register.
05-26-2017 09:54 AM
Building on what Crossrulz said, I too suggest a Queued State Machine.
Here is an example I did in one of my tests.
I start out preloading the Queue with a few states to get everything setup for the test
The depending on the test selected by the user I load the Queue with the states I need to run.