LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Process "enum" labels dynamically...

Hello,

I search but I don't find 😞 how to dynamically modify labels of an
"enum" control by reading a text file with LabVIEW 6.1. Do you think it
is possible or not ? How ?

Thank you for your help

Daniel
0 Kudos
Message 1 of 6
(3,535 Views)
You cannot set the strings of a Enum control or indicator. See help under "Programmatically controlling VIs>>VI Server properties and methods>>Generic Class>>GObject>>Control>>Properties>>Numeric>>Named Numeric>>Strings[]".

We use a Menu Ring. This one you can set with the Strings[] property.

Waldemar
Waldemar

Using 7.1.1, 8.5.1, 8.6.1, 2009 on XP and RT
Don't forget to give Kudos to good answers and/or questions
0 Kudos
Message 2 of 6
(3,535 Views)
If you mean by labels of enum, the strings, then you cannot do that for an enum. This is how an enum is
You can use a ring and change / set the strings using the strings attribute property. For an enum type, this property is a read only.
However you can create a enum type-definition and change its strings, This would affect all the instances of the type definition. , and yes, the strings (of the type def) have to be changed manually
Message 3 of 6
(3,535 Views)
Yes, you can change (write) the strings of an enum. However, the VI containing the enum must be idle (not running) in order to write to this property (it doesn't matter for reading). To do this, open a VI reference from another VI and then get a reference to the enum by getting a panel reference, and then searching through the Controls[] for one with a Label.Text whose name is the same as your target enum.

-Jim
Message 4 of 6
(3,535 Views)
Dear Jim,

you are right it is working in LV 6.1. The help is not correct, it says "This property is read only for enumerated type controls.".

The LV 7.0 help is more precisly. It distinguishes between Enum and Ring.

Waldemar
Waldemar

Using 7.1.1, 8.5.1, 8.6.1, 2009 on XP and RT
Don't forget to give Kudos to good answers and/or questions
0 Kudos
Message 5 of 6
(3,535 Views)
here is a solution I found in the developer zone
(provided by "Underflow" (nick name in the user group),
topic "Populate ENUM RING via Property Node String[]"
on 8/29/2003), I added two minor things.
Best regards, Stefan
0 Kudos
Message 6 of 6
(3,535 Views)