LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

retrieve case values from case structure

I have a case structure in a state machine with a string input. Is there a way to retrieve the strings of all the case structure values?

 

For example, if the case structure has three states: "Init", "Run", "Shutdown". I would like to programmatically look at the case structure and return a string array with the three case values.

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

You will need scripting to get at the strings associated with each of the states of a case structure.

 

Now if it was an enum instead of string... that would be easy.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 2 of 3
(2,604 Views)
Here is a way to do it with out strings. I use an Enumerated value. If you hook it up to a case structure and have it add a case for every value then you see the steps. The enumerated value is a strict type def so that if you add a states all you have to do is have the case structure add a case for every value.
Tim
GHSP
0 Kudos
Message 3 of 3
(2,593 Views)