Control2P (FB)

FUNCTION_BLOCK Control2P

Short Descritpion

2-point controller with actual value / set point / enable and configurable switching hysteresis
The direction of the action (inverted / direct) is also adjustable.

Portrayal

../_images/Control2P_FB.png

Interfaces

Inputs

Name

Datatype

Range

Init-Value

Function

rX REAL    

Analog actual value

rW REAL    

Analog setpoint

xEn BOOL    
FALSE:

Disable controller

TRUE:

Enable Controller

Outputs

Name

Datatype

Range

Init-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

Datatype

Range

Init-Value

Function

rSwitchOffPoint REAL   0.5

Switch-off point relative to setpoint rW

rSwitchOnPoint REAL   -0.5

Switch-on point relative to setpoint rW

xOffCondition BOOL   FALSE

Status of output xY at xEn = 0

xInitValue BOOL   FALSE

Status of 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

Enabling Input xEn

xEn

Controlling process

xY rDiff rOnAt rOffAt

Notes

TRUE TRUE X X x x

Enabling the control

FALSE FALSE xOffCondition ( falls eManModeB = eManBin.Auto ) X x x

Disabling the control

Legend: X = any

Digital output xY

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

Controlling process

xEn eManModeB xY

Notes

FALSE TRUE eManBin.Auto FALSE

Automatic operation - controlling process = FALSE

TRUE TRUE eManBin.Auto TRUE

Automatic operation - controlling process = TRUE

X FALSE eManBin.Auto xOffCondition

Automatic operation without enabling

X X eManBin.ManOff FALSE

Manual operation - Off

X X eManBin.ManOn TRUE

Manual operation - On

Legend: X = any

Controlling process

The controller can be operated in two different operating modes (eAction = eContollerOp.Invertiert or eAction = eControllerOp.
The following rules apply:
eAction

Rule

eControlMode.Inverted rSwitchOnPoint < rSwitchOffPoint
eControlMode.Direct rSwitchOnPoint > rSwitchOffPoint
If in the eControlMode.Inverted operating mode, the rSwitchOffPoint falls below the rSwitchOnPoint, the rSwitchOffPoint is raised with respect to
rSwitchOnPoint by 0.1.
If in the ControlMode.Inverted operating mode,the rSwitchOnPoint falls below the rSwitchOffPoint, the rSwitchOffPoint is reduced with respect to the
** rSwitchOnPoint** by 0.1.

The rDiff (rX - rW) output variables , rOnAt (rW + rSwitchOnPoint) absolute switch-on point and rOffAt (rW* + rSwitchOffPoint) absolute switch-off point
are always available irrespective of the xEn enable input.
xEn eAction rDiff xY

Notes

TRUE eControlMode.Inverted < rSwitchOnPoint TRUE

Automatic operation - inverted on

TRUE eControlMode.Inverted > rSwitchOffPoint FALSE

Automatic operation - inverted off

TRUE eControlMode.Direct > rSwitchOnPoint TRUE

Automatic operation - direct on

TRUE eControlMode.Direct < rSwitchOffPoint FALSE

Automatic operation - direct off

Legend: X = any
In summary, the control process can be described as follows:
xEn eAction rX xY

Notes

TRUE eControlMode.Inverted < rOnAt TRUE

Automatic operation - inverted on

TRUE eControlMode.Inverted > rOffAt FALSE

Automatic operation - inverted off

TRUE eControlMode.Direct > rOnAt TRUE

Automatic operation - direct on

TRUE eControlMode.Direct < rOffAt FALSE

Automatic operation - direct off

Legend: X = any

Visualization




Information

Element

Authors

Date

Version

Notes

Function

Adam Bartod 04.2016 1.0

Initial version

Programming

Adam Bartod 04.2016 1.0

Initial version

Test Jochen Reu 02.2017 1.0

Initial version

Documentation

Jochen Reu 10.2017 1.0

Initial version

Codesys

InOut:
Scope Name Type Initial Comment
Input rX REAL  

Analog actual value

rW REAL  

Analog setpoint

xEn BOOL  

Enable the Controller

rSwitchOffPoint REAL 0.5

Switch-off point relative to setpoint rW

rSwitchOnPoint REAL -0.5

Switch-on point relative to setpoint rW

xOffCondition BOOL FALSE

Status of output xY at xEn = 0

xInitValue BOOL FALSE

Status of 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

Output xY BOOL  

Binary control signal for control

rDiff REAL  

Control deviation Xw

rOnAt REAL  

Switch-on point at

rOffAt REAL  

Switch-off point at