S7-1500 HomingDone StatusBit: Reading and Resetting Axis Homing

David Krause12 min read
Motion ControlSiemensTechnical Reference
Licensed PE Working through this on a live machine? A Maine-licensed engineer can take it from here — included with IMD hardware, by the hour for everything else. Book an engineer

Overview: What the HomingDone StatusBit Tells You

The HomingDone status bit on a Siemens SIMATIC S7-1500 or S7-1500T motion control axis is the CPU's authoritative indication that the relationship between the position stored inside the technology object (TO) and the real mechanical position of the axis has been successfully established. Until the bit becomes TRUE, the controller will not allow absolute positioning moves; it will reject MC_MoveAbsolute calls with a command error, and any MC_MoveRelative command will execute without a defined origin. Once HomingDone is TRUE, the axis can be commanded in absolute coordinates as long as the bit stays TRUE. The bit therefore does double duty: it is a process-completion handshake from the homing function block MC_Home and a runtime guard that must be re-checked before every absolute move.

This is documented for both the positioning axis and the external encoder technology objects in the current TIA Portal V20 reference:

Per those references, the bit is described as: "The relationship between the position in the technology object and the mechanical position was successfully created." That is the contract: TRUE means a valid, homed reference exists; FALSE means the axis must be homed again before absolute motion is permitted.

StatusWord Bit Layout and Tag Location

The HomingDone state lives in the technology object's status word. In TIA Portal V17 and later, the structure is exposed as <TO>.StatusWord; in earlier V13/V14 projects the older <TO>.StatusBits.HomingDone is generated. Both are the same physical bit.

Tag path Bit Meaning Set by
<Axis>.StatusWord.X5 (HomingDone) X5 / bit 5 Axis has a valid home reference Successful MC_Home execution
<Axis>.StatusBits.HomingDone (legacy) — Alias of X5 Same as above
<ExtEncoder>.StatusWord.X5 (HomingDone) X5 / bit 5 External encoder has a valid home reference Encoder homing procedure
MC_Home.Done Output One-shot done flag of the current homing call Function block instance
MC_Home.Busy Output Homing sequence in progress Function block instance
MC_Home.CommandAborted Output Homing was interrupted Function block instance
Critical: The MC_Home.Done output is a one-shot that falls when the next motion command is started. The technology object's StatusWord.X5 (HomingDone) is a sticky bit that stays TRUE until one of the clearing conditions described below occurs. Do not substitute one for the other when checking "do I have a valid reference?" at the start of a cycle.

Behavior of HomingDone During the Homing Sequence

During an active homing run (Mode = 3, 4, or 5 on MC_Home), the bit will normally transition from FALSE to TRUE at the moment the homing procedure completes. On passive homing (Mode = 2), the bit only becomes TRUE after the next encoder zero/edge event is detected. While the homing sequence is in progress, monitoring the bit can be misleading for two reasons:

  1. The bit may briefly pulse TRUE if the TO internally re-evaluates state on each OB servo cycle before the final reference point is locked in.
  2. When the axis is offset from the homing sensor (for example, the documented case of a 20 mm mechanical offset between the sensor position and the intended machine zero), the axis will travel at the configured homing velocity past the sensor, decelerate, and only then settle. Until the final stop and position latch occurs, StatusWord.X5 remains FALSE.

Always gate the HomingDone read with the MC_Home.Busy output being FALSE and MC_Home.Done being TRUE before considering the reference valid for the rest of the program.

Conditions That Clear the HomingDone Bit

The StatusWord.X5 (HomingDone) bit returns to FALSE under any of the following documented conditions:

  • MC_Reset in restart mode. Calling MC_Reset with Mode = 3 (restart of the technology object) clears all axis state, including HomingDone, and forces a new homing run.
  • MC_POWER loses enable. When MC_POWER.Status transitions from RUNNING back to STOPPED — for example after a drive STO/SS1 event, a PROFIdrive fault clear, or removing enable from the drive — the homing reference is invalidated.
  • Configuration download in RUN / re-init of the TO. Re-initializing the technology object (for example by downloading the axis configuration online) drops the HomingDone bit.
  • CPU STOP -> RUN transition with no retentive homing. By default the home position is not retained; the bit returns FALSE on every warm restart of the CPU.
  • Absolute encoder overflow / range wrap. On a single-turn absolute encoder, mechanical movement outside the encoder's range invalidates the relationship between the absolute count and the last calibrated home.
Jogging the axis in manual mode does not clear HomingDone. Once homed, the bit stays TRUE through unlimited incremental travel, including MC_MoveJog calls, as long as MC_POWER remains enabled and no reset/restart event has occurred. The persistent confusion about jogging clearing the reference comes from installations where the drive drops enable during manual mode (for example when SS1 is used as a stop category) — in that case MC_POWER loses enable and the bit clears as a side effect.

Reading HomingDone in Ladder and Structured Text

Two equivalent ways to expose the bit to the rest of the program are shown below. The structured text form is preferred because it lets you debounce the read and combine it with MC_Home.Done and MC_Home.Busy in a single rising-edge detection block.

Ladder (FBD/KOP):

      Axis_HomeDone           Axis_Homed_OK
Axis_1.StatusWord.X5  ----[ ]-----------------( )--
      HomingDone            Edge memory

Structured Text (SCL):

// Debounced "axis has a valid home reference" flag
IF (Axis_1.StatusWord.X5 = TRUE)
   AND (Axis_1.MC_Home_Instance.Busy = FALSE)
   AND (Axis_1.MC_Home_Instance.Done = TRUE)
   AND (Axis_1.Error = FALSE)
THEN
    Axis_Homed_OK := TRUE;       // sticky until cleared by reset event
ELSE
    Axis_Homed_OK := FALSE;
END_IF;

For cyclic automatic re-evaluation when the operator starts the machine:

// Auto-rehome if the reference was lost (e.g. after power cycle)
IF AutoStart_PB AND (NOT Axis_Homed_OK) THEN
    MC_Home_Instance(Execute := TRUE,
                     Position := 0.0,
                     Mode     := 0);  // absolute homing via homing switch
END_IF;

IF MC_Home_Instance.Done THEN
    MC_Home_Instance(Execute := FALSE);  // one-shot pattern
END_IF;

MC_Reset in Restart Mode: Forcing HomingDone FALSE

The MC_Reset function block is the only documented application-level mechanism to deliberately clear HomingDone. Two modes matter for homing:

Mode Effect on HomingDone Typical use
0 - Acknowledge errors Clears pending errors; HomingDone retained Reset drive faults after the cause is fixed
1 - Single restart Re-initializes axis state; HomingDone -> FALSE Force a re-homing without full CPU restart
2 - Restart with parameter reset Loads defaults from TO config; HomingDone -> FALSE Recover from a corrupted position
3 - Restart of technology object Full TO re-init; HomingDone -> FALSE Equivalent to a STOP -> RUN transition of the axis

Use mode 1 for routine re-homing (operator jogs outside the safe range, sensor replacement, encoder swap). Use mode 2 or 3 only when the TO configuration itself needs to be reloaded.

Retaining the Homing State Across Power Cycles

Standard incremental encoders cannot retain the home reference through a power loss. The CPU's retentive tags are not sufficient because the absolute count of pulses from the encoder zero mark is also lost. Two strategies are supported:

  1. Multi-turn absolute encoder (EnDat 2.2, SSI absolute, PROFIsafe encoder). The encoder reports its absolute position across the full travel range on power-up. Combined with the SINAMICS drive's absolute encoder calibration routine, the axis can be marked as already homed after a CPU STOP -> RUN transition. In TIA Portal, configure the encoder type in the TO properties as "Absolute" and set the homing mode to "Absolute encoder adjustment" (Mode 7 on MC_Home).
  2. Modulo axis with retained home offset. For axes with a fixed modulo range (turntables, indexing tables), the home offset can be stored in a retentive DB and applied on power-up, but the reference still must be re-established by a single reference run unless the encoder is absolute.
Retaining HomingDone across power cycles only works if the encoder itself is absolute. Saving the bit in a retentive tag and forcing it TRUE is unsafe because the CPU has no way to verify the axis hasn't moved mechanically while powered off.

MC_POWER and Enable Loss

Because MC_POWER losing enable clears HomingDone, the program must treat MC_POWER.Status as part of the homed-state equation:

Axis_Ready_And_Homed := Axis_1.StatusWord.X5       // HomingDone
                       AND (MC_Power_Instance.Status = 5);  // RUNNING state

When the drive transitions to STOPPED, Axis_Ready_And_Homed falls FALSE regardless of the previous HomingDone value. The next MC_Power call that brings the drive back to RUNNING requires a fresh MC_Home before any absolute move.

MC_POWER.Status Status word value HomingDone behavior
POWER_OFF 0 Cleared, axis off
STOPPED 2 Cleared, drive disabled
STARTING 3 Cleared, drive ramping up
RUNNING 5 Sticky, set if previously homed
STOPPING 7 Cleared, drive ramping down

Re-homing Logic Patterns

Three field-proven patterns cover most installations:

Pattern 1 - Always re-home on cold start (incremental encoder):

// First OB1 scan after RUN
IF FirstScan THEN
    MC_Home_Instance(Execute := TRUE, Position := 0.0, Mode := 3);
END_IF;

Pattern 2 - Conditional re-home on auto start (operator-driven):

IF AutoStart_PB AND AutoStart_RTrig AND (NOT Axis_Homed_OK) THEN
    MC_Home_Instance(Execute := TRUE, Position := 0.0, Mode := 3);
END_IF;

IF MC_Home_Instance.Done THEN
    MC_Home_Instance(Execute := FALSE);
END_IF;

Pattern 3 - Absolute encoder calibration (no reference run):

// On CPU RUN, axis is already referenced by encoder
IF FirstScan AND AbsoluteEncoderConfigured THEN
    MC_Home_Instance(Execute := TRUE, Position := HomeOffset, Mode := 7);
END_IF;

Comparison: Siemens StatusBit vs. Other Platforms

The S7-1500T sticky HomingDone pattern is conceptually identical to most PLC implementations, but the bit names and clearing conditions differ.

Platform Homed flag Cleared by Retained across power cycle
Siemens S7-1500 / S7-1500T StatusWord.X5 (HomingDone) MC_Reset restart, MC_POWER off, TO re-init Only with absolute encoder
Siemens S7-1200 StatusWord.X5 (HomingDone) MC_Reset, MC_POWER off Only with absolute encoder
Beckhoff TC3 CNC NC axis status bit "Homed" Channel reset, axis reset Only with absolute encoder; uses two control and two status bits for drive-supported homing as documented in the Beckhoff axis parameter reference
Allen-Bradley Logix Designer AXIS_REF.HomeStatus MAH (Motion Axis Home) command, drive reset Only with absolute feedback

Field-Proven Caveats and Diagnostics

  • Watchdog of MC_Home. If MC_Home never reaches Done (for example because the homing switch wiring is open), the bit never sets and the program will sit at "axis not homed" indefinitely. Add a 30 s timer in the application to raise an HMI alarm if MC_Home.Busy stays TRUE without Done.
  • Edge of mechanical travel. If the home sensor is offset 20 mm from the intended machine zero, the TO is configured with a home position offset. Verify the offset in the TO configuration under "Homing -> Home position offset" matches the mechanical drawing — a sign error will not break HomingDone, but every absolute move will be wrong by 20 mm.
  • PROFIdrive telegram mismatch. On SINAMICS drives, the S7-1500T uses telegram 5 or 6 for servo control. If telegram 105 is configured instead, the homing command works but the HomingDone reflection can lag one OB servo cycle. Use the standard telegram for the drive family.
  • SS1 stop category. Safety Stop 1 (SS1) ramps the drive down and then removes enable. This is the most common reason HomingDone disappears "on its own" in machines with a safety controller — the operator pressing an E-stop triggers SS1, MC_POWER drops out, and the next auto start finds the axis un-homed.
  • Multiple axes sharing an MC_Home instance. Do not call the same MC_Home instance for two axes. Create one MC_Home instance per technology object; the instance is bound to a single axis at compile time.

Verification Steps

  1. Open the technology object in TIA Portal, go to Diagnostics -> Status and error bits, and confirm HomingDone is TRUE in online view after the homing sequence completes.
  2. From the watch table, force a drive fault, acknowledge it, and re-read the bit. It must return to FALSE.
  3. Trigger a STOP -> RUN transition of the CPU (not the drive) and re-read the bit. It must return to FALSE on incremental-encoder axes and stay TRUE on absolute-encoder axes that have been calibrated.
  4. Execute an MC_MoveAbsolute with a deliberately invalid position (for example 0.0 when the axis is at 500.0 and not homed). The block must return ErrorID = 16#8001 (invalid input parameter) or a command-reject error rather than moving the axis.
  5. Add a trace on StatusWord.X5, MC_Home.Done, and MC_Home.Busy during a normal homing run to confirm the expected sequence: Busy rises, Done falls, axis travels, Done rises, HomingDone rises, Busy falls.

Summary

The Siemens S7-1500 / S7-1500T StatusWord.X5 (HomingDone) bit is the single source of truth for "is this axis allowed to do an absolute move?". It is set by a successful MC_Home execution, held sticky across normal incremental motion, and cleared by any of: MC_Reset in restart mode, loss of MC_POWER enable, TO re-initialization, or a cold CPU restart (unless an absolute encoder is configured). Build the auto-start logic around the bit, debounce it against MC_Home.Busy and MC_Home.Done, and treat MC_POWER.Status as part of the equation so the program never relies on a stale reference.

FAQ

Does jogging the axis in manual mode clear HomingDone on an S7-1500?

No. Manual jogging through MC_MoveJog or the HMI jog controls does not clear StatusWord.X5 (HomingDone) on its own. The bit only clears when MC_POWER loses enable, when MC_Reset is called in restart mode, or when the technology object is re-initialized. If jogging in your installation clears the bit, check whether the drive enable is being dropped (SS1 stop, STO, E-stop) during the manual mode transition.

What is the difference between MC_Home.Done and StatusWord.X5 HomingDone?

MC_Home.Done is a one-shot output of the MC_Home function block instance that pulses TRUE when the current homing call completes and falls when the next motion command is started. StatusWord.X5 (HomingDone) is a sticky bit on the technology object that stays TRUE until an explicit clearing event. Use StatusWord.X5 as the runtime guard for absolute moves; use MC_Home.Done only to detect the rising edge of a homing completion in the same cycle.

How do I keep HomingDone TRUE across a power cycle?

Use a multi-turn absolute encoder (EnDat 2.2, SSI absolute, or PROFIsafe encoder) and configure the technology object for absolute encoder homing. On CPU STOP to RUN, call MC_Home with Mode = 7 (absolute encoder adjustment) once. The bit then stays TRUE across power cycles as long as the encoder is referenced.

Which MC_Reset mode clears the HomingDone bit?

Modes 1, 2, and 3 of MC_Reset all clear the bit. Mode 1 ("Restart") is the lightest option and is appropriate when the application needs to force a re-homing without a full TO reload. Modes 2 and 3 also reset TO configuration parameters, so use them only when recovering from a corrupted axis state.

Why does HomingDone flash TRUE and FALSE during the homing run?

The technology object re-evaluates axis state on every OB servo cycle, so during a long homing travel the bit can pulse. The pulse is not a valid homed reference. Always combine the read with MC_Home.Busy = FALSE and MC_Home.Done = TRUE before treating the axis as homed for the rest of the program.

Back to blog