FB_MTP_Procedure

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. You must describe these using a natural number, but you may not use the number 0.
The Boolean variable IsSelfCompleting specifies whether the function(s) related to process technology of a procedure can terminate on their own (e.g., after a certain amount of time has elapsed, upon reaching a certain state, etc.).
If IsSelfCompleting = TRUE, the internal logic automatically exits the Execute state as soon as the internal termination condition is met. In addition, you can exit Execute at any time by using the commands Stop or Abort.
If IsSelfCompleting = FALSE, the system exits the Execute state exclusively via external control commands (e.g., Complete or Stop).
CommandInfo is encoded according to and indicates which control commands are currently enabled.
The variable CommandAdapt is coded according to . You can use this feature to further restrict the enabling of control commands in CommandInfo.
![]() | The variable |
![]() | The |
![]() | For using procedures, we recommend using TwinCAT 3 MTP Engineering and its built-in automatic code generation feature. |
Required parameters and equipment
The function block receives the process parameters ProcParameters required for execution as Array[0..(cProcParameters-1)] OF I_MTP_ParameterElement. The required equipment RequiredEquipment is transferred as Array[0..(cRequiredEquipment)] OF I_MTP_DataAssembly.
![]() | If no |
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.
![]() | Some of the methods include predefined logic (see the description of the methods). You can override these by recreating the method. |
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 properties
Syntax
// ************************************************************************
// * This file was automatically generated by TwinCAT 3 MTP Engineering. *
// * *
// * INFO: Implement service states in methods. Variables related to *
// * this procedure should be added here. This function block can extend *
// * existing procedure function blocks. *
// * *
// * Generated on: 12.34.5678 01:23:45 *
// * TwinCAT 3 MTP Engineering Version: 1.1.0.0 *
// ************************************************************************
FUNCTION_BLOCK FB_MTP_Volume_Filling
VAR_GENERIC CONSTANT
cProcParameter_Volume_Filling : UINT := 1;
cRequiredEquipment_Volume_Filling : UINT := 1;
END_VAR
EXTENDS FB_MTP_Procedure<cProcParameter_Volume_Filling, cRequiredEquipment_Volume_Filling>
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 [0..(cProcparameters-1)] OF I_MTP_INTERNAL_ParameterElement | Required procedure parameters | - |
RequiredEquipment | ARRAY [0..(cRequiredEquipment-1)] OF I_MTP_DataAssembly | Required equipment | - |
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 |
CommandAdapt | DWORD | Variable for blocking state transitions. | - |
Methods
Name | Type | Description |
|---|---|---|
Aborted | BOOL | Implementation of the logic for the |
Aborting | BOOL | Implementation of the logic for the |
Completed | BOOL | Implementation of the logic for the |
Completing | BOOL | Implementation of the logic for the |
Execute | BOOL | Implementation of the logic for the |
Held | BOOL | Implementation of the logic for the |
Holding | BOOL | Implementation of the logic for the |
Paused | BOOL | Implementation of the logic for the |
Pausing | BOOL | Implementation of the logic for the |
Resetting | BOOL | Implementation of the logic for the |
Resuming | BOOL | Implementation of the logic for the |
Starting | BOOL | Implementation of the logic for the |
Stopping | BOOL | Implementation of the logic for the |
Stopped | BOOL | Implementation of the logic for the |
Unholding | BOOL | Implementation of the logic for the |
IsActuatorsInternal | BOOL | 1: All actuators assigned to the procedure are in the state |
IsActuatorsManual | BOOL | 1: All actuators assigned to the procedure are in the state |
IsActuatorsOffline | BOOL | 1: All actuators assigned to the procedure are in the state |
IsActuatorsOperator | BOOL | 1: All actuators assigned to the procedure are in the state |
IsActuatorsAutomatic | BOOL | 1: All actuators assigned to the procedure are in the state |
IsReqEqInternal | BOOL | 1: PID logic and all actuators assigned to the procedure are in the state |
IsReqEqManual | BOOL | 1: PID logic and all actuators assigned to the procedure are in the state |
IsReqEqOffline | BOOL | 1: PID logic and all actuators assigned to the procedure are in the state |
IsReqEqOperator | BOOL | 1: PID logic and all actuators assigned to the procedure are in the state |
IsReqEqAutomatic | BOOL | 1: PID logic and all actuators assigned to the procedure are in the state |
SetActuatorsInternal | BOOL | All actuators assigned to the procedure are transferred to the state |
SetActuatorsManual | BOOL | All actuators assigned to the procedure are transferred to the state |
SetActuatorsOffline | BOOL | All actuators assigned to the procedure are transferred to the state |
SetActuatorsOperator | BOOL | All actuators assigned to the procedure are transferred to the state |
SetActuatorsAutomatic | BOOL | All actuators assigned to the procedure are transferred to the state |
SetReqEqInternal | BOOL | PID logic and all actuators assigned to the procedure are transferred to the state |
SetReqEqManual | BOOL | PID logic and all actuators assigned to the procedure are transferred to the state |
SetReqEqOffline | BOOL | PID logic and all actuators assigned to the procedure are transferred to the state |
SetReqEqOperator | BOOL | PID logic and all actuators assigned to the procedure are transferred to the state |
SetReqEqAutomatic | BOOL | PID logic and all actuators assigned to the procedure are transferred to the state |
