05-05-2009 01:31 PM
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!
05-05-2009 01:33 PM
05-05-2009 01:36 PM
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
05-05-2009 01:46 PM - edited 05-05-2009 01:49 PM
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.
05-05-2009 01:52 PM
05-05-2009 01:54 PM
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
05-05-2009 01:57 PM
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?
05-05-2009 01:58 PM - edited 05-05-2009 02:00 PM
05-05-2009 02:12 PM
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.
05-05-2009 02:19 PM - edited 05-05-2009 02:20 PM
Thank you Sir DenNIs!
Ben