You can limit intermediate values of numeric controls or indicators to certain increments. For example, you might limit 16-bit integers to increments of 10 or single-precision, floating-point numbers to increments of 0.25. If you change either the limits or the increment, you also should decide what to do if the user attempts to set a value outside the range or off the increment. You also can use the In Range and Coerce function to determine if a value falls outside of a range and coerce the value to fall within the range.
Complete the following steps to designate other limits within the natural minimum and maximum data range limits.
Note Use the fields described below to set how to handle the numeric value the user enters if that value is outside of the specified numeric range. Changing these fields does not affect values that are set programmatically, including the values of indicators. |
Response to value outside limits | Description |
---|---|
Ignore | LabVIEW does not change or flag invalid values. Clicking the increment and decrement buttons changes the value by the increment you set, but the value does not go beyond the minimum or maximum values. |
Coerce to nearest | LabVIEW increments to the nearest value. For example, if the minimum is 3, the maximum is 10, and the increment is 2, valid values are 3, 5, 7, 9, and 10. LabVIEW coerces the value 0 to 3, the value 6 to 7, and the value 100 to 10. |
Coerce up | LabVIEW increments the value by one increment value. |
Coerce down | LabVIEW decrements the value by one increment value. |
You also can use the Numeric properties or AbsTime properties to set the data range and response to values outside limits programmatically.