LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Property node for coerced value of numeric control?

Hi

 

I was wondering if there is such a property node for numeric controls, that has a boolean value for when the value was coerced, similar to the In range and coerce function, which has In range? boolean value.

I couldn't find it myself.

0 Kudos
Message 1 of 6
(446 Views)

Hi AeroSoul,

 

While you can read the coercion behavior and limits:

 

raphschru_0-1705929383327.png

 

 As far as I know, there is no way to know if a previously entered value was coerced. Once it is coerced, the original value typed by the user is lost forever.

 

Regards,

Raphaël.

0 Kudos
Message 2 of 6
(424 Views)

I believe the coercion settings for controls are primarily intended for user input. Maybe even entirely intended for that... I've never actually tested whether they work with programmatically set values or ones passed in via the connector pane.

 

This is just to stop users from inputting values that are not allowed, and since the control immediately changes based on the settings the user gets immediate feedback on this and the "bad" value is never passed downstream. Is that the sort of situation your are trying to monitor?

 

If you are trying to use this on controls used as inputs on the connector pane then I'd suggest programmatically handling out of range values is probably a better approach.

0 Kudos
Message 3 of 6
(383 Views)

Hi Jim,

 


@JimB. wrote:

I believe the coercion settings for controls are primarily intended for user input. Maybe even entirely intended for that... I've never actually tested whether they work with programmatically set values or ones passed in via the connector pane.


In times long ago (LabVIEW4 to LabVIEW6?) the input coercion also was applied to values coming from wires to connector pane inputs of a subVI. But that is long ago…

Since then input coercion is ONLY applied to user input!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 6
(375 Views)

My case is user can set temperature and then save the setting. If the temperature is not in range it is coerced to range and then a warning to the user is displayed (pop-up).

I've used the In range and coerce for this, i just thought there might be better ways.

0 Kudos
Message 5 of 6
(307 Views)

Hi AeroSoul,

 


@AeroSoul wrote:

My case is user can set temperature and then save the setting. If the temperature is not in range it is coerced to range and then a warning to the user is displayed (pop-up).

I've used the In range and coerce for this, i just thought there might be better ways.


I don't think there is a better way.

You have 3 input values (user input, high limit, low limit) and you want to create certain program behaviour based on these 3 inputs: InRangeAndCoerce is a very simple way to achieve that…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 6 of 6
(299 Views)