FB_MTP_Procedure

FB_MTP_Procedure 1:

The function block FB_MTP_Procedure contains all attributes and methods for describing a procedure. A procedure is an execution variant of a service and can therefore only be assigned to one service. All procedures receive a unique ProcedureID in the service. This must be described by a natural number, whereby the number 0 may not be used! The variable IsSelfCompleting is used to specify whether the process function(s) of the procedure complete(s) themselves (e.g. after a time has elapsed).

The outputs IsSelfCompleting and ProcedureID are initialized when this function block is instantiated.

CommandInfo is coded according to and is updated separately for each procedure that is in the state Automatic or Operator, regardless of the state of the service. It indicates which control commands are currently enabled.

The variable CommandAdapt is coded according to . It can be used to further restrict the enabling of control commands in CommandInfo.

FB_MTP_Procedure 2:

The variable CommandAdapt is not part of the MTP guideline. It has been implemented additionally. This variable is not listed in the MTP file and is not made available via OPC UA.

FB_MTP_Procedure 3:

The FB_MTP_Procedure is an abstract function block. This cannot be instantiated, but must be derived (see Syntax section)!

FB_MTP_Procedure 4:

For the use of procedures, the use of MTP engineering and its automatic code generation is recommended!

Required parameters and equipment

The function block receives the process parameters ProcParameters required for execution as Array[*] OF POINTER TO FB_MTP_ParameterElement. The required equipment RequiredEquipment is transferred as Array[*] OF POINTER TO I_MTP_ReqEq.

FB_MTP_Procedure 5:

If no ProcParameter or RequiredEquipment is required, you must transfer an empty array!

Services state machine

The states of the service state machine are executed in the methods of the same name in this function block. The methods are called by the service state machine.

Calling the procedure

The procedures can be called by the higher-level service. A possible call is described in the function block FB_MTP_ServiceControl.

Further characteristics

WQC

Syntax

FUNCTION_BLOCK FB_MTP_Procedure_1_Service EXTENDS FB_MTP_Procedure

FB_MTP_Procedure 6: 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

CommandInfo

DWORD

Currently enabled control commands

Read

ProcParameters

ARRAY [*] OF POINTER TO POINTER TO FB_MTP_ParameterElement

Required procedure parameters

-

RequiredEquipment

ARRAY [*] OF POINTER TO I_MTP_ReqEq

Required equipment

-

CommandAdapt

DWORD

Variable for blocking state transitions

-

FB_MTP_Procedure 7: Outputs

Name

Type

Description

OPC UA access

IsSeIfCompIeting

BOOL

1: Procedure is self-completing.

0: Procedure is completed via the control command.

Read

ProcedureID

DWORD

Unique identification of the procedure within the service

Read

FB_MTP_Procedure 8: Methods

Name

Type

Description

Aborted

BOOL

Implementation of the logic for the Aborted state of the service state machine.

Aborting

BOOL

Implementation of the logic for the Aborting state of the service state machine.

Completed

BOOL

Implementation of the logic for the Completed state of the service state machine.

Completing

BOOL

Implementation of the logic for the Completing state of the service state machine.

Execute

BOOL

Implementation of the logic for the Execute state of the service state machine.

Held

BOOL

Implementation of the logic for the Held state of the service state machine.

Holding

BOOL

Implementation of the logic for the Holding state of the service state machine.

Paused

BOOL

Implementation of the logic for the Paused state of the service state machine.

Pausing

BOOL

Implementation of the logic for the Pausing state of the service state machine

Resetting

BOOL

Implementation of the logic for the Resetting state of the service state machine.

Resuming

BOOL

Implementation of the logic for the Resuming state of the service state machine.

Starting

BOOL

Implementation of the logic for the Starting state of the service state machine.

Stopping

BOOL

Implementation of the logic for the Stopping state of the service state machine.

Stopped

BOOL

Implementation of the logic for the Stopped state of the service state machine.

Unholding

BOOL

Implementation of the logic for the Unholding state of the service state machine.

IsActuatorsInternal

BOOL

1: All actuators assigned to the procedure are in the state Internal.

IsActuatorsManual

BOOL

1: All actuators assigned to the procedure are in the state Manual.

IsActuatorsOffline

BOOL

1: All actuators assigned to the procedure are in the state Offline.

IsActuatorsOperator

BOOL

1: All actuators assigned to the procedure are in the state Operator.

IsActuatorsAutomatic

BOOL

1: All actuators assigned to the procedure are in the state Automatic.

IsReqEqInternal

BOOL

1: PID logic and all actuators assigned to the procedure are in the state Internal

IsReqEqManual

BOOL

1: PID logic and all actuators assigned to the procedure are in the state Manual

IsReqEqOffline

BOOL

1: PID logic and all actuators assigned to the procedure are in the state Offline

IsReqEqOperator

BOOL

1: PID logic and all actuators assigned to the procedure are in the state Operator

IsReqEqAutomatic

BOOL

1: PID logic and all actuators assigned to the procedure are in the state Automatic

SetActuatorsInternal

BOOL

All actuators assigned to the procedure are transferred to the state Internal.

SetActuatorsManual

BOOL

All actuators assigned to the procedure are transferred to the state Manual.

SetActuatorsOffline

BOOL

All actuators assigned to the procedure are transferred to the state Offline.

SetActuatorsOperator

BOOL

All actuators assigned to the procedure are transferred to the state Operator.

SetActuatorsAutomatic

BOOL

All actuators assigned to the procedure are transferred to the state Automatic.

SetReqEqInternal

BOOL

PID logic and all actuators assigned to the procedure are transferred to the state Internal.

SetReqEqManual

BOOL

PID logic and all actuators assigned to the procedure are transferred to the state Manual.

SetReqEqOffline

BOOL

PID logic and all actuators assigned to the procedure are transferred to the state Offline.

SetReqEqOperator

BOOL

PID logic and all actuators assigned to the procedure are transferred to the state Operator.

SetReqEqAutomatic

BOOL

PID logic and all actuators assigned to the procedure are transferred to the state Automatic.