LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Enumerated Control Items

I have an enum control with three items (example:- x = 0, z = 1, c =2). On the front panel, when I use the increment/decrement buttons, these three items are displayed in alphabetical order (c,x,z). Is it possible to display the items in the order of their numeric values (x,z,c)? I cannot change their numeric values as I am using them to update a control property node. Hence that option is ruled out.
Thanks
p_oswal.
0 Kudos
Message 1 of 10
(3,923 Views)

I'm not sure I see what you mean.

The letters just cycle through as I click the increment/decrement buttons. If I click inside the control, I get a list of items to choose.

I'm using LabVIEW8.

 

0 Kudos
Message 2 of 10
(3,910 Views)
I am sorry, the example I gave was wrong...suppose x=0, c=1, z=2. In this case when you use the increment/decrement buttons it cycles through as x - z - c. Is it possible to have the enum cycle as x - c - z?
0 Kudos
Message 3 of 10
(3,901 Views)
If you start at "x" the order will be x-c-z when you use the down increment and x-z-c when you use the up increment. This is by design.

Message Edited by smercurio_fc on 03-16-2006 01:13 PM

0 Kudos
Message 4 of 10
(3,893 Views)

Thanks for the replies. My understanding of the problem was wrong. (The increment/decrement directions got me confused) The enum dose display the items in the order of their numeric value.

Thanks once again.

 

0 Kudos
Message 5 of 10
(3,879 Views)


@smercurio_fc wrote:
If you start at "x" the order will be x-c-z when you use the down increment and x-z-c when you use the up increment. This is by design.

Message Edited by smercurio_fc on 03-16-2006 01:13 PM




Why is it designed like this?

I must admit that I hadn't paid any attention to the order that the labels are displayed when using the increment/decrement arrows.

0 Kudos
Message 6 of 10
(3,874 Views)
Enumerated types are used to limit variables values to specific ones.

As those you specify will be the only ones, assigning values is not necesary, but they are added to help management.

One way to assign values is to give the first one value 0, and add one to every value as they enter into the group. That's an enumerated value.

So, if they are values that increment by one, using arrows to increment by one makes sense. When you reach the last one, as the only values are the ones in the list, it's normal to go to the first one

If you'd prefer to assign specific values to specific names (other than sequential starting by 0) and reorder names unacordingly to their values, you can use a Ring control

Hope it helps,
Aitortxo.
0 Kudos
Message 7 of 10
(3,865 Views)
Because it "wraps around". If you look at the choices vertically:
    x
    c
    z
then if you start at x and go up, it wraps around to the bottom, giving x-z-c. I recall there being a debate a long time ago about whether or not it should stop at the top/bottom. You can see for yourself what the outcome was.
0 Kudos
Message 8 of 10
(3,865 Views)

If it is a show-stopper, you can always eidt the images on the up/down bottons (in the control editor) and swap their positions.

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 9 of 10
(3,849 Views)

Great tip Ben.

-p_oswal.

0 Kudos
Message 10 of 10
(3,834 Views)