enum with arbitrary values 
Author Message
 enum with arbitrary values

Is it possible to define an enum with arbitrary values as in the following C line :

enum { MINE = 5, YOURS = 12 }


Fri, 16 Jul 2004 18:05:02 GMT  
 enum with arbitrary values
Hi Olivier,

The answer is No, unless labview 6.1 has added this.

Ray Farmer

Fri, 16 Jul 2004 19:05:38 GMT  
 enum with arbitrary values
Hi OZ,

No, it is not possible in LabVIEW 6.0.2 or lower.
I have read that it can be done in CVI and then exported to LabVIEW.
If I had to guess I would probably say it was Jeane-Pierre Droilet
(?sp), or Dr. Scott Hanna (?sp), or Rolf Kalbermatter (?sp) who posted
a method for accomplishing this task.

If you are interested in finding out how this was done I suggest you
use Brian Renken's Search engine at
to find the posting (it was posted in 2000 or 2001 I think). I believe
they are called "sparse enum's".

If you want to accomplish a similar functionality with pure "G" you
could use a translator type sub-VI. The translator would use the use
the enum value to index an array of constants that has the
"Sparse-enum"s you want returned. An advantage of this method can be
realized if the translator is implemented as an action engine where
the "indexed-array" is read from an un-initialized shift register.
This would allow redifining the enums "on-the-fly.

I hope this helps,


Sat, 17 Jul 2004 21:09:55 GMT  
 enum with arbitrary values

Check Drolet's <a
Bestiary</a>. He created a very useful utility that allows you to
create a G enum from a C enum statement.


Sat, 17 Jul 2004 21:53:51 GMT  
 enum with arbitrary values
Just wanted to add that there is an easy workaround; just use a normal
ring control to index an array of your arbitrary values.  This may be
less trouble than importing from CVI or C code.

Sun, 18 Jul 2004 00:24:05 GMT  
 [ 5 post ] 

 Relevant Pages 

1. enum to throw isn't arbitrary?

2. HELP: renames and enum values

3. Compiling arbitrary values to code space in ANS

4. Compiling arbitrary values to code space in ANS

5. Reading a arbitrary number of values

6. The Enum is Dead. Long Live the Enum.

7. APL+Win, ActiveX and Enum

8. C enum in smalltalk

9. Beginner's 'enum' question

10. Retrieve the selected text from an ENUM, text ring or other control

11. String Enum or Ring with not autmatic numbers !

12. Enum with Call Library/Activex


Powered by phpBB® Forum Software