LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to obtain enum label

I have a cluster array that contains 2 variables, an enum and a double. The enum is meant to be the variable name to allow for an easy top level programming. On the lower levels I handle all of the IO linking to the enum so essentially it could be a constant but I set it so the constant is in the initialize not in the definition.
 
Anyways I am wanting to remove the enum control but do not want to loose the data. I would like to pull the label into a string (or better yet an actuall label) to be able to display it on the front panel. Any idea how to do this?
0 Kudos
Message 1 of 27
(4,075 Views)
Is this what you mean?


Randall Pursley
0 Kudos
Message 2 of 27
(4,063 Views)

Randall,

 

Even easier, try a "format into string" Smiley Wink

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 3 of 27
(4,055 Views)
Yes!
 
Thank you!!!
0 Kudos
Message 4 of 27
(4,050 Views)
Ben,

Thanks.  I think I had seen that before but had forgotten.  Always good to learn something new.

Randy
Randall Pursley
0 Kudos
Message 5 of 27
(4,046 Views)

I just realized that will likely break some of my lower level routines... So I have another questions.

 

Is there a way to lock the enum? I do not want them to be able to change it after I have initialized all of the variable names, but I would like it viewable (it is the variable name).

0 Kudos
Message 6 of 27
(4,042 Views)
I guess you can create a custom control (type def) that contains the enum.  Then you set the Control Properties>>Protection to locked.  You can't seem to password protect it, but it would take an extra step to change it.



Randall Pursley
0 Kudos
Message 7 of 27
(4,033 Views)

I am not sure exactly what youa re saying. My enum is already a type def though. It is the selection that I want to lock (after the initialization is run that is...)

Essentially the problem is that I use the enum to have a variable name on the higher level programming. Mid level programming maps it out to some arrays which then are eventually mapped out to physical IO.

Since the variable name i critical in the mapping I do not want the user to be able to change it (or the system woudl break). I do want them to see it though.

If it can't be locked I am thinking maybe still convert to string and make the enum invisible. However if it is set to invisible will it remain invisible on a higher level access?

0 Kudos
Message 8 of 27
(4,028 Views)
Use the Disabled property node.

Lynn
0 Kudos
Message 9 of 27
(4,020 Views)
How do I use the disabled property node? When I switch it to that node it becomes a read only (can't switch to write) and it is numeric not boolean....
0 Kudos
Message 10 of 27
(3,904 Views)