FB_MTP_PIDCtrlBase

FB_MTP_PIDCtrlBase 1:

The function block FB_MTP_PIDCtrlBase serves as an interface for using a PID controller from different sources: internal PLC logic or manual operation (e. g. via OPC UA). Value specifications are managed independently of each other by the state machines of Operation Mode and Source Mode. The OPC UA access rights are described in the variable tables.

FB_MTP_PIDCtrlBase 2:

The FB_MTP_PIDCtrlBase is an abstract function block. This cannot be instantiated, but must be derived (see syntax)!

State machines

The source of the setpoint SP* is managed via the state machine of the Source Mode. The source of the output manipulated variable MV* is managed via the state machine of the Operation Mode: Output value of the PID logic or specification by manual operation MVMan.

PID controller

The PID logic (PIDLogic()) can be freely selected. The PID logic is called via the method PIDLogic(). The parameters for the controller are described via the inputs P, Ti and Td. The output MV describes the current manipulated variable depending on the current states of the state machines. The output SP shows the currently used setpoint of the PID logic.

The function block works according to the following scheme:

FB_MTP_PIDCtrlBase 3:

Further characteristics

Name of the object

Object description

WQC

OSLevel

Value scaling

Value limitation

Unit

Syntax

FUNCTION_BLOCK FB_MTP_PIDCtrl EXTENDS FB_MTP_PIDCtrlBase
VAR
    ///Controller Toolbox (delete if you want to use own PID Logic)
    CTRL_PID: FB_CTRL_PID;
    PIDParams: ST_Ctrl_PID_PARAMS;
END_VAR
SUPER^();

FB_MTP_PIDCtrlBase 4: Inputs

Name

Type

Description

OPC UA access

TagName

STRING

Name of the interface

-

TagDescription

STRING

Description of the interface

-

WQC

BYTE

Worst Quality Code

Read

OSLevel

BYTE

Level must be defined for system. Value 0 is reserved for local operation.

Read/write

State*

 

See Operation Mode

 

MVUnit

INT

Unit of manipulated variable

Read

MVSclMin

REAL

Minimum value of the manipulated variable display

Read

MVSclMax

REAL

Maximum value of the manipulated variable display

Read

MVMin

REAL

Minimum value of the manipulated variable

Read

MVMax

REAL

Maximum value of the manipulated variable

Read

Src*

 

See Source Mode

 

SPInt

REAL

internal setpoint specification

Read

SPUnit

INT

Unit of the setpoint

Read

SPIntMin

REAL

Lower limit value of the internal setpoint specification

Read

SPIntMax

REAL

Upper limit value of the PEA internal setpoint specification

Read

SPManMin

REAL

Lower limit value of the manual setpoint specification

Read

SPManMax

REAL

Upper limit value of the manual setpoint specification

Read

SPSclMin

REAL

Minimum value for the display of the setpoint specification

Read

SPSclMax

REAL

Maximum value for the display of the setpoint specification

Read

PV

REAL

Process value

Read

PVUnit

INT

Unit of the process value

Read

PVSclMin

REAL

Minimum value for displaying the process value

Read

PVSclMax

REAL

Maximum value for displaying the process value

Read

P

REAL

Proportional gain of the controller

Read

Ti

REAL

Integral action time of the controller [s]

Read

Td

REAL

Derivative action time of the controller [s]

Read

FB_MTP_PIDCtrlBase 5: Outputs

Name

Type

Description

OPC UA access

State*

 

See Operation Mode

 

MV

REAL

Current manipulated variable of the controller

 

Src*

 

See Source Mode

 

SP

REAL

Setpoint currently used by the controller.

 

External variables

Name

Type

Description

OPC UA access

State*

 

See Operation Mode

 

MVMan

REAL

Manual specification of the manipulated variable

Read/write

Src*

 

See Source Mode

 

SPMan

REAL

Manual setpoint specification

Read/write

FB_MTP_PIDCtrlBase 6: Methods

Name

Description

PIDLogic

Implementation of the logic for calling the PID controller

ResetPID

Resetting the PID controller