05-12-2020 04:03 PM
Your enum is a typedef and it will only work if the string matches one of the items exactly. If it does, it works just fine. You cannot change the items of an enum at run time. What exactly are you trying to do?
11-30-2020 02:24 PM
altenbach,
Excuse me for jumping in.
"You cannot change the items of an enum at run time. What exactly are you trying to do?"
So, there is no way to fill the strings in an enum other than manually, correct? I have a list of about 24 items I would like to have an an enum. If there is another wy, I would like to know, for this and future uses.
Thanks,
Roy
11-30-2020 05:07 PM
You can't set the value of enum strings during run time of a program, but if you use VI scripting to create or edit the enum control while it's not running, then you can.
Or, to do it without scripting, place down a Ring control, set its strings to what you want the enum strings to be using a property node, and then use the right-click-->Replace functionality to replace the Ring with an Enum, and your enum now has all the values that your Ring did.
11-30-2020 05:17 PM
Yes, there is a "way to fill the strings". you just cannot do it "at runtime". (Runtime is the important part)
You can modify the enum from a different vi through scripting. In fact I have done the same thing as you want to do so many times I created my own tool for it.
Where "Your Enum.vi" contains the enum you want to modify.
Hope this helps.
11-30-2020 05:21 PM
Thanks, all, for the quick replies. I now have several solutions and a new tool for my toolbox (thanks, Frozen).