MC_Home
This function block commands the axis to perform the homing sequence. The homing sequence is added via the homing TCOM object. The calculated offset is stored in 'Active Homing Offset'. Offsets from MC_SetPosition are discarded.
Syntax
Definition:
FUNCTION_BLOCK MC_Home
VAR_IN_OUT
Axis : Reference To AXIS_REF;
END_VAR
VAR_INPUT
Execute : BOOL;
Position : LREAL;
END_VAR
VAR_OUTPUT
Done : BOOL;
Busy : BOOL;
Active : BOOL;
CommandAborted : BOOL;
Error : BOOL;
ErrorId : UDINT;
END_VAR
Inputs
|
Name |
Type |
Default |
Description |
|---|---|---|---|
|
Execute |
BOOL |
|
Trigger the command with rising edge. |
|
Position |
LREAL |
#Default |
Absolute position at the reference signal ([PosUnit]) |
Outputs
|
Name |
Type |
Description |
|---|---|---|
|
Done |
BOOL |
'Search home' sequence 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 |
Effects on the axis state

Notes on the migration from NC2 to MC3
In MC3, the MC_Home function block has fewer inputs than in NC2. The bCalibrationCam input, familiar from NC2, is now included as the input variable Signal in the homing object and can be linked directly there.
- Homing module documentation
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. |
0x8199 | 33177 | Function Block | Command not allowed. The command is not allowed in the current configuration. |
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