From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Case Structure - multiple selectors, single exit

I tried searching for an anwser to my question but I could not find one.
 
I'm creating an interface for my graduation project (using LabVIEW 7.1) and I will be using several subpanel's, at this point I'm trying to create a selection method. During the design of the interface the users gave preference to buttons for switching between the different subpanels (there is a total of 4 buttons). And a subpanel is chosen based on a numeric value (I have taken the code from the viewer.vi example).
 
Now I'm trying to work out some sort of case structure starting from the 4 buttons and resulting in a single numeric value. The idea being that when button 1 is pressed, subpanel 1 is active and every other panel is not. So far I haven't found a working one, especially because of the single numeric value I want to have.
 
If the anwser is somewhere on this board then you have my apologies and I would appreciate a link to it.
 
If something is not clear: feel free to ask questions.
 
0 Kudos
Message 1 of 11
(5,264 Views)

I probably don't fully understand without seeing the code.

Can't you simply use a case structure with four cases and a single ouput tunnel, which you would wire from the result of each case?

0 Kudos
Message 2 of 11
(5,259 Views)


@altenbach wrote:

I probably don't fully understand without seeing the code.

Can't you simply use a case structure with four cases and a single ouput tunnel, which you would wire from the result of each case?




The input are buttons (which give me a Boolean value) so a case structure with 4 cases is impossible to make. I have added an image to give a better view, does this help?
0 Kudos
Message 3 of 11
(5,251 Views)


@Vraagteken wrote:
... does this help?

OK, maybe I am starting to understand what you want.

Easiest: Use a "radio button control"!

If you want to keep the buttons seperate, make them into an array and search for the first true value using search 1D array. Then use the index as number. (This assumes that only one button is active at any given time).

If you want to be able to distignuish between all 16 different combinations (0-4 on concurrently), use boolean array to number.

0 Kudos
Message 4 of 11
(5,244 Views)


altenbach wrote:

If you want to be able to distignuish between all 16 different combinations (0-4 on concurrently), use boolean array to number.



Thank you very much. It's not really important to distignuish between all combinations, but perhaps I can use it to allow only 1 menu to be active (and give a warning/signal to the user that multiple menu's are selected).
0 Kudos
Message 5 of 11
(5,240 Views)
That's why a radio button control is better. It automatically allows only one button to be active. Clicking a new one will turn the others off.
 
Try it! Just place any number of booleans (any style) inside the radio button control. The output will be a single number. If you wire it to a case structure, you'll get the control label for each as case name.
(you can also allow or disallow "no selection", etc.)
0 Kudos
Message 6 of 11
(5,235 Views)
Use Radio Button,
Or
Create boolean representation of the buttons..
 
But Radio button is more natural.
0 Kudos
Message 7 of 11
(5,211 Views)

i am also working that kind of problem 

but the main differnce is that i did'nt want to change other button status

pls help me

welcome to any suggestion

 

0 Kudos
Message 8 of 11
(4,338 Views)

You can try using the array of switch or no of switches by replacing the radio buttons.

0 Kudos
Message 9 of 11
(4,333 Views)

@Pardeep wrote:

i am also working that kind of problem 

but the main differnce is that i did'nt want to change other button status

pls help me

welcome to any suggestion

 


If you want several buttons and they should be able to be active at once, an array of buttons (booleans) is the easiest way to go.

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 10 of 11
(4,319 Views)