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

FB_CTRL_TempController 1:

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

eControlMode

1

E_CTRL_MODE

Mode switching.

bSelSetpoint

1

[TRUE,FALSE]

Selects one of two possible setpoints. FALSE selects the normal setpoint, while TRUE selects the standby setpoint.

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.

fYManual

-100% - +100%

LREAL

Control value in manual operation.

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.

Outputs

Name

Unit

Value range

Description

fYAnalog

none

LREAL

Analog control value.

bYPWMPos

none

[TRUE,FALSE]

Boolean output, pulse width modulated. Positive/heating mode

bYPWMNeg

none

[TRUE,FALSE]

Boolean output, pulse width modulated. Negative/cooling mode

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 ...)

fMaxOverShoot

°C

LREAL

max. overshoot in °C above/below setpoint.

tStartUpTime

TIME

-

Startup time until the setpoint is reached for the first time.

eCtrlState

none

E_CTRL_STATE

Current controller state (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 ...)