12-18-2008 03:12 AM
Hi,
An enum contains the names in its type definition, and this can not be changed in run time.
Cut from the help of the Strings[] property: "If the string is an enumerated type control, you cannot write this property when the VI is running"
If you wish to edit the strings programatically I believe using a text or menu ring is the way to go.
Regards
//Martin
12-23-2008 04:03 AM
Hello Siva,
To add to the discussion, you may find the following KnowledgeBase article useful:
What is the Difference Between a Text Ring and an Enum?
http://digital.ni.com/public.nsf/allkb/79BA4505AE8C755E86256FB2000140B0
12-23-2008 08:37 AM
As it has been pointed out, you can't change the items in an enum at runtime. You can however enable and disable (gray-out) items at runtime. Perhaps that helps.
Mike...
11-27-2017 01:32 PM
> download the OpenG toolkit, ...has a special 'enum to strings' VI
openg.org no longer exists. Support is now through lavag.org. See OpenG's Get Strings from Enum__ogtk.vi
11-27-2017 01:42 PM
> if ... you want to know the possible string values of an enum...
> download the OpenG toolkit, ... 'enum to strings' VI
See https://sourceforge.net/projects/opengtoolkit/ and Get Strings from Enum__ogtk.vi
11-27-2017 01:49 PM
11-27-2017 02:29 PM - edited 11-27-2017 02:30 PM
@GerdW wrote:
Hi dwb,
thanks for bringing back this old thread!
What's wrong with the "Strings[]" property of the enum? No need to download any library of VIs…
Not sure if it is currently a complication but...
In RT (LV 6.1) the FP control properties do not work. Drove me nuts that I could step through the code and see it work but when run as an exe, no-workie.
Ben
11-27-2017 02:46 PM
GerdW,
> What's wrong with the "Strings[]" property of the enum? No need to download any library of VIs…
I was really just updating information from another persons post because the URL and VI name have changed, but, if you want a list of the strings (or just the number of them) from a Block Diagram enum constant, that library function does it. I didn't want to create a Front Panel object just to be able to access the properties.
11-28-2017 03:29 AM
@GerdW wrote:
Hi dwb,
thanks for bringing back this old thread!
What's wrong with the "Strings[]" property of the enum? No need to download any library of VIs…
Or the 'Type def to strings' from the Variant function panel, no property nodes needed. 🙂
/Y
11-28-2017 06:04 AM
@Ben wrote:
Not sure if it is currently a complication but...
In RT (LV 6.1) the FP control properties do not work. Drove me nuts that I could step through the code and see it work but when run as an exe, no-workie.
It is still that way. It makes sense because there is no front panel loaded when an RT application is running. Exceptions are the remote front panels and the cRIO-903X controllers that have a Display Port that you can enable.