From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, 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: 

how to put different increments in one digital control ?

Dear Group,
I have a simple question. I have to create digital control, where the
possible entry values are determined, and are not going in equal
increment. Simply saying the values which show up to the user , when he
clicks on the digital control window arrows are as follows: 1, 2, 5, 10,
20, 40, 60. Is there any way to do it with digital control window? I
know, I can do it with listbox, but I need it to be done with digital
control window.
thanks in advance,
chris
0 Kudos
Message 1 of 3
(2,790 Views)
chris szybinski wrote:

> Dear Group,
> I have a simple question. I have to create digital control, where the
> possible entry values are determined, and are not going in equal
> increment. Simply saying the values which show up to the user , when he
> clicks on the digital control window arrows are as follows: 1, 2, 5, 10,
> 20, 40, 60. Is there any way to do it with digital control window? I
> know, I can do it with listbox, but I need it to be done with digital
> control window.
> thanks in advance,
> chris

Chris,
there is not a simple way to accomplish this. There
is a hard way using a local variable and some serious
logic but I do not think you would like the results.

Is there some reason you can not use a ring control ?
This would be much easier to use a
nd you can recover
the values by indexing the string array attribute node
and a sting to decimal function.
Kevin Kent
0 Kudos
Message 2 of 3
(2,790 Views)
> > I have a simple question. I have to create digital control, where the
> > possible entry values are determined, and are not going in equal
> > increment. Simply saying the values which show up to the user , when he
> > clicks on the digital control window arrows are as follows: 1, 2, 5, 10,
> > 20, 40, 60. Is there any way to do it with digital control window? I
> > know, I can do it with listbox, but I need it to be done with digital
> > control window.
> > thanks in advance,
> > chris
>
> Chris,
> there is not a simple way to accomplish this. There
> is a hard way using a local variable and some serious
> logic but I do not think you would like the results.
>
> Is there some reason you can not use a ring control ?
> This would be much easier to use an
d you can recover
> the values by indexing the string array attribute node
> and a sting to decimal function.

Actually, since one of the rings looks just like a numeric, you can
just let the user increment and decrement a ring with the string "1",
"2", "5", ..., then the user will see a control that lets them do the
right things along with selecting from a menu. You can then use the
ring value to index an array of constants that match the strings.

You can also use an enum if you would like instead of a ring. The
other approach would be to use a numeric indicator and Boolean buttons
near the indicator to let you increment and decrement. You can use
the control editor to borrow the images from a real numeric's increment
and decrement buttons.

Greg McKaskle
0 Kudos
Message 3 of 3
(2,790 Views)