LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Enum control

 

Hi  friends,

 

there is a BDL indicator. The enum control which include the DBL values is created. I want that the DBL value is  automatically  find in the enum control. What can I do?

 

have a nica work

0 Kudos
Message 1 of 6
(3,211 Views)

What is a BDL indicator? What is the relationship between the enum and the indicator? An enum is always integer and the item is a string.

 

I think you should attach a small example to illustrate what you are talking about. It is not clear at all.

 

Are the enum items formatted floating point numbers? Just get the array of strings using a property node and use the enum to index into the array, then convert to DBL.

0 Kudos
Message 2 of 6
(3,206 Views)

An enum can only be an integer datatype. What is the meaning of a fractional item in an unum?

 

Please explain what you are trying to do and show us what you have tried.

 

Lynn

0 Kudos
Message 3 of 6
(3,204 Views)

Here's what I had in mind:

 

 

(It is not entirely clear if that's what you actually want).

 

To "find" the enum value corresponding to the floating point value, format it with the same number of digits, then use "search array" on the strings array.

 

0 Kudos
Message 4 of 6
(3,200 Views)

@1085 wrote:

 

Hi  friends,

 

there is a BDL indicator. The enum control which include the DBL values is created. I want that the DBL value is  automatically  find in the enum control. What can I do?

 

have a nica work


Are you talking about the Label of the Enum control as "1.234"?

-----

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

As the last two responders noted, I'm assuming that you have created an Enum, gone into the Edit Items option, and assigned numeric values (such as 1.2, 2.4, 3.6) to the Enum.  You now want to read the Enum and get the "edited value" from it.  The easiest way to do that is to wire the Enum into a "Format into String" funnction (which will return the string representing the edited value, for example, the string "1.2") and then wire this string into the "Scan from String" function, wiring a Dbl into the Default terminal, which will convert the string "1.2" into the Dbl value 1.2.

 

BS

0 Kudos
Message 6 of 6
(3,113 Views)