LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

change returned value of enum

Hi,

 

I have an enum which i store a list of strings and then when the user changes the enum to a different item it returns a value but can the returned value be changed?

 

For example

Item name 	value
Item 0            0
item 1            1
item 2	          2
item 3	          3

 but what i would really like is this;

 

 

 

Item name	   value
Item 0	            0
item 1	            7
item 2	            8
item 3	           12

 Is there anyway of doing this without adding a number on after the value is returned?

 

Many thanks for your help.

 

James

   
   
   
   
   
   
   
   
   
   
0 Kudos
Message 1 of 7
(5,072 Views)

Hi James,

 

use a ring instead...

Enums are just "enumerated", they always count their items!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 2 of 7
(5,071 Views)

fantastic, i`ve been looking for this all day.

 

Thanks for your help.

0 Kudos
Message 3 of 7
(5,066 Views)

just found the strings and values property for the enum which does exactly what i need.

 

 

0 Kudos
Message 4 of 7
(5,058 Views)

Yes you can read those property but you will not beable to write. Enum won't allow you to do that but in ring you can do both.

-----

The best solution is the one you find it by yourself
0 Kudos
Message 5 of 7
(5,056 Views)

yep just found that out so the text ring will do exactly what i need. I have always wondered what the difference between them was.

 

thanks for you help.

0 Kudos
Message 6 of 7
(5,052 Views)

May be this would help you to understand the difference.

-----

The best solution is the one you find it by yourself
0 Kudos
Message 7 of 7
(5,046 Views)