FB_TempController
The temperature controller function block FB_TempController has a variety of inputs and outputs that are described below. All the controller's parameters are passed to it via structures. The definition of the structures and enums can be found here.
Note | |
This version of the function block is obsolete. You should no longer use this function block. |
Interface
VAR_INPUT
VAR_INPUT
bOn : BOOL;
bInit : BOOL;
bTune : BOOL;
bManual : BOOL;
bSelSetpoint : BOOL;
bSelCtrlParameterSe : BOOL;
bEnableSoftStart : BOOL;
bEnableRamping : BOOL;
fW1 : LREAL;
fW2 : LREAL;
fX : LREAL;
bOpenThermocouple : BOOL;
bReverseThermocouple : BOOL;
bBackVoltage : BOOL;
bLeakage : BOOL;
bShortCircuit : BOOL;
bOpenCircuit : BOOL;
sParaControllerExternal : ST_ParaController;
sLogData : ST_LogData := (bLog := FALSE, strLogFileName :='', strLogString := '' );
END_VAR
Name | Unit | Value range | Description |
---|---|---|---|
bOn | 1 | [TRUE,FALSE] | TRUE switches the controller on. |
bInit | 1 | [TRUE,FALSE] | Initialization flag, which must be active (TRUE) for precisely the first cycle in which the controller is called. |
bTune | 1 | [TRUE,FALSE] | A rising edge switches the self-tuning on. If it is switched to FALSE during the self-tuning process then the self-tuning is aborted and the controller continues operation using the old parameters (if they are still present). |
bManual | 1 | [TRUE,FALSE] | TRUE switches manual operation on. If the signal goes FALSE again, the controller returns to automatic mode. |
bSelSetpoint | 1 | [TRUE,FALSE] | Selects one of two possible setpoints. FALSE selects the normal setpoint, while TRUE selects the standby setpoint. |
bSelCtrlParameterSet | 1 | [TRUE,FALSE] | Selects one of two parameter sets. FALSE causes the internal (determined) parameter set to be used, while TRUE switches to one provided externally. |
bEnableSoftStart | 1 | [TRUE,FALSE] | The soft start-up process is used if TRUE. |
bEnableRamping | 1 | [TRUE,FALSE] | TRUE causes each setpoint step-change to be converted to a ramp. |
fW1 | °C | LREAL | Setpoint |
fW2 | °C | LREAL | Standby setpoint, generally smaller than fW1. fSelSetpoint can be used to switch between fW1 and fW2. |
fX | °C | LREAL | Actual value - this value must be converted to LREAL. |
bOpenThermocouple | 1 | [TRUE,FALSE] | The thermocouple is open if TRUE. Must be indicated by the hardware (e.g. KLxxxx). |
bReverseThermocouple | 1 | [TRUE,FALSE] | TRUE indicates that the thermocouple has been connected with the wrong polarity. Must be indicated by the hardware. |
bBackVoltage | 1 | [TRUE,FALSE] | TRUE indicates that the input voltage at the thermocouple is too high. Must be indicated by the hardware. |
bLeakage | 1 | [TRUE,FALSE] | TRUE indicates that leakage current has been detected at the heating element. Must be indicated by the hardware. |
bShortCircuit | 1 | [TRUE,FALSE] | TRUE indicates that a short circuit has been detected at the heating element. Must be indicated by the hardware. |
bOpenCircuit | 1 | [TRUE,FALSE] | TRUE indicates that an open circuit has been detected at the heating element. Must be indicated by the hardware. |
sControllerParameter | none | Structure | General parameters (sampling time etc.) are passed to the function block in this structure. |
sParaControllerExternal | none | Structure | An external controller parameter set is passed to the function block in this structure. |
sLogData | none | Structure | This structure passes parameters for logging to the function block (filenames etc.). |
VAR_OUTPUT
VAR_OUTPUT
fYAnalog : LREAL;
bYPWM : BOOL;
bYDig : BOOL;
bYDigPos : BOOL;
bYDigNeg : BOOL;
dwAlarm : DWORD;
iState : States := TC_STATE_IDLE;
sParaControllerInternal : ST_ParaController;
bError : BOOL;
iErrorId : ErrorCodes;
END_VAR
Name | Unit | Value range | Description |
---|---|---|---|
fYAnalog | none | LREAL | Analog control value |
bYPWM | none | [TRUE,FALSE] | Boolean output, pulse width modulated |
bYDig | none | [TRUE,FALSE] | Boolean output of an on-off controller (TRUE control value 100%, FALSE control value off) |
bYDigPos | none | [TRUE,FALSE] | Boolean output of a three-step controller (TRUE control value 100%, FALSE control value off) |
bYDigNeg | none | [TRUE,FALSE] | Boolean output of a three-step controller (TRUE control value -100%, FALSE control value off) |
dwAlarm | none | DWORD | Alarm messages (see ENUM ...) |
iState | none | INT | Current controller status (see ENUM ...) |
sParaControllerInternal | none | Structure | In this structure the internal controller parameter set (determined by the tuning) is made available. |
bError | none | [TRUE,FALSE] | If an error is present, then bError is TRUE. |
iErrorId | none | INT | If bError is TRUE, then iErrorId provides an error code (see ENUM ...). |
VAR_IN_OUT
VAR_IN_OUT
sControllerParameter : ST_ControllerParameter;
END_VAR
Name | Type | Description |
---|---|---|
sController | ST_ControllerParameter | Parameter structure of the function block |
Requirements
Development environment | Target platform | PLC libraries to include |
---|---|---|
TwinCAT 3.1.4016 | PC or CX | Tc2_TempController |