LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Is there a way to create a multi-state button or have a pict ring behave like boolean?

Does someone know of a way to make a multi-state button say (function one, function two,function three, off) or implement boolean-like behavior for a pict ring? I want to be able to cycle through the states without a menu popping up for all possible values. So when I press this button or ring it will go from state-1, to state-2, to state-3 etc.
0 Kudos
Message 1 of 8
(5,270 Views)
An example from NI with a picture control can be found here. There's another example here that uses a modified slider control for a 3 position toggle switch.
0 Kudos
Message 2 of 8
(5,270 Views)
> Does someone know of a way to make a multi-state button say (function
> one, function two,function three, off) or implement boolean-like
> behavior for a pict ring? I want to be able to cycle through the
> states without a menu popping up for all possible values. So when I
> press this button or ring it will go from state-1, to state-2, to
> state-3 etc.

Place a transparent button over a ring. On button value change events,
or via polling, increment the ring indicator. Better yet, put the value
in a shift register that gets incremented and displayed in the ring
indicator.

Greg McKaskle
0 Kudos
Message 3 of 8
(5,270 Views)
Put the pictures in a picture ring. In the control editor, enlarge the increment arrow so it covers the whole control and make it transparent.


LabVIEW, C'est LabVIEW

Message 4 of 8
(5,270 Views)
I just had a thought (don't everyone cringe at once)...

You could change the text on the button programmatically using property nodes and then when the button was pressed, read the button text to see which "state" it was in. A little clunky but it should work.

There are other, better ways of doing this, but I think that this is a "workable" solution. By building a typedef list of texts for the button, you could change it quite easily. I may try this just to see how it works.

Rob
0 Kudos
Message 5 of 8
(5,270 Views)
Okay, I just had to try. Here it is. Interesting.

Rob
0 Kudos
Message 6 of 8
(5,270 Views)
That's an interesting idea; I'll try it out. The example proposed by the pict-ring still shows all possible values which is not the behaviour that I need.
I wish there was a property which allowed you turn turn off that behaviour on rings and enums.

Alex Golovitser
0 Kudos
Message 7 of 8
(5,270 Views)
Excellent, that was exactly what I needed.

Thank you.

Alex Golovitser
0 Kudos
Message 8 of 8
(5,270 Views)