FB_MTP_PIDCtrlBase
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.
![]() | The |
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 methods PIDLogic and ResetPID are called within this function block depending on the states of the state machines:
- Offline: cyclic call to the
ResetPIDmethod. - Operator: no calls to
PIDLogicorResetPID. - Automatic: cyclic invocation of the
PIDLogicmethod.
The function block works according to the following scheme:

Further properties
Implemented interfaces
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 |
StateChannel StateOffAut StateOpAut StateAutAut |
| See Operation Mode |
|
MVUnit | INT | Unit of manipulated variable | Read |
MVSclMin | REAL | Minimum value of the manipulated variable representation | Read |
MVSclMax | REAL | Maximum value of the manipulated variable representation | Read |
MVMin | REAL | Minimum value of the manipulated variable | Read |
MVMax | REAL | Maximum value of the manipulated variable | Read |
SrcChannel SrcIntAut SrcManAut |
| See Source Mode |
|
SPInt | REAL |
| Read |
SPUnit | INT | Unit of the setpoint | Read |
SPIntMin | REAL | Lower limit value of the | 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 representation of the setpoint specification | Read |
SPSclMax | REAL | Maximum value for the representation of the setpoint specification | Read |
PV | REAL | Process value | Read |
PVUnit | INT | Unit of the process value | Read |
PVSclMin | REAL | Minimum value for the representation of the process value | Read |
PVSclMax | REAL | Maximum value for the representation of the process value | Read |
P | REAL | Proportional gain of the controller | Read/write |
Ti | REAL | Integral action time of the controller [s] | Read/write |
Td | REAL | Derivative action time of the controller [s] | Read/write |
Outputs
Name | Type | Description | OPC UA access |
|---|---|---|---|
StateOffAct StateOpAct StateAutAct |
| See Operation Mode |
|
MV | REAL | Current manipulated variable of the controller |
|
SrcIntAct SrcManAct |
| See Source Mode |
|
SP | REAL | Setpoint currently used by the controller. |
|
External variables
Name | Type | Description | OPC UA access |
|---|---|---|---|
StateOffOp StateOpOp StateAutOp |
| See Operation Mode |
|
MVMan | REAL |
| Read/write |
SrcIntOp SrcManOp |
| See Source Mode |
|
SPMan | REAL |
| Read/write |
Methods
Name | Description |
|---|---|
PIDLogic | This method enables the implementation of the logic of the PID controller. |
ResetPID | This method allows the implementation of a logic for resetting the PID logic. |
