05-19-2016 01:52 PM - edited 05-19-2016 01:55 PM
Im new to labview and I am trying to read out the index of an enum oppose to the string value the enum has.
i.e. for example an enum of values 1, 5, 10, 20 with indexs 0,1,2,3 I want to take the index value to use in a code as a string,
so take the 0,1,2,3 values
Are there any simple solutions?
Cheers,
JimJamBot
Solved! Go to Solution.
05-19-2016 02:02 PM
It is already a number.
Try using a "to I32" or similar from the numeric palette.
Ben
05-19-2016 02:05 PM
That worked, Thank you!
JimJamBot
05-19-2016 02:48 PM
Enums also have amazing feature when converting them to string:
If you wire it into Format into string and specify %d as formatting, it will be numeric string (0, 1, 2...). If you specify %s, it will be string you see on block diagram (1, 5, 10, 20) in your case
05-19-2016 04:19 PM
That's cool, I think that just made a load of my code alot simpler,
thank you,
JimJamBot