LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Dynamically set the upper limit of a numerical control

I want to dynamically setting the upper limit of a numerical control. The maximal value that is allowed to input is calculated by the code, so that if the value input by the user exceeds the upperlimit,  a warning comes out and the input value is automaticaly reset to zero.

I wired the calculated upper-limit to the property node of the numerical control using ''Data Range > Maximum" property, but it does not work as I expected.

Anyone has suggestion on this? Thanks a lot.
0 Kudos
Message 1 of 4
(3,199 Views)
Can you attach your code?


@Dejun wrote:
... but it does not work as I expected.

I cannot read your mind. What do you expect? What to you see instead? 🙂
 
Overall, you are in a catch22 scenario if I understand you right. If you set the max of the control to coerce to a certain value and you enter a larger value, it will be coerced to the upper limit and the code does not see the original out-of-range value and you cannot successfully test it with a comparison operation. Maybe you can set it to "ignore" instead of "coerce" or not even set an upper limit. Simply use "in range and coerce" and reset the value under the desired conditions (e.g. via  a local variable) before handing it to the rest of the code. You could even wrap this into an xcontrol.
 

 
Message 2 of 4
(3,190 Views)
You could always use the In Range and Coerce function to do your limit checking and use the function's boolean output to trigger the error message.

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
Message 3 of 4
(3,176 Views)
I finally easily realized my purpose using a case structure instead of property node.

Anyway, thank you all very much for your helps.

Sincerely,
Dejun

Message Edited by Dejun on 08-27-2007 12:04 AM

0 Kudos
Message 4 of 4
(3,167 Views)