FB_KinConfigGroup

FB_KinConfigGroup 1:

The function block FB_KinConfigGroup configures axes according to the kinematic transformation. These are axes for the ACS (joint) and the MCS (cartesian). The function block takes the ACS and MCS axes defined in the stAxesList and configures them in the kinematic group of stKinRefIn.

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 axes (joint) can be moved directly. If TRUE, the movement described in the MCS axes (cartesian) is transformed into a movement of the ACS axes (joint). The ACS axes cannot be moved directly.

VAR_IN_OUT

VAR_IN_OUT
    stAxesList            : ST_KinAxes;
    stKinRefIn            : NCTOPLC_NCICHANNEL_REF;
END_VAR

stAxesList: Determines the ACS and MCS axes included in the configuration. See ST_KinAxes.

stKinRefIn: Determines the kinematic group of the configuration.

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 and remains TRUE as long as the function block executes the command. While bBusy is TRUE, no new command is accepted at the inputs. If 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 when the command was executed successfully.

bError: The output bError is set to TRUE, if an error occurred during the command execution.

nErrorId: contains the command-specific error code of the most recently executed command. Details of the error code can be found in the ADS error documentation or in the NC error documentation (error codes from 0x4000).

Sample

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;
    in_stKinToPlc AT %I*  : NCTOPLC_NCICHANNEL_REF;
    fbConfigKinGroup      : FB_KinConfigGroup;
    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;

IF bAllAxesReady AND bUserConfigKinGroup THEN
    bExecuteConfigKinGroup := TRUE;
ELSE
    bExecuteConfigKinGroup := FALSE;
END_IF

fbConfigKinGroup(
    bExecute       := bExecuteConfigKinGroup ,
    bCartesianMode := bUserCartesianMode ,
    stAxesList     := stAxesConfig,
    stKinRefIn     := in_stKinToPlc );

State of the kinematic group

FB_KinConfigGroup 2:
FB_KinConfigGroup 3:

Enable configuration

The ACS axes must be enabled through MC_Power, to ensure that the state can reach the value KinStatus_Ready. If the ACS axes are not enabled, enable the axes and then call up FB_KinConfigGroup or FB_KinResetGroup.