FB_KinCheckActualStatus

FB_KinCheckActualStatus 1:
FB_KinCheckActualStatus 2:

Outdated version

The sole purpose of the function block is to ensure compatibility with existing projects. For new projects please use F_KinGetChnOperationState. This function block needs more than one PLC cycle to read the status of the kinematic channel. To obtain the status for each cycle please use F_KinGetChnOperationState.

The function block FB_KinCheckActualStatus returns the status of the kinematic channel.

VAR_INPUT

VAR_INPUT
    bExecute              : BOOL;
END_VAR

bExecute: The command is triggered by a rising edge at this input.

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
    eKinStatus            : E_KINSTATUS;
    bBusy                 : BOOL;
    bDone                 : BOOL;
    bError                : BOOL;
    nErrorId              : UDINT;
END_VAR

eKinStatus: Returns the status of the kinematic channel. See E_KINSTATUS.

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
    fbFB_KinCheckActualStatus  : FB_KinCheckActualStatus;
    in_stKinToPlc AT %I*       : NCTOPLC_NCICHANNEL_REF;
    stAxesConfig               : ST_KinAxes;
    eKinStatus                 : E_KINSTATUS;
END_VAR
fbFB_KinCheckActualStatus(
    bExecute            := TRUE,
    stAxesListReference := stAxesConfig,
    stKinRefIn          := in_stKinToPlc,
    eKinStatus          => eKinStatus      );

State of the kinematic group

FB_KinCheckActualStatus 3: