03-19-2012 08:04 AM
Hi everyone
I have a question on how to wire multiple inputs in to the selector terminal of a case structure.
Currently, I have three switches, each switch determines different case. So if I switch the switch 1 is on, the numeric indicator will show 1. If the switch 2 is on, the numeric indicator will show 2, so on and so forth. However, the selector terminal will not allow me to wire multiply inputs into the case structure, I tried Bundle by Name, Bundle and Array to Cluster, but they did not work. I set the case structure with 3 cases, they are 1, 2 and 3.
Could someone help me please. I have attach an image and the VI of the work I did so far.
I have another question, is there a function which can toggle other switches to off when there is a switch has been toggled on.
Thank you very much
Tommy
03-19-2012 08:20 AM - edited 03-19-2012 08:28 AM
Tommy,
i think you are looking for something like the attached VI.
If the user should only select ONE button OF N, you should exchange that buttons with a RadioButtons control.
hope this helps,
Norbert
EDIT: The attachment is created with LV 2011, not 2012 as the name indicates..... sorry for the confusion
03-19-2012 08:24 AM
Try using radio buttons,,,
03-19-2012 10:09 AM
Thank you very much for the help.
Could you explain how to configure the background colour of the radio button, please. I tried right click and properties, but no options for me to change the background colour.
Thanks
Tommy
03-19-2012 10:18 AM
Tommy, attached find a cheeseball way of doing this that has given me a LOT of mileage over the years. IT lends itself nicely to a couple of really good practices that NI recommend, but I have given you the bare-bones to "see under the hood".
The recommended practices:
1. You can make this a nice tight sub-vi where you can put it into a core library of routines that you'll use over the years, even extending the logic to look only for changes, etc.
2. If you are thinking about Front Panel design considerations, you'll want to use arrays of controls where possible, as that's a nice neat way of containerizing your switch for both the FP and Block Diagram.
Have fun. I have TONS of these types of things, so feel free to PM me if you have any other needs.
Wes
03-19-2012 10:19 AM
Hi
If you have a selection of only three options, you can use a System Mixed Checkbox.
You can use radio buttons as suggested earlier.
If you are using boolean, there is a better way to check if Boolean is true and to set a number for it.
Attached is a VI in LV2010SP1
03-19-2012 10:21 AM
Hello Wes Ramm
Could you please post the vi in a lower version. I have LV2010SP1?
I could not see the vis attached in LV11, so if my post is redundant, please do not mind.
Thank you
03-19-2012 10:24 AM
<Could you explain how to configure the background colour of the radio button, please. I tried right click and properties, but no options for me to change the background colour.>
Just use the brush tool
03-19-2012 10:25 AM
My pleasure!!!
W