LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Let picture ring behave like boolean control

I want to create a picture ring that behaves like a boolean control. When clicked on, it shouldn't display a list of possible states, but just skip to the next state. The scroll buttons shouldn't be used.

Or a boolean control that works like an enum. I know this sounds confusing, but my bool ctrls doesn't work the way they should when connected to certain datasources. All numeric ctrls and enums work fine.

How do I change the behaviour of a control?
0 Kudos
Message 1 of 5
(3,570 Views)
The simplest way I can think of is to customize a boolean control,
replacing the TRUE and FALSE pictures by images of your own, and direct
the output to a "Select" vi that will choose between whatever two data
of the same type you actually want to use.

It sounds attractive to encapsulate the selection in the actual control
object "read value" method, but there is no simple way to do this in
LabVIEW. So using the solution above should fit your need if your
program doesn't require a a lot of instances of the control to be read
and modified around frequently.

tfd a écrit:

>I want to create a picture ring that behaves like a boolean control.
>When clicked on, it shouldn't display a list of possible states, but
>just skip to the next state. The scr
oll buttons shouldn't be used.
>
>Or a boolean control that works like an enum. I know this sounds
>confusing, but my bool ctrls doesn't work the way they should when
>connected to certain datasources. All numeric ctrls and enums work
>fine.
>
>How do I change the behaviour of a control?
>
>
0 Kudos
Message 2 of 5
(3,570 Views)
> I want to create a picture ring that behaves like a boolean control.
> When clicked on, it shouldn't display a list of possible states, but
> just skip to the next state. The scroll buttons shouldn't be used.
>
....

> How do I change the behaviour of a control?

Two ways. If you really have two states, then customize the Boolean
button using the control editor as stated in the other post.

If you have more than two states, then the Boolean shouldn't be the
indicator, as it only has two values, but you can still use it as the
control the user interacts with. Place a ring control on the panel,
make it an indicator, and cover it with a Boolean button that you then
make mostly or completely transparent. You may also want to select and
group them toget
her. On the diagram you can read the button value
changes using either polling or events (with 6.1), and you can update
the value of the ring to the appropriate state.

Greg McKaskle
0 Kudos
Message 3 of 5
(3,570 Views)
For more than two values, the event structure even makes it possible to
actually use only a simple pict ring control.
Catching the "Mouse Down" event, you can use the control ref to update
the ring value (basically taking mod(currstate+1,nbstates)), update any
alternate type/value alias variable, and also discard the event to hide
the pop-up selection that will remain otherwise.

That's neat but the diagram size will grow along with the number of
these you want to use... - oz



Greg McKaskle a écrit:

>> I want to create a picture ring that behaves like a boolean control.
>> When clicked on, it shouldn't display a list of possible states, but
>> just skip to the next state. The scroll buttons shouldn't be used.
>>
>> How do I change the b
ehaviour of a control?
>
> Two ways. If you really have two states, then customize the Boolean
> button using the control editor as stated in the other post.
> If you have more than two states, then the Boolean shouldn't be the
> indicator, as it only has two values, but you can still use it as the
> control the user interacts with. Place a ring control on the panel,
> make it an indicator, and cover it with a Boolean button that you then
> make mostly or completely transparent. You may also want to select
> and group them together. On the diagram you can read the button value
> changes using either polling or events (with 6.1), and you can update
> the value of the ring to the appropriate state.
> Greg McKaskle
0 Kudos
Message 4 of 5
(3,570 Views)
I have to display status info for ± 800 tags. So maybe it would be easier to convince them to be satticefied with selecting the state from the ring.

All these controls are directly linked to DS on the front panel, since half of it should be able to write as well. But, as already mentioned, the bool ctrls doesn't subscribe correctly to RSLinx opc. Using other opc servers I have no problem.

Thanx for your help.
0 Kudos
Message 5 of 5
(3,570 Views)