Showing results for 
Search instead for 
Did you mean: 

control for case structure

Go to solution

I am trying to create a case structure that allows me to select which set of data I would like to graph (I have 3 sets).  I am graphing 3 separate signals of degrees of rotation on the x-axis, and 1 torque signal on the y axis.  My problem is I cant seem to create a control to switch between the three cases, I can only find a control to switch between two cases.  I am using LabVIEW 8.6 and am relatively new to labview so I appologize if this is a simple question.


Thanks for the help!

0 Kudos
Message 1 of 14
I would suggest creating an enum with three items.  Alternatively you can use integers or strings among others.  You can wire a number of different things to the selector of a case structure.  The default, as you're seeing, is boolean.
Tim Elsey
Certified LabVIEW Architect
0 Kudos
Message 2 of 14
You can use a numeric control. A plain integer control, a ring control, an enum control all work. You just wire up the numeric to the case selector. The advantage of an enum is that the enum text is automatically displayed in the selector label. You could even use a string control such as the combo box.
0 Kudos
Message 3 of 14
radio control, list box, mixed checkbox you could also use.
0 Kudos
Message 4 of 14
Ok thanks for the responses.  I will try them out, but I have developed another problem with the case structure.  If I delete my third case, leaving me with two cases, then rename the cases "True" and "False", everything works fine.  As soon as I add the third case however, it does not work.  How do I properly name the three cases so the case structure will work?
0 Kudos
Message 5 of 14

You are going to have to provide some details. What exactly do you have wired to the case selector. As already noted, the case structure will adapt to the datatype of the case selector. The 'names' will vary. And, if you have a boolean wired to the selector, you cannot have more than 2 cases. Why don't you at least post an image of what you have done?


You might also check out the labVIEW tutorials. Case structures are pretty basic.

0 Kudos
Message 6 of 14

I would recommend the book "LabVIEW for Everyone" for someone starting out.  Even an earlier cheaper addition would be of benefit to you.

0 Kudos
Message 7 of 14

Here is my VI.  The area in question is at the very bottom center.  there is a case structure with the cases: D/P, I/E, and A/A.  This case structure spits out a data that goes to the XY Graph.  When I right click on the ? on the case structure and say create control, all it gives me is a boolean control.


Hopefully this will clerify.

0 Kudos
Message 8 of 14
Accepted by topic author Clemson11

Hi Clemson,


you don't need a case structure here... See attachment! (I just made an enum constant instead of a control, change to your needs...)


The rest of the code is somewhat... eehh... - I would use more arrays instead of all those wires and same casestructures...

Message Edited by GerdW on 07-08-2009 09:29 PM
Best regards,

using LV2011SP1 + LV2017 (+LV2020 sometimes) on Win10+cRIO
Message 9 of 14
Don't right click and select 'Create Control'! As has been mentioned, a Boolean is the default. Create the control type you want first and then wire it. In your case, it looks like you want to use an enum or a string.
0 Kudos
Message 10 of 14