FB_CTRL_TempController
The temperature controller function block FB_CTRL_TempController has various inputs and outputs, which are described below. All the controller's parameters are passed to it via structures. The structures and enums are defined here.
Function block
Interface
VAR_INPUT
eCtrlMode : E_CTRL_MODE; (* controller mode: passive, activ,check *)
bSelSetpoint : BOOL; (* FALSE = setpoint 1, TRUE = setpoint 2*)
fW1 : FLOAT; (* first setpoint *)
fW2 : FLOAT; (* second setpoint *)
fX : FLOAT; (* actual value *)
fYManual : FLOAT; (* manual control value *)
(* alarming inputs *)
bOpenThermocouple : BOOL; (* thermocouple *)
bReverseThermocouple : BOOL;
bBackVoltage : BOOL;
bLeakage : BOOL; (* heating system *)
bShortCircuit : BOOL;
bOpenCircuit : BOOL;
sParaControllerExternal : ST_CTRL_ParaController; (* external controller parameter set *)
END_VAR
VAR_IN_OUT
sControllerParameter : ST_CTRL_TempCtrlParameter; (* controller
parameter set *)
END_VAR
VAR_OUTPUT
(* control output *)
fYAnalog : FLOAT; (* control value analog *)
bYPWMPos : BOOL; (* control value PWM *)
bYPWMNeg : BOOL; (* control value PWM *)
bYDigPos : BOOL; (* 3-Point: control value digital positive*)
bYDigNeg : BOOL; (* 3-Point: control value digital negative*)
(* alarming *)
dwAlarm : DWORD; (* max. 32 alarms *)
(*quality of control*)
fMaxOverShoot : FLOAT;
tStartUpTime : TIME;
(* state *)
eCtrlState : E_CTRL_STATE := eCTRL_STATE_IDLE;
(* controller parameter *)
sParaControllerInternal : ST_CTRL_ParaController;
(* general errors *)
bError : BOOL;
eErrorId : E_CTRL_ErrorCodes;
END_VAR
Inputs
Name | Unit | Value range | Description |
---|---|---|---|
| 1 | E_CTRL_MODE | Mode switching. |
| 1 | [TRUE,FALSE] | Selects one of two possible setpoints. FALSE selects the normal setpoint, while TRUE selects the standby setpoint. |
| °C | LREAL | Setpoint. |
| °C | LREAL | Standby setpoint, generally smaller than fW1. fSelSetpoint can be used to switch between fW1 and fW2. |
| °C | LREAL | Actual value. This value must be converted to LREAL. |
| -100% - +100% | LREAL | Control value in manual operation. |
| 1 | [TRUE,FALSE] | The thermocouple is open if TRUE. Must be indicated by the hardware (e.g. KLxxxx). |
| 1 | [TRUE,FALSE] | TRUE indicates that the thermocouple has been connected with the wrong polarity. Must be indicated by the hardware. |
| 1 | [TRUE,FALSE] | TRUE indicates that the input voltage at the thermocouple is too high. Must be indicated by the hardware. |
| 1 | [TRUE,FALSE] | TRUE indicates that leakage current has been detected at the heating element. Must be indicated by the hardware. |
| 1 | [TRUE,FALSE] | TRUE indicates that a short circuit has been detected at the heating element. Must be indicated by the hardware. |
| 1 | [TRUE,FALSE] | TRUE indicates that an open circuit has been detected at the heating element. Must be indicated by the hardware. |
| none | Structure | General parameters (sampling time etc.) are passed to the function block in this structure. |
| none | Structure | An external controller parameter set is passed to the function block in this structure. |
Outputs
Name | Unit | Value range | Description |
---|---|---|---|
| none | LREAL | Analog control value. |
| none | [TRUE,FALSE] | Boolean output, pulse width modulated. Positive/heating mode |
| none | [TRUE,FALSE] | Boolean output, pulse width modulated. Negative/cooling mode |
| none | [TRUE,FALSE] | Boolean output of a three-step controller (TRUE control value 100%, FALSE control value off) |
| none | [TRUE,FALSE] | Boolean output of a three-step controller (TRUE control value -100%, FALSE control value off) |
| none | DWORD | Alarm messages (see ENUM ...) |
| °C | LREAL | max. overshoot in °C above/below setpoint. |
| TIME | - | Startup time until the setpoint is reached for the first time. |
| none | E_CTRL_STATE | Current controller state (see ENUM ...) |
| none | Structure | In this structure the internal controller parameter set (determined by the tuning) is made available. |
| none | [TRUE,FALSE] | If an error is present, then bError is TRUE. |
| none | INT | If bError is TRUE, then iErrorId provides an error code (see ENUM ...) |