LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Trigger Enum cases upon Selection

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.

0 Kudos
Message 1 of 3
(2,339 Views)

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.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 2 of 3
(2,333 Views)

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

Ca3.PNG

 

The depending on the test selected by the user I load the Queue with the states I need to run.

Ca2.PNG

 

Ca1.PNG

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 3 of 3
(2,302 Views)