MC_AxUtiWriteRegDriveTerm_BkPlcMc (from V3.0)
The function block writes the contents of a register of the KL terminal, which is used as drive interface for the axis.
Inputs
VAR_INPUT
Execute: BOOL;
Select: INT;
RegData: WORD;
END_VAR
Name | Type | Description |
---|---|---|
Execute | BOOL | The writing process is initiated by a rising edge at this input. |
Select | INT | The register number should be transferred here. |
RegData | WORD | The value to be written should be transferred here. |
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;
Done: BOOL;
CommandAborted: BOOL;
Error: BOOL;
ErrorID: UDINT;
END_VAR
Name | Type | Description |
---|---|---|
Busy | BOOL | Indicates that a command is being processed. |
Done | BOOL | Indicates successful writing of the parameter. |
CommandAborted | BOOL | Indicates abortion of the read operation. |
Error | BOOL | The occurrence of an error is indicated here. |
ErrorID | UDINT | An encoded indication of the cause of the error is provided here. |
Behavior of the function block
On a rising edge at Execute the function block checks the transferred axis interface. A number of problems can be detected and reported during this process:
- If one of the pointers ST_TcPlcDeviceInput and ST_TcPlcDeviceOutput is not initialized, the system responds with Error and ErrorID:=dwTcHydErrCdPtrPlcMc.
- If the axis is enabled for operation, the system responds with Error and ErrorID:=dwTcHydErrCdNotReady.
- If Select is out of the allowed range from 0 to 63, the system responds with Error and ErrorID:=dwTcHydErrCdTblIllegalIndex.
- If an I/O module, which does not support parameter communication, is set as nDrive_Type in the axis parameters, the system responds with Error and ErrorID:=dwTcHydErrCdNotCompatible.
The writing process begins if these checks are carried out without problems.
A falling edge at Execute clears all the pending output signals. If Execute is set to FALSE while the writing process is still active, the process that had started continues unaffected. The signals provided at the end of the operation (RegData, Done, CommandAborted, Error, ErrorID, Done) are made available for one cycle.
The drive types iTcMc_DriveKL2521, iTcMc_DriveKL4032, iTcMc_DriveKL2531 and iTcMc_DriveKL2541 support the parameter communication. |