====== On/Off controller - cooling ====== {{:en:mervis-ide:35-help:b30.png}} ===== Block name ===== B30_ON_OFF_CONTROL_SEQUENCE ===== ST call ===== PROGRAM B30_TEST VAR IN1, IN2:REAL; O1: BOOL; FB: LIB.CORE.V1_1.B30_ON_OFF_CONTROL_SEQUENCE; END_VAR FB(X:=IN1, W:= IN2); O1:= FB.OUT; END_PROGRAM ===== Library ===== LIB\CORE ===== Version ===== V1.1 ===== Description ===== The block is an On/Off controller, parametrable according to CONTROLLERTYPE, bandwidth Xp, and offset OFF. {{:en:mervis-ide:35-help:b30_1.png}} ===== Inputs ===== |Input |Type |Description |Default value| |ENABLED |BOOL |Enable of operation |True | |X |REAL |Controlled value (e.g. temperature).|0 | |W |REAL |Setpoint value (e.g. temperature). |22 | |CONTROLLERTYPE|[[en:mervis-ide:35-help:035-software_basic:060-libraries:015-proto|CONTROLLERTYPE]]|Controller type (Heating, Cooling). |cooling | |XP |REAL |Hysteresis |1 | |OFF |REAL |Offset, added to the setpoint W. |0 | ===== Outputs ===== |Output|Type|Description | |OUT |BOOL|Output signal (usually heating element, chiller etc.).| The output variable "OUT" has a flag since function block version 1.1 RETAIN to keep the last state when the PLC is restarted. ===== Function ===== The block is an implementation of a 2-state controller, or On/Off controller, where X is the controlled value, and W+OFF is the setpoint (the OFF parameter is an offset). It works as follows: Supposing temperature X is too high, then OUT=TRUE and cooling (if CONTROLLERTYPE=COOLING) is activated. As soon as the measured temperature X drops below W+OFF, the block sets OUT=FALSE and cooling goes off, which results in the temperature X rising. When temperature rises above X=W+OFF+XP, then OUT=TRUE, and cooling is activated again. Temperature drops and the whole process repeats. The offset OFF is used to compensate the W parameter. There are 3 ways to set the offset, see below. Off = 0: Cooling controller. Off = -Xp : Maximum level controller. The ENABLED parameter may switch the controller off. When ENABLED=FALSE, then the controller is off and OUT=FALSE. Note:\\ When X= W+OFF then OUT=FALSE. When X = W+OFF+XP then OUT is not defined (it depends if it is reached from left or right). {{:en:mervis-ide:35-help:b30_2.png}} ===== Application example ===== {{:en:mervis-ide:35-help:b30_example.png}}