LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to create multiple Enum constant without doing it manually one by one?


@billko wrote:

...


My favorite way of populating a huge enum - especially if I want to exactly match a document.


You got it!

 

Take the spreadsheet with the spec (compiled by your customer), edit same and save as tab-delimited... read it into an array and push to the ring... replace ... DONE!

 

Now if we could only create "Sparse Enums"...

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 11 of 30
(1,232 Views)

Oh if that is what OP wants I made a tool that can go in your Tools menu for making enums with paste support.

 

http://forums.ni.com/t5/LabVIEW/Creating-a-ENUM-from-EXCEL-Colum/td-p/3276235

Message 12 of 30
(1,225 Views)

@Ben wrote:

@billko wrote:

...


My favorite way of populating a huge enum - especially if I want to exactly match a document.


You got it!

 

Take the spreadsheet with the spec (compiled by your customer), edit same and save as tab-delimited... read it into an array and push to the ring... replace ... DONE!

 

Now if we could only create "Sparse Enums"...

 

Ben


Arrrrrgh!  I am having that issue RIGHT NOW...  😄

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 13 of 30
(1,203 Views)

For example, I want to create 1000 Enum constant(circled red based on the picture attached) but i don't want to manually create 1000 of them if that makes sense.Sorry if I didn't explained it well

0 Kudos
Message 14 of 30
(1,179 Views)

I know right?

 

0 Kudos
Message 15 of 30
(1,179 Views)

Oh really? I'm still quite new to this and confused about most things but thanks for correcting me:)

0 Kudos
Message 16 of 30
(1,179 Views)

I'll try doing that.

0 Kudos
Message 17 of 30
(1,179 Views)

Tips on creating messages in the forums.  It looks like you are replying to specific messages, but we can't tell which ones you are replying to.  You have 4 consecutive messages 4 minutes with short cryptic messages that have no linkage back to who you are replying to.

 

Be sure to use the quote button so it enters the original message you are replying to.

 

Or create just a single message combining all of your replies, and be sure to address the specific person you are replying to prior to each short response you write in that single message.

0 Kudos
Message 18 of 30
(1,161 Views)

@RavensFan wrote:

Tips on creating messages in the forums.  It looks like you are replying to specific messages, but we can't tell which ones you are replying to.  You have 4 consecutive messages 4 minutes with short cryptic messages that have no linkage back to who you are replying to.

 

Be sure to use the quote button so it enters the original message you are replying to.

 

Or create just a single message combining all of your replies, and be sure to address the specific person you are replying to prior to each short response you write in that single message.


Ahh I see. Thanks!

0 Kudos
Message 19 of 30
(1,150 Views)

@natasftw wrote:

Try explaining your task.  It doesn't make sense to create an enum in a loop.  You'd need to be doing some kind of scripting that wouldn't really be all that useful if you're new to LV.

 

If you want to just copy it, copy/paste works.

 

If you want them to be linked, take a look at typedefs.  I'd strongly suggest looking at this first.  Once you make the typedef, then copy/paste works much better


For example, I want to create 1000 Enum constant(circled red based on the picture attached) but i don't want to manually create 1000 of them as that will take up lots of space if that makes sense.Sorry if I didn't explained it well

0 Kudos
Message 20 of 30
(1,148 Views)