FB_ProportionalGain (Function Block)

Applies a proportional gain to the input error signal.

The output is computed as:

\[y = K_p \cdot e\]

where \(K_p\) is Kp and \(e\) is the error signal set via Input.

Note

The block is FINAL and must be instantiated, not extended. Use FB_init to set fKp at declaration time.

Extends: FB_SisoComponent

Properties

Kp

Type: LREAL

Gets or sets the proportional gain.

A higher value produces a stronger response to error but may cause overshoot. A lower value produces a more gradual response. A value of 0 disables the proportional term entirely.

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)

fKp

LREAL

Proportional gain.

Reset

Sets the output to zero. Takes effect until the next Run() call.

Run

Computes the proportional output for the current cycle.

Note

Must be called once per cycle on a single PLC task.