FB_CTRL_TempController

FB_CTRL_TempController 1:

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.

Interface

FB_CTRL_TempController 2: VAR_INPUT

VAR_INPUT
  eCtrlMode               : E_CTRL_MODE;
  bSelSetpoint            : BOOL;
  fW1                     : LREAL;
  fW2                     : LREAL;
  fX                      : LREAL;
  fYManual                : LREAL;
  bOpenThermocouple       : BOOL; (* thermocouple *)
  bReverseThermocouple    : BOOL;
  bBackVoltage            : BOOL;
  bLeakage                : BOOL; (* heating system *)
  bShortCircuit           : BOOL;
  bOpenCircuit            : BOOL;
  sParaControllerExternal : ST_CTRL_ParaController
END_VAR

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 is usually smaller than fW1. fSelSetpoint can be used to switch between fW1 and fW2.

fX

°C

LREAL

Actual value

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.

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.

FB_CTRL_TempController 3: VAR_OUTPUT

VAR_OUTPUT
  fYAnalog                : LREAL;
  bYPWMPos                : BOOL;
  bYPWMNeg                : BOOL;
  bYDigPos                : BOOL;
  bYDigNeg                : BOOL;
  dwAlarm                 : DWORD;
  fMaxOverShoot           : LREAL;
  tStartUpTime            : TIME;
  eCtrlState              : E_CTRL_STATE := eCTRL_STATE_IDLE;
  sParaControllerInternal : ST_CTRL_ParaController;
  bError                  : BOOL;
  eErrorId                : E_CTRL_ErrorCodes;
END_VAR

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 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_CTRL_TempCtrlParameter; (* controller parameter set *)
END_VAR

Name

Type

Description

sController
parameter

ST_CTRL_TempCtrl
Parameter

Parameter structure of the function block

Requirements

Development environment

Target platform

PLC libraries to include

TwinCAT 3.1.4016

PC or CX

Tc2_TempController