FB_ClampingIntegrator (Function Block)

Integrates the input error signal with comparator-based anti-windup.

Extends FB_Integrator by suppressing integration when the ComparatorInput indicates saturation and the input would push further into saturation. The suppression behaviour is controlled by Mode.

ComparatorInput is typically the Residual of an FB_Clamp block placed after the PID summation.

Note

Set Maximum before Minimum to ensure the clamp guard applies correctly.

Use FB_init to set tTn and eMode at declaration time.

Extends: FB_Integrator

Properties

AntiWindupActive

Type: BOOL

Gets whether the output is currently saturated and integration is halted.

ComparatorInput

Type: LREAL

Gets or sets the comparator input.

This is typically the Residual of an FB_Clamp block placed after the PID summation. A positive value indicates the unsaturated sum exceeded the clamp maximum; a negative value indicates it fell below the clamp minimum. When this value and Input have the same sign, integration is suppressed according to Mode.

Mode

Type: E_AntiWindupMode

Gets or sets the anti-windup mode.

Controls the integrator behaviour when saturation is detected via ComparatorInput. See E_AntiWindupMode for available modes.

Methods

FB_init

Inputs

Name

Type

Description

bInitRetains

BOOL

if TRUE, the retain variables are initialized (warm start / cold start)

bInCopyCode

BOOL

if TRUE, the instance afterwards gets moved into the copy code (online change)

tTn

LTIME

Integral action time. LTIME#0 disables integration.

eMode

E_AntiWindupMode

The integrator behaviour during saturation.

Reset

Clears the integrator state, output, and anti-windup flag.

Run

Advances the clamping integrator by one time step.

Note

Must be called once per cycle on a single PLC task. If Tn is LTIME#0 the output is set to zero and anti-windup is cleared.