MC_Power_BkPlcMc (from V3.0)
The function block is used to control an external actuator. Further information on this topic can be found under FAQ #9.
Inputs
VAR_INPUT
Enable: BOOL;
Enable_Positive: BOOL;
Enable_Negative: BOOL;
BufferMode: MC_BufferMode_BkPlcMc:=Aborting_BkPlcMc; (ab/from V3.0.8)
END_VAR
Name | Type | Description |
---|---|---|
Enable | BOOL | A TRUE at this input activates an external actuator of an axis. |
Enable_Positive | BOOL | A TRUE at this input activates the directional enable of an external actuator of an axis for movements in a positive direction. |
Enable_Negative | BOOL | A TRUE at this input activates the directional enable of an external actuator of an axis for movements in a negative direction. |
BufferMode | MC_BufferMode_BkPlcMc | reserved. This input is provided in preparation for a future build. It should currently either not be assigned or assigned the constant Aborting_BkPlcMc. (from V3.0.8) |
Inputs/outputs
VAR_INOUT
Axis: Axis_Ref_BkPlcMc;
END_VAR
Name | Type | Description |
---|---|---|
Axis | Axis_Ref_BkPlcMc | Here, the address of a variable of type Axis_Ref_BkPlcMc should be transferred. |
Outputs
VAR_OUTPUT
Busy: BOOL;
Status: BOOL;
Error: BOOL;
ErrorID: UDINT;
END_VAR
Name | Type | Description |
---|---|---|
Busy | BOOL | Indicates that a command is being processed. |
State | BOOL | Readiness for operation is indicated here. |
Error | BOOL | The occurrence of an error is indicated here. |
ErrorID | UDINT | An encoded error message is provided here. |
Behavior of the function block
This function block is used to control external actuators. These can be modules for valve control (the valve's onboard output stage or control cabinet assembly), frequency inverters or servo drives. These devices usually require a digital signal to enable the output of energy through a power stage. Depending on the design of the device, it is also possible for the "positive" and "negative" movement directions to be individually activated.
The function block's input signals are passed on through the interface to the peripheral device. Enable also activates error monitoring.
The function block investigates the axis interface that has been passed to it every time it is called. A number of problems can be detected and reported during this process:
- If the value iTcMc_DriveAx2000_XXXXX is set under nDrive_Type in pStAxParams, the following procedure is applied:
- If one of the pointers pStDeviceOutput or pStDeviceInput in Axis_Ref_BkPlcMc is not initialized, the function block responds with Error and ErrorID:=dwTcHydErrCdPtrPlcDriveIn or dwTcHydErrCdPtrPlcDriveOut. Status is then FALSE.
- If an error is detected in the communication with the AX device or an error message occurs in the pStDeviceInput interface of the AX device, the function block responds with Error and an ErrorID, which is defined in the global constants of the library. Status is then FALSE, and the axis is set to an error state with the axis error dwTcHydErrCdDriveNotReady.
- Otherwise, the value of Enable is returned as the Status.
- If the value iTcMc_DriveKL2531 or iTcMc_DriveKL2541 is set under nDrive_Type in pStAxParams, the following procedure is applied:
- The pointers pStDeviceOutput and pStDeviceInput in Axis_Ref_BkPlcMc are checked. If these pointers have not been initialized, the function block responds with Error and ErrorID:=dwTcHydErrCdPtrPlcDriveIn or dwTcHydErrCdPtrPlcDriveOut. Status is then FALSE.
- If an error is detected in the communication with the I/O terminal or an error message of the terminal occurs in the pStDeviceInput interface, the function block responds with Error and an ErrorID, which is defined in the global constants of the library. Status is then FALSE, and the axis is set to an error state with the axis error dwTcHydErrCdDriveNotReady.
- Enable is used to activate the terminal output stage through a bit in pStDeviceOutput.bTerminalCtrl. The ready signal in bTerminalCtrl.bTerminalState is returned as Status.
- If the drive interface is operating without error, the value of Enable_Positive is entered with the mask dwTcHydDcDwFdPosEna in the nDeCtrlDWord of pStAxRtData.
- If the drive interface is operating without error, the value of Enable_Negative is entered with the mask dwTcHydDcDwFdNegEna in the nDeCtrlDWord of pStAxRtData.
- Otherwise the pointers pStDeviceInput and pStDeviceOutput in Axis_Ref_BkPlcMc are checked. If these pointers have not been initialized, the function block responds with Error and ErrorID:=dwTcHydErrCdPtrPlcDriveIn or dwTcHydErrCdPtrPlcDriveOut. Status is then FALSE.
- Otherwise, the value of bPowerOk from pStDeviceInput is returned as the Status.
- If the drive interface is operating without error, the value of Enable is entered with the mask dwTcHydDcDwCtrlEnable in the nDeCtrlDWord of pStAxRtData.
- If the drive interface is operating without error, the value of Enable_Positive is entered with the mask dwTcHydDcDwFdPosEna in the nDeCtrlDWord of pStAxRtData.
- If the drive interface is operating without error, the value of Enable_Negative is entered with the mask dwTcHydDcDwFdNegEna in the nDeCtrlDWord of pStAxRtData.
This function block requires no time for executing its tasks. The output Busy will never assume the value TRUE and only exists for compatibility reasons. |