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.

LabVIEW Idea Exchange

cancel
Showing results for 
Search instead for 
Did you mean: 
Tobox

convert String-Array to Enum

Status: Declined
Functionality already exists in LabVIEW. Editing enums is possible only at edit time and not at run time.

I think that is usefull to convert a string-array as/into a enum.

After that you can use the enum easier in cases, and s.o.

8 Comments
Tobox
Member
or write/change the property nodes...
tst
Knight of NI Knight of NI
Knight of NI
I can't say I have a need for this, but it should be fairly simple to write a JKI RCF plugin to do this. You basically just need to create a new enum control and push the values into it using the Strings[] property.

___________________
Try to take over the world!
TCPlomp
Trusted Enthusiast

The Variant to Control toolbox has a demo VI which creates an enum based on an array of strings.

 

Ton

Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas

LabVIEW, programming like it should be!
JackDunaway
Trusted Enthusiast

We use a tool like this almost every day. But remember, by nature, that enum cannot be in memory, so this VI is only a design-time tool, not a run-time tool. 

 

 

UpdateEnum.png

Message Edited by JackDunaway on 11-19-2009 09:17 AM
Technico
Member

Initially I wanted to post a new idea, but this original post contained practically the same comments,

except that I have the proposal to add this option when editing rings/enums. So Kudos to this post...

 

The easiest way (without any additional tools, ...) would be if this option was built into LabVIEW itself

and the most logical place would be under enum/ring --> "Edit Items..." !!!

 

 

Why not add an additional option (Besides Insert/Delete/MoveUp/Down) to paste a string-array (or load an array from file)

 

 

Message Edited by Technico on 03-05-2010 04:23 AM
G-Money
NI Employee (retired)
Status changed to: Declined
Functionality already exists in LabVIEW. Editing enums is possible only at edit time and not at run time.
davekorpi
Member

Duuuuuuudes. and Dudettes!.. Use a Text ring by golly!

Too many snarky replies on the enum... Once day I will learn the enum and post it.

I personally wonder WHY ENUM Ring and WHY TEXT Ring, what's the diff??

 

How do you spell automobile?... Ummmm... CAR...

ToTestRing.png

AristosQueue (NI)
NI Employee (retired)

@davekorpi Enums are type-safe selectors whose value is visible on the diagram in case structures and probes. Rings are pure display objects that return a raw integer and support string localization. Enums protect you from cross-wiring and ensure that your code breaks if new cases are added. Rings are used for user interfaces where you may need to dynamically populate with text from various sources. In general, rings should be used exclusively for UI front panels and enums should be used exclusively for subVI connector panes.