03-21-2012 06:19 AM
I have an enum that is full of items. I would like to change the lables on these items at runtime. When i attempt to, using the property node "Strings []" I get the following Error:
"Error 1073 occurred at Property Node (arg 1)
Possible reason(s):
LabVIEW: This property is writable only when the VI is in edit mode, or this method is available only when the VI is in edit mode.
Property Name: Strings [] "
Solved! Go to Solution.
03-21-2012 06:25 AM
You cannot change item names of an enum at runtime. That is why you get the error.
03-21-2012 06:30 AM
what is it you are doing that requires you to change an enum at runtime? perhaps other methods may be more suitable
03-21-2012 06:30 AM
is there any way to do this programatically. I have an array of strings, and I would like edit a ready existing Enum so that the currently existing values become that in the array.
03-21-2012 06:41 AM
as paul said, this cant be done and I would have thought this would go against the principle of an enum. Can you not use the array directly? Can you describe the application please? may make it easier to suggest alternatives
03-21-2012 06:42 AM
Hi,
So I am trying to create a VI in which I can store my result. I have taken over a lot of code that is a bit in a mess and I thought that this might be the nicest way to go about things. This VI has space for 50 bits of results data (strings). Within a parent VI I intend to place this vi, Create a constant for the Label and corretly label and store the results info created in the parent VI. At the end of the app all this data will be returned using the label data... I would be very nice if I could do this by just entering data into an array as appose to editing the enum. If the best way is to use this VI as a template and edit the enum, then let me know. Cheers, Alec
03-21-2012 06:52 AM
03-21-2012 06:57 AM
You cant change values of enum at runtime. You would need to replace the enum with combo box, ring or similar control.
03-21-2012 07:03 AM - edited 03-21-2012 07:06 AM
I can't look at your code right now, but from your description you may want to use a Combo Box or Ring instead of an Enum.
http://lavag.org/topic/5147-enum-vs-ring/
(I'm so slow in typing my answer compared to others, but maybe the hyperlinks will make up for it )
03-21-2012 07:16 AM
If it use a Ring, The right clicking on the input terminal associated with the control and selecting "Create Constant" will not give me a list of all of the possible labels. This feature is integral to the working of the vi as explained above