06-12-2012 02:51 PM - edited 06-12-2012 02:53 PM
Hi,
I am sure my question will be easy to answer for experts, but I couldn´t find any examples:
I want to create a simple "Drop down Menu" where the user can select between 3 Power Levels:
Power Level 1 (enum value = 0)
Power Level 2 (enum value = 1)
Power Level 3 (enum value = 2)
How is it possible to assign to the enum value a "double". (The target is to set a specific value for each Power Level which I can connect with a DAQ-Assistant and finally with the Analog output)
So I just want the DAQ to output for Example
2,5 Volt if (enum value = 0)
5,0 Volt if (enum value = 1)
7,5 Volt if (enum value = 2)
Do I have to create an array, or has anyone an example how to programm that? Thanx for your replies!!!!
06-12-2012 03:02 PM
Why don't you just use a ring control set to be a dbl? Be sure to uncheck the 'Use sequential values'.
06-12-2012 03:05 PM - edited 06-12-2012 03:10 PM
Hi,
Enums can't be changed to doubles, they are their own data type.
My first blush would be to have a case structure that would give you the value you want ( double from inside the case) for a specific enum value ( 1,2,3 ....)
Than you can progmatically change the value returned by the case structure based on your code.
The enum would always fire that corresponding case, but the value returned from the case could be doubles, any value, etc....
Hope this helps.
06-12-2012 05:23 PM
I agree with Mark...
06-12-2012 05:25 PM
Seems silly to me to go to all that work with creating a case statement just to output a dbl.
06-12-2012 05:35 PM - edited 06-12-2012 05:37 PM
another way....better than assigning each case statement
06-12-2012 05:37 PM - edited 06-12-2012 05:44 PM
Sorry, that's just more Rube Golberg code.
06-12-2012 05:57 PM
just call me RG