Skip to content
For the complete documentation index, see llms.txt. This page is also available as Markdown.

Control2P

Control2P (FB)

FUNCTION_BLOCK Control2P

Short description

Two-point controller with actual value / setpoint / enable and adjustable switching hysteresis The control action (inverted / direct) can also be adjusted.

Representation

Interfaces

Inputs

Name
Data type
Value range
Initial value
Function

rX

REAL

Analog actual value

rW

REAL

Analog setpoint value

xEn

BOOL

* FALSE: Controller locked * TRUE: Controller enabled

Outputs

Name
Data type
Value range
Initial value
Function

xY

BOOL

Digital output signal

rDiff

REAL

Control deviation (rX - rW)

rOnAt

REAL

Absolute switch-on point (rW + rSwitchOnPoint)

rOffAt

REAL

Absolute switch-off point (rW + rSwitchOffPoint)

Setpoints / Parameters

Name
Data type
Value range
Initial value
Function

rSwitchOffPoint

REAL

0.5

Switch-off point relative to the setpoint rW

rSwitchOnPoint

REAL

-0.5

Switch-on point relative to the setpoint rW

xOffCondition

BOOL

FALSE

State of the output xY at xEn = 0

xInitValue

BOOL

FALSE

State of the output xY after a restart

eAction

eControlMode

eControlMode.Inverted

Direction of action of the controller (Inverted = heating, Direct = cooling)

eManModeB

eManBin

eManBin.Auto

Operating mode for the digital output signal xY

Functional description

Enable input xEn

xEn

Control process

xY

rDiff

rOnAt

rOffAt

Notes

TRUE

TRUE

X

X

x

x

Control enable

FALSE

FALSE

xOffCondition (if eManModeB = eManBin.Auto)

X

x

x

Control lockout

Legend: X = any

Digital output xY

The digital output xY is influenced by the enable input xEn, the control process and the manual override module.

Control process

xEn

eManModeB

xY

Notes

FALSE

TRUE

eManBin.Auto

FALSE

Automatic mode - Control process = FALSE

TRUE

TRUE

eManBin.Auto

TRUE

Automatic mode - Control process = TRUE

X

FALSE

eManBin.Auto

xOffCondition

Automatic mode without enable

X

X

eManBin.ManOff

FALSE

Manual mode - Off

X

X

eManBin.ManOn

TRUE

Manual mode - On

Legend: X = any

Control process

The controller can be operated in two different operating modes (eAction = eControlMode.Inverted or eAction = eControlMode.Direct). The following rules apply:

eAction

Rule

eControlMode.Inverted

rSwitchOnPoint < rSwitchOffPoint

eControlMode.Direct

rSwitchOnPoint > rSwitchOffPoint

If, in operating mode eControlMode.Inverted, the rSwitchOffPoint the rSwitchOnPoint, then the rSwitchOffPoint compared to the rSwitchOnPoint is increased by 0.1. If, in operating mode eControlMode.Inverted, the rSwitchOnPoint the rSwitchOffPoint, then the rSwitchOffPoint compared to the rSwitchOnPoint is reduced by 0.1. The output values rDiff (rX - rW), absolute switch-on point rOnAt (rW + rSwitchOnPoint) and absolute switch-off point rOffAt (rW + rSwitchOffPoint) are available independently of the enable input xEn at all times.

xEn

eAction

rDiff

xY

Notes

TRUE

eControlMode.Inverted

< rSwitchOnPoint

TRUE

Automatic mode - Inverted On

TRUE

eControlMode.Inverted

> rSwitchOffPoint

FALSE

Automatic mode - Inverted Off

TRUE

eControlMode.Direct

> rSwitchOnPoint

TRUE

Automatic mode - Direct On

TRUE

eControlMode.Direct

< rSwitchOffPoint

FALSE

Automatic mode - Direct Off

Legend: X = arbitrary In summary, the control process can alternatively be described as follows:

xEn

eAction

rX

xY

Notes

TRUE

eControlMode.Inverted

< rOnAt

TRUE

Automatic mode - Inverted On

TRUE

eControlMode.Inverted

> rOffAt

FALSE

Automatic mode - Inverted Off

TRUE

eControlMode.Direct

> rOnAt

TRUE

Automatic mode - Direct On

TRUE

eControlMode.Direct

< rOffAt

FALSE

Automatic mode - Direct Off

Legend: X = any

CODESYS

InOut:

Scope
Name
Type
Initial

Input

rX

REAL

Input

rW

REAL

Input

xEn

BOOL

Input Const

rSwitchOffPoint

REAL

0.5

Input Const

rSwitchOnPoint

REAL

-0.5

Input Const

xOffCondition

BOOL

FALSE

Input Const

xInitValue

BOOL

FALSE

Input Const

eAction

eControlMode

eControlMode.Inverted

Input Const

eManModeB

eManBin

eManBin.Auto

Output

xY

BOOL

Output

rDiff

REAL

Output

rOnAt

REAL

Output

rOffAt

REAL

Last updated