PLCopen Motion Control NOTE! The drive types iTcMc_DriveKL2521, iTcMc_DriveKL4032, iTcMc_DriveKL2531 and iTcMc_DriveKL2541 support the parameter communication. 4.5.17 MC_AxUtiWriteRegEncTerm_BkPlcMc (from V3.0) The function block writes the contents of a register of the KL terminal, which is used as encoder interface for the axis. VAR_INPUT Execute: BOOL; Select: INT; RegData: WORD; END_VAR VAR_OUTPUT Busy: BOOL; Done: BOOL; CommandAborted: BOOL; Error: BOOL; ErrorID: UDINT; END_VAR VAR_INOUT Axis: Axis_Ref_BkPlcMc; END_VAR Execute : The writing process is initiated by a rising edge at this input. Select : The register number should be transferred here. RegData :
The value to be written should be transferred here. Busy : Indicates that a command is being processed. Done : Indicates successful writing of the parameter. CommandAborted : Indicates abortion of the read operation. Error : The occurrence of an error is indicated here. ErrorID : An encoded indication of the cause of the error is provided here. Axis : Here, the address of a variable of type Axis_Ref_BkPlcMc [ } 67] should be transferred. Behaviour of the function block The function block is activated by a rising edge at Execute , and investigates the axis interface that has been passed to it. A number of problems can be detected and reported during this process:
If one of the pointers ST_TcPlcDeviceInput [ } 104] and ST_TcPlcDeviceOutput [ } 106] is not initialised, 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 outside the permitted range of 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 nEncoder_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.
PLC Library Hydraulics 216 Version: 1.4