LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

control for case structure

Solved!
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
(7,661 Views)
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
(7,653 Views)
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
(7,650 Views)
radio control, list box, mixed checkbox you could also use.
Brian
0 Kudos
Message 4 of 14
(7,636 Views)
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
(7,616 Views)

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
(7,609 Views)

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

http://www.amazon.com/s/ref=nb_ss_gw_0_11?url=search-alias%3Daps&field-keywords=labview+for+everyone...

Brian
0 Kudos
Message 7 of 14
(7,602 Views)

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
(7,599 Views)
Solution
Accepted by 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,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 9 of 14
(7,585 Views)
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
(7,581 Views)