Clamp
easy
Constrain a numeric input between 0 and 100.
What it teaches
Force a value to stay between 0 and 100. Anything above 100 gets pinned to 100; anything below 0 gets pinned to 0; inside the range, the value passes through unchanged. The everyday guardrail pattern for sensor readings and setpoints.
Inputs and outputs
| Tag | Type | Default | Description |
|---|---|---|---|
| In_Value | REAL | — | Input value to be clamped |
| Out_Value | REAL | — | Clamped output value |
Required behavior
- Out_Value is 100.0 when In_Value is greater than 100.0.
- Out_Value is 0.0 when In_Value is less than 0.0.
- Out_Value equals In_Value when In_Value is between 0.0 and 100.0 inclusive.