LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do i create a enum with data type as double

I am attaching a control (which i think is a enum but i am not sure). I would like to know how to create one like that. It sends out double values equal to the ones chosen in the from the pull down list.
0 Kudos
Message 1 of 10
(5,589 Views)
I don't think you are able to do this - the enumerated type control data type is unsigned byte, unsigned word, or unsigned long. You should be able to use the integer values of a standard enum control to drive a case structure or index an array to select the values that will correspond to the enum list.
0 Kudos
Message 2 of 10
(5,589 Views)
You can't - at least not with the current version of LabVIEW. What you can do is use the value from the enum to index an array of DBLs.
0 Kudos
Message 3 of 10
(5,589 Views)
Someone did it, though. Look at the example. I thought I knew what that was, but I don't. I can think of about 3 ways to fake the control that the original poster has, but it doesn't seem to be any of the above.
0 Kudos
Message 4 of 10
(5,589 Views)
It's probably a standard text ring control with the data representation changed to DBL - the ring index value still increments in whole numbers.
0 Kudos
Message 5 of 10
(5,589 Views)
At first I thought it was a text ring. What's missing is the right click dialog of Add Item After and Add Item Before that I would expect if it was a text ring or an enum. No matter what, the value doesn't change no matter which item is selected.
0 Kudos
Message 6 of 10
(5,589 Views)
I took another look at this, I admit I don't know how this was done - if you change the format and precision to say, SI notation the value does track the listed value. The context help indicates it is from an HP instrument driver.
0 Kudos
Message 7 of 10
(5,589 Views)
See Greg M.'s comments here.


LabVIEW, C'est LabVIEW

0 Kudos
Message 8 of 10
(5,589 Views)
Yes it is from an HP Instrument Driver (HP816x). But i wanted to know how to create one like that. But i havent still figured out how to create that control.
0 Kudos
Message 9 of 10
(5,589 Views)
JPD, thanks for pointing that out. That CTL was driving me up the wall -- it's good to have my suspicion confirmed that it's an example of an unreleased/unofficial LV object.
0 Kudos
Message 10 of 10
(5,589 Views)