Learn PLCs free
Process ControlBeginnerIEC 61131-3

LIMIT (Limiter / Clamp)

Clamps a value between minimum and maximum boundaries.

The LIMIT (Limiter/Clamp) function block restricts an input value to stay within defined minimum and maximum boundaries. If the input exceeds the maximum, the output is clamped to the maximum. If the input falls below the minimum, the output is clamped to the minimum. Otherwise, the output equals the input. LIMIT is a critical safety function used to prevent actuators from exceeding safe operating ranges, clamping PID outputs, protecting analog outputs, and ensuring setpoints stay within valid ranges.

Parameters

Inputs

NameTypeDescription
MNANY_NUMMinimum allowed value
INANY_NUMInput value to clamp
MXANY_NUMMaximum allowed value

Outputs

NameTypeDescription
OUTANY_NUMClamped output: MN <= OUT <= MX

Ladder Logic Example

// Ladder Logic - LIMIT (PID Output Clamping)
//
// |----[LIMIT]----|
// | MN: 0.0        (minimum output)    |
// | IN: PID_Out    (raw PID output)    |
// | MX: 100.0      (maximum output)    |
// | OUT: Safe_Out  (clamped 0-100%)    |

Structured Text Example

// Clamp PID output to 0-100%
Safe_Output := LIMIT(MN := 0.0, IN := PID_Output, MX := 100.0);

// Or manually:
IF PID_Output > 100.0 THEN
    Safe_Output := 100.0;
ELSIF PID_Output < 0.0 THEN
    Safe_Output := 0.0;
ELSE
    Safe_Output := PID_Output;
END_IF;

20 Production-Ready Ladder Logic Templates

Stop writing the same rungs from scratch. Get copy-paste-ready templates for motor control, PID loops, safety interlocks, conveyors, and more.

Platform-Specific Implementation

S

Siemens (TIA Portal)

Use LIMIT instruction in TIA Portal. Also available in SCL.

AB

Allen-Bradley (Studio 5000)

No direct LIMIT; implement with GRT/LES comparisons and MOV instructions.

C

CODESYS

Use LIMIT() function in ST. Part of standard IEC 61131-3 library.

Common Applications

  • PID output clamping
  • Analog output protection
  • Setpoint range validation
  • Motor speed limiting
  • Valve position limits

Frequently Asked Questions

What is LIMIT (Limiter / Clamp) in PLC programming?

Clamps a value between minimum and maximum boundaries. The LIMIT (Limiter/Clamp) function block restricts an input value to stay within defined minimum and maximum boundaries. If the input exceeds the maximum, the output is clamped to the maximum.

What are common applications of LIMIT (Limiter / Clamp)?

LIMIT (Limiter / Clamp) is commonly used for: PID output clamping, Analog output protection, Setpoint range validation, Motor speed limiting, Valve position limits.

How do I use LIMIT (Limiter / Clamp) in different PLC platforms?

Siemens: Use LIMIT instruction in TIA Portal. Also available in SCL. Allen-Bradley: No direct LIMIT; implement with GRT/LES comparisons and MOV instructions. CODESYS: Use LIMIT() function in ST. Part of standard IEC 61131-3 library.

Stop Writing Ladder Logic From Scratch

Get 20 production-ready ladder logic templates for $29 -- download instantly and use them on your next project today.

20
Ready-Made Templates
LD + ST
Both Languages Included
$29
One-Time Purchase
Get Instant Access -- $29

Instant download - 30-day money-back guarantee - Use on unlimited projects

Free PLC simulator

Wire this block up and run it

Drop the instruction into a rung, hit Run, and watch it execute in your browser. 12 guided lessons across 8 PLC dialects — free account, no credit card.

Practice PLCs free →