From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
09-29-2010 10:23 AM
Hi,
I have a large text ring constant. I would like to convert it perminantly into an enum constant (not at run time, just for programming with). Anyone have any ideas how I might do this?
Cheers, Alec
Solved! Go to Solution.
09-29-2010 10:32 AM
Look at the Right Click Framework.
There is one utility to create and Enum from an array of strings.
09-29-2010 10:34 AM
how would you generate an array os strings from a Text Ring?
09-29-2010 10:41 AM
@alecjcook wrote:
Hi,
I have a large text ring constant. I would like to convert it perminantly into an enum constant (not at run time, just for programming with). Anyone have any ideas how I might do this?
Cheers, Alec
Provided the strings are not duplicated and the values are consecative then...
pop-up ring and choose make control.
pop-up on control and selecte replace >>> navigate to an enum
Done
Ben
09-29-2010 10:43 AM - edited 09-29-2010 10:44 AM
@alecjcook wrote:
how would you generate an array os strings from a Text Ring?
Try the documentation. For a text ring the Strings[] property returns the items as an array.
09-29-2010 10:43 AM
Create a property node for the text ring control. There is a property called Strings[] that you can read to give you the array of strings. Create an indicator wired to that and run your VI once. Now you have an array of strings indicator. Change that to a constant then use the right click tool on that to Create the enum.
09-29-2010 10:47 AM
create a property node for the ring object and select the property "StringsAndValues[]", this will get you an array with a cluster element with the data your after. you'll then have to use a for loop and extract the elements you need.
09-29-2010 12:15 PM
See the MacView blog entry:
How to Automate Creating Large Enums