MC_SetHomingState

MC_SetHomingState 1:

This function block allows setting and resetting the IsPositionValid flag in the CDT_MCTOPLC_AXIS_STD. Optionally, it can also set the Position.

Syntax

Definition:

FUNCTION_BLOCK MC_SetHomingState
VAR_INPUT
    Axis           : Type_PtpSetHomingState;
    Execute        : BOOL;
    Position       : LREAL;
    Mode           : EHomingMode;
END_VAR
VAR_OUTPUT
    Done           : BOOL;
    Busy           : BOOL;
    Active         : BOOL;
    CommandAborted : BOOL;
    Error          : BOOL;
    ErrorId        : UDINT;
END_VAR

MC_SetHomingState 2: Inputs

Name

Type

Default

Description

Axis

Type_PtpSetHomingState

 

Reference to the axis

Execute

BOOL

 

Trigger the command with rising edge.

Position

LREAL

#Invalid

New position value ([PosUnit])

Mode

EHomingMode

ForceIsHomed

Homing mode selection

MC_SetHomingState 3: Outputs

Name

Type

Description

Done

BOOL

Homing succeeded

Busy

BOOL

Function block is not finished and new output values are to be expected.

Active

BOOL

Function block has active control on the axis.

CommandAborted

BOOL

Command is aborted by another command.

Error

BOOL

Error occurred within function block.

ErrorId

UDINT

Error identifier

Possible error codes

For this function block, the following values, among others, are possible for the ErrorId output:

Error(Hex)

Error(Dec)

Error type

Description

0x8145

33093

Function Block

Mapping of cyclic interface between NC and PLC is missing (e.g., AXIS_REF, AXES_GROUP_REF, ...). A reference used by the function block (e.g., to an axis, group, mover or other motion object) is not linked to the corresponding NC object, or its cyclic mapping is incomplete.

0x8151

33105

State

Command is not allowed in current axis state. If the axis has no controller enable, is in error or has been added to a group, some commands are not permitted.

0x81b8

33208

Parameter

No cam event was detected during homing. The axis did not detect the reference cam within the expected travel during homing.

0x81b9

33209

Parameter

No sync event was detected during homing. No sync event (e.g., encoder zero pulse) was detected during homing.

An overview of all NC error codes can be found here:

Version information

  • TwinCAT Standard >= v3.1.4026.23.1
  • TF5500 MC3 Base >= v4.0.6