LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Enum properties- Am I confussed?

Solved!
Go to solution

I ran across This thread and was surprised.   I expected that setting the "Allow undefined values at run time" checkbox on the control Properties>Edit Items page would affect the control properties Response to values outside limits>All.elements.

 

Can someone straighten me out on how these properties should interact?  It seams somewhat insane to not allow undefined values and ignore values outside limits

rings.png


"Should be" isn't "Is" -Jay
0 Kudos
Message 1 of 5
(3,320 Views)

First, your code shows a ring and not an enum (which makes sense, since an enum can't have undefined values).

 

Second, I'm not in front of LabVIEW, but I'm assuming the property you're looking at actually comes from the Numeric class (as opposed to the Named Numeric class, which is a child Numeric) and would therefore be shared by all numerics. This leads me to assume that the property corresponds to what you see if right click a numeric control, open its properties dialog and look in the second (if memory serves) page.


___________________
Try to take over the world!
0 Kudos
Message 2 of 5
(3,287 Views)

tst wrote:

First, your code shows a ring and not an enum (which makes sense, since an enum can't have undefined values).

 

Second, I'm not in front of LabVIEW, but I'm assuming the property you're looking at actually comes from the Numeric class (as opposed to the Named Numeric class, which is a child Numeric) and would therefore be shared by all numerics. This leads me to assume that the property corresponds to what you see if right click a numeric control, open its properties dialog and look in the second (if memory serves) page.


Thanks- and you are right I showed rings because they allow manipulation of the "response to values outside limits" properties.  However, if you replace the controls with an enum you can see and set these properties in a property node.  HOWEVER, setting the properties to ignore seems to have no effect (as the value is coerced prior to passing it to the control???).

 

Again- I'm just a bit confused as to what these properties really effect and if they even have an effect on an enum.   Moreover, since I ran across the question in a TestStand context and TestStand treats Enums as Numerics-  What, if any, odd behaviors might we see as a result?


"Should be" isn't "Is" -Jay
0 Kudos
Message 3 of 5
(3,279 Views)
Solution
Accepted by topic author JÞB

I don't know what the interaction with TS will do, but enums have the numeric values as part of the data type - they CAN'T have values outside the range. If you wire a value which is outside the range into an enum it will always coerce it into one of the allowed values.

 

In any case, you should note that for all numerics, the limits set like this (either using a property or using the properties dialog) only affect the UI. If you wire a value into such a control these limits are ignored.


___________________
Try to take over the world!
0 Kudos
Message 4 of 5
(3,261 Views)
Ah-ha!

"Should be" isn't "Is" -Jay
0 Kudos
Message 5 of 5
(3,252 Views)