Plc Library VAR_INPUT VAR_INPUT bExecute : BOOL; bCartesianMode : BOOL; END_VAR bExecute: The command is triggered by a rising edge at this input. bCartesianMode: If FALSE, the ACS (Axis Coordinate system, Joint) axes can be moved directly. If TRUE, movement in the MCS (Cartesian) axes will be transformed into the ACS (Joint) axes. The ACS axes cannot be moved directly. VAR_IN_OUT VAR_IN_OUT stAxesList : ST_KinAxes; stKinRefIn : NciChannelToPlc; END_VAR stAxesList: Determines the ACS and MCS axes included in the configuration. See ST_KinAxes [ } 36] . stKinRefIn: Determines the kinematic group of the configuration. See NciChannelToPlc. VAR_OUTPUT VAR_OUTPUT bBusy : BOOL; bDone :
BOOL; bError : BOOL; nErrorId : UDINT; END_VAR bBusy: The output becomes TRUE when the command is started with bExecute as long as the function block is executing the command. While bBusy is TRUE, no new instructions will be accepted at the inputs. When bBusy becomes FALSE again, the function block is ready for a new command. At the same time one of the outputs bDone or bError is set. bDone: The output becomes true if the command succeeded. bError: The output bError becomes true if an error occurs as the command is executed. nErrorId: Contains the command-specific error code of the most recently executed command.
The error code can be found in the ADS error documentation [ } 38] or in the NC error documentation (error codes above 0x4000). Example VAR io_X : AXIS_REF; io_Y : AXIS_REF; io_Z : AXIS_REF; io_M1 : AXIS_REF; io_M2 : AXIS_REF; io_M3 : AXIS_REF; out_stPlcToKin AT %Q* : NciChannelFromPlc; out_stPlcToItp AT %Q* : NciChannelFromPlc; fbConfigKinGroup : FB_ConfigKinGroup; stAxesConfig : ST_KinAxes; bAllAxesReady : BOOL; bExecuteConfigKinGroup: BOOL; bUserConfigKinGroup : BOOL; bUserCartesianMode : BOOL; := TRUE; (*true: cartesian mode - false:
direct mode (without transformation) *) END_VAR (* read the IDs from the cyclic axis interface so the axes can mapped later to the kinematic group *) stAxesConfig.nAxisIdsAcs[1] := io_M1.NcToPlc.AxisId; stAxesConfig.nAxisIdsAcs[2] := io_M2.NcToPlc.AxisId; stAxesConfig.nAxisIdsAcs[3] := io_M3.NcToPlc.AxisId; stAxesConfig.nAxisIdsMcs[1] := io_X.NcToPlc.AxisId; stAxesConfig.nAxisIdsMcs[2] := io_Y.NcToPlc.AxisId; stAxesConfig.nAxisIdsMcs[3] := io_Z.NcToPlc.AxisId; TS511x 24 Version: 1.0