LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Enum control vs Menu control

I found that Enum control is very efficient when use with a case structure because they allow us to see BOTH the text and its index on the top of case structure so we quickly see in wich case we are. Is there a way to get the same functionnality with a pull-down type control such like the Menu control (using LV 6.0.2)
0 Kudos
Message 1 of 6
(3,152 Views)
Hi

All controls in the "Ring & Enum" palette has a digital display (index display). I checked it in LV 6.1 but it should be the same in LV 6.0.2. That is easy to check: Place the Menu control, right click on it and select "digital display" under the "visible items". You should than see the number.

Luca
Regards,
Luca
0 Kudos
Message 2 of 6
(3,152 Views)
Hi

Forget my previous answer. I read your question to fast and was thinking you speak about to see the index in the frontpanel and not in the frames of the case structure.

Luca
Regards,
Luca
0 Kudos
Message 3 of 6
(3,152 Views)
You can use the menu control wired to an index array function and have the control's strings[] property as the array input to the function. Wire the output of the function to a case statement. The only disadvantage is that you will have to manually enter all of the strings into the cases.
0 Kudos
Message 4 of 6
(3,152 Views)
You can use a enum type def to dynamically create your menus on start up. Then search the enum string list, looking for the item tag selected. Type Cast that number to your enum. By doing this, to add a new step to your menu, you modify your type def, then add the case. You're done!

I do this because I work in support of researchers(phd's) and they never know what they want. :-)))
Message 5 of 6
(3,152 Views)
Hi,

This is not posible, because the strings in a Menu control can be changed
dynamically.

You can use the strings of the menu from a property node, and using the
value of the menu as an index. But you'll have to type the strings in the
case structure yourself.

When you need to make an enum with some items (e.g. from a piece of text),
you can do this. Put the items in a menu control, and use the 'replace'
option to change it to an enum. Now you have an enum with the items of the
menu. Use this enum in the case.

Regards,

Wiebe.

"martin pelletier" wrote in message
news:506500000008000000EF6B0000-1031838699000@exchange.ni.com...
> I found that Enum control is very efficient when use with a case
> structure because they allow us to see BOTH the tex
t and its index on
> the top of case structure so we quickly see in wich case we are. Is
> there a way to get the same functionnality with a pull-down type
> control such like the Menu control (using LV 6.0.2)
0 Kudos
Message 6 of 6
(3,152 Views)