LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do You Change Case Structure from True/False to String Control?

I'm a novice with LabVIEW and many things in LabVIEW are not very intuitive. I am trying to create a LabVIEW program that uses a case structure that will have multiple steps that will repeat over and over again. I've noticed on some of the examples that people have changed the case structure from a True/False case to string controlled cases. However, I cannot figure how they did it. I've looked at the help for the case structure and it gives very little information. What I need is a step by step explanation on how to do this, because I cannot find where NI provides that information. They just indicate that you can do it.

 

Thanks!

0 Kudos
Message 1 of 12
(9,118 Views)
This one is pretty easy! Just take a string constant or controla nd wire it to the "?" terminal on the case structure. The same is true for other things such as numbers and enums.
Message 2 of 12
(9,116 Views)

zenthoef wrote:
This one is pretty easy! Just take a string constant or controla nd wire it to the "?" terminal on the case structure. The same is true for other things such as numbers and enums.

....

 

and for string cases you have to have a default case to handle typos and you may want to enable (if not already ) Case insensitive match.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 3 of 12
(9,113 Views)

Use an 'Enum' and create multiple items within it.  Connect it up to the selector terminal, then right click on the case structure and select 'Add Case For Every Value'.  I think this is what you mean?  I've attached an example VI, which i hope you can open.  If not, it is only demonstrating what i've said here.  I've attached an image too just in case.

 

Message Edited by James Mamakos on 05-05-2009 01:49 PM


Never say "Oops." Always say "Ah, interesting!"

Message 4 of 12
(9,105 Views)
Thanks for all the help.  I wish NI would make their help files this easy!
0 Kudos
Message 5 of 12
(9,099 Views)

James Mamakos wrote:

Use an 'Enum' and create multiple items within it.  Connect it up to the selector terminal, then right click on the case structure and select 'Add Case For Every Value'.  I think this is what you mean?  I've attached an example VI, which i hope you can open.  If not, it is only demonstrating what i've said here.  I've attached an image too just in case.

 

Message Edited by James Mamakos on 05-05-2009 01:49 PM

 

.... and when useing enums, make sure you save the enum as a "type def" so that you can redefine the values once at let LV adapt everything else for you.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 6 of 12
(9,096 Views)

How do you save the enums as a Type Def? Do you open a separate LabVIEW file with just the enum control and save it as Type Def?

 

0 Kudos
Message 7 of 12
(9,090 Views)
...as above...  how?
Message Edited by James Mamakos on 05-05-2009 02:00 PM


Never say "Oops." Always say "Ah, interesting!"

0 Kudos
Message 8 of 12
(9,087 Views)

Right click on the control and select Advanced>Customize. This launches the control editor. On the toolbar of the control editor is a menu ring for selecting Control, Type Def, Strict Type Def.

 

Save the control when done (File>Save).

 

Using the LabVIEW Help - Custom Controls>Creating from Front Panel or Custom Controls>Creating with New Dialog Box.

Message 9 of 12
(9,071 Views)

Thank you Sir DenNIs!

 

Ben

Message Edited by Ben on 05-05-2009 02:20 PM
Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 10 of 12
(9,050 Views)