MC_HOME Mode 7: S210 Absolute Encoder Homing on S7-1200 G2

David Krause11 min read
Motion ControlSiemensTutorial / How-to
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

Setting up MC_HOME on a Siemens SINAMICS S210 servo drive controlled by a SIMATIC S7-1214C DC/DC/DC (G2 generation) requires the correct homing mode for the encoder type. When using absolute encoders, the homing operation is fundamentally different from incremental encoder workflows: the mechanical reference is already known at power-up, so the goal of MC_HOME is not to find a marker pulse, but to assign a meaningful position value to the current mechanical location.

This reference covers the configuration of MC_HOME Mode 7 (Absolute encoder adjustment, absolute), which is the recommended mode for commissioning an absolute encoder on an S210 and then adjusting the home position as a one-time or operator-driven calibration. The reference also explains why the Execute input and Done output of MC_HOME do not need to remain TRUE, why the DB instance cannot be marked Retain for the homing operation, and where to monitor the persistent homing state through the technology object's StatusWord.

The information applies to the Motion Control V4 instruction library used with S7-1200 G2 CPUs in TIA Portal V17 and later, and to S210 firmware V5.1 SP1 and newer connected over PROFINET IRT.

Prerequisites

  • Hardware: SIMATIC S7-1214C DC/DC/DC (G2) with sufficient work memory for Motion Control technology objects (minimum firmware V4.5 recommended for full Mode 7 functionality).
  • Drive: SINAMICS S210 with PROFINET IRT connection to the S7-1200, single-turn or multi-turn absolute encoder installed on the motor.
  • Software: TIA Portal V17 or later with the S7-1200 Motion Control V4+ HSP installed.
  • Configuration: Axis technology object (TO) created under Technology objects > Motion Control > TO_Axis_PTO or TO_SynchronousAxis, with the encoder data block linked to the S210 PROFINET telegram (Standard Telegram 3 or 5).
  • Online access: PG/PC with Ethernet connection to the S7-1200 for download and online monitoring of the TO.
Note: The DB instance for MC_HOME is typically generated automatically by TIA Portal when the FB is dropped onto a code block. The Retain property of that instance DB does not control homing persistence. Homing persistence is a function of the encoder type and the TO, not the instance DB.

MC_HOME Mode Reference

The MC_HOME instruction has eight operating modes that control how the axis reference position is established. Select the mode using the Mode input on the function block.

Mode Name Use Case Encoder Type
0 Direct homing absolute Set position immediately to the value of Position; no motion Any (but does not validate encoder)
1 Direct homing relative Shift current position by Position value; no motion Any
2 Passive homing Home using an external signal during motion Incremental
3 Active homing, positive direction Travel to home switch or limit Incremental
4 Active homing, negative direction Travel to home switch or limit Incremental
5 Active homing, encoder zero mark Home on encoder Z-pulse Incremental
6 Absolute encoder adjustment, relative Set home offset relative to current encoder value Absolute
7 Absolute encoder adjustment, absolute Set current position to the absolute value of Position Absolute

Per the official Siemens MC_Home V4 documentation, Modes 6 and 7 require that the absolute encoder has been successfully referenced (the encoder's internal position is valid and the controller has acknowledged it). After a controller restart, the absolute encoder position is re-read and the axis traverses to the configured home position automatically once the TO is restarted.

Why Mode 7 is the Correct Choice

With an absolute encoder, the mechanical position is preserved across power cycles by the encoder's internal non-volatile memory. The job of MC_HOME is therefore to assign a user-defined coordinate value to that physical location, not to physically seek a home switch.

Mode 7 (Absolute encoder adjustment, absolute) performs this assignment directly: when Execute sees a rising edge, the current actual position of the axis is overwritten with the value present at the Position input. The axis does not move, and no external reference is required. Mode 6 is similar but interprets Position as a relative offset from the current encoder value rather than an absolute value.

Mode 0 (Direct homing absolute) also sets the position without motion, but it does not perform the encoder adjustment handshake that aligns the TO with the absolute encoder protocol. On absolute encoder systems Mode 0 can cause a one-time power-up step where motion is blocked until MC_HOME is executed, whereas Mode 7 leaves the absolute position valid on the first TO startup after a power cycle.

Configuring MC_HOME Mode 7 in TIA Portal

  1. Open the technology object in the project tree: Technology objects > [Axis] > Configuration.
  2. Encoder: In the Encoder section confirm Encoder type = Absolute and that the Data block field points to the S210 PROFINET encoder interface DB.
  3. Homing configuration: Under Extended parameters > Homing verify that Permit absolute encoder adjustment at runtime is enabled. This is required for Modes 6 and 7 to be selectable on the MC_HOME instance.
  4. Position value: In the Homing section set the default Position value (LU units) to the desired coordinate at the current mechanical position. Typical default is 0.0.
  5. Direction: Per the Siemens absolute encoder adjustment reference, configure Absolute homing direction to match the desired positive travel direction. This only matters if the axis must travel on first restart; for Mode 7 with no travel it is informational.
  6. Insert the instruction: In the program block (typically OB1), insert Instructions > Motion Control > MC_HOME (V4 variant). An instance DB is auto-generated.
  7. Wire inputs:
    • Execute: Boolean tag, momentary or sustained.
    • Position: LREAL tag containing the target coordinate (e.g., Axis_HomePos).
    • Mode: Set to 7 constant or HMI tag.
  8. Wire outputs to the HMI or SCADA: Done, Busy, CommandAborted, Error, ErrorID.
  9. Compile and download the program and the technology object to the S7-1200.

HomingDone Bit and Why Execute Does Not Need to Stay TRUE

The most common misconception when commissioning MC_HOME is that the Execute input must remain TRUE for the home position to be valid. This is incorrect. MC_HOME is an edge-triggered instruction: it performs its action on a rising edge of Execute and sets Done for one PLC cycle upon successful completion.

Persistent state is held in the Technology Object, not in the instruction instance. The relevant status flag is:

  • <TO>.StatusWord.%X5 (HomingDone) – TRUE once the axis has been successfully homed at least once since TO download.

For an absolute encoder, HomingDone remains TRUE across CPU STOP/RUN transitions, program reloads (as long as the TO itself is not re-downloaded), and power cycles. The TO re-validates the absolute encoder position on startup, and motion commands such as MC_MOVEABSOLUTE, MC_MOVEVELOCITY, and MC_MOVERELATIVE are permitted without re-executing MC_HOME.

The Position Tag and Retain Behavior

The Position input on MC_HOME is the coordinate that will be assigned to the current mechanical location when Mode 7 executes. Common implementation patterns:

Use Case Storage of Position Behavior Across Power Cycle
Fixed home at machine reference Global constant or hardcoded LREAL Persists (constant in program)
Operator-adjustable home Tag in a retain DB (HMI-writeable) Persists if DB is Retain
Recipe-driven home Recipe data block loaded on machine change Persists as part of recipe

To make the Position value survive a power cycle, store it in a global data block with the Retain attribute enabled. The instance DB of the MC_HOME call does not need to be retain; the actual home position lives in the TO and the encoder.

Note: If the TO itself is downloaded again (right-click → Download to device → Software (entire) with technology objects), the TO is reset and HomingDone will fall. The absolute encoder position in the motor is unaffected, but the TO will reinitialize and may report the axis as not homed until MC_HOME Mode 7 is executed once. In normal operation, program changes (FC/FB/OB) do not reset the TO.

Operator Workflow for Home Adjustment

Mode 7 supports occasional readjustment of the home position without re-running a full homing travel. Typical operator flow on a WinCC Unified or Comfort Panel:

  1. Jog the axis to the desired physical reference point using MC_MOVEVELOCITY or manual jog from the S210 web server.
  2. Confirm the axis is at standstill (<TO>.StatusWord.%X0 (Standstill) = TRUE).
  3. Enter the new coordinate value in an HMI input field bound to the Position tag of the MC_HOME call.
  4. Press the Set Home button on the HMI — this sets Execute TRUE for one scan (or until Done).
  5. Verify the actual position on the HMI now matches the entered value.
  6. Optionally persist the new value to a retain DB by writing it back from the HMI on confirmation.

Verification Procedure

After configuration, validate the implementation with the following sequence:

  1. Power the S210 and S7-1200 from a cold start. Wait for the S210 PROFINET connection to come up (no SF/BF errors on the drive).
  2. Open the TO online in TIA Portal. Confirm StatusWord.%X5 (HomingDone) = TRUE without any prior MC_HOME execution (validates the absolute encoder path).
  3. Execute MC_MOVEABSOLUTE to a known safe position. Confirm the axis moves to the expected coordinate.
  4. Cycle power to the S7-1200 only (drive remains powered). Repeat step 3 after restart.
  5. Execute MC_HOME Mode 7 with Position = 0.0. Confirm Done pulses, Error = FALSE, and the actual position reads 0.0.
  6. Re-execute MC_MOVEABSOLUTE to a positive and negative coordinate. Verify motion is permitted immediately after the homing pulse.

Troubleshooting Matrix

Symptom Likely Root Cause Diagnostic Corrective Action
MC_MOVEABSOLUTE refuses to execute after power cycle TO not flagged as homed; encoder not registered as absolute Check StatusWord.%X5 and encoder configuration in TO Verify Encoder type = Absolute; check Permit absolute encoder adjustment at runtime; re-execute MC_HOME Mode 7
Done never sets, Error = TRUE on MC_HOME Mode 7 Encoder not ready; PROFINET not in sync; Position out of software limit Inspect ErrorID on the FB Wait for encoder ready bit; check PROFINET diagnostics; confirm Position is inside SW limits
Home position lost after every program download TO was downloaded, resetting HomingDone Watch StatusWord.%X5 fall on download Download program only (FC/FB/OB) without TO; reserve TO download for commissioning
DB does not allow Retain selection Instance DB of a system FB; not user-configurable Open DB properties Place the writable Position in a separate global retain DB; leave the instance DB as non-retain
Axis drifts on first move after restart Encoder single-turn with position lost in transit Check encoder revolutions during power-down Use multi-turn encoder; verify battery on S210 if applicable
MC_HOME Mode 0 works but Mode 7 returns error 16#8001 (Invalid mode for encoder type) TO encoder configuration not set to Absolute TO Configuration → Encoder → Encoder type Change encoder type to Absolute and redownload TO

Common ErrorID Values for MC_HOME

ErrorID (Hex) Meaning Remediation
16#8001 Invalid mode for current encoder type Use Mode 6/7 for absolute encoders
16#8002 Axis not enabled Enable axis with MC_Power before MC_HOME
16#8007 Encoder not ready / no valid absolute position Check encoder wiring, PROFINET telegram, encoder battery
16#8011 Homing direction invalid Reconfigure Absolute homing direction
16#8022 Position outside software limits Adjust Position input to be within configured SW limits

Sample Ladder Logic Snippet

// Network 1: Enable axis
CALL "MC_Power_DB"  // MC_Power instance
      Axis := "Axis_1",
      Enable := TRUE,
      EnablePositive := TRUE,
      EnableNegative := TRUE

// Network 2: Set Home (Mode 7) on operator request
      "HMI_SetHome_Cmd"  // momentary button from HMI
      MC_HOME_DB         // MC_Home instance
      Axis               := "Axis_1",
      Execute            := "HMI_SetHome_Cmd",
      Position           := "Axis_HomePos",     // LREAL, retainable
      Mode               := 7,
      Done               => "Axis_Home_Done",
      Busy               => "Axis_Home_Busy",
      Error              => "Axis_Home_Err",
      ErrorID            => "Axis_Home_ErrID"

// Network 3: Guard motion commands on HomingDone
A     "Axis_1".StatusWord.%X5    // HomingDone bit
      "Allow_Move"                // permissive tag

Integration with S210 Telegram Mapping

Confirm the S210 is configured to use Standard Telegram 3 (Position actual value 32-bit) or Standard Telegram 5 (Position + velocity, 64-bit position). The encoder interface in the TO must point to the corresponding input address of the S210. If the telegram mismatches, the TO will report encoder errors and MC_HOME Mode 7 will fail with 16#8007.

Safety: Always run the first Mode 7 execution with the axis in a safe, supported configuration. Although Mode 7 does not cause motion, the resulting actual position becomes the reference for all subsequent absolute moves. Any error in the Position value is reflected in every future MC_MOVEABSOLUTE command.

FAQ

Does the MC_HOME Execute input need to remain TRUE for homing to persist on an S210 with an absolute encoder?

No. MC_HOME is edge-triggered. Once Mode 7 has set the position successfully, the technology object records the state in StatusWord.%X5 (HomingDone), which remains TRUE across power cycles and program downloads of the application code (provided the TO itself is not re-downloaded).

Why can the MC_HOME instance DB not be marked as Retain in TIA Portal?

Instance DBs generated for system motion control FBs are managed by the S7-1200 Motion Control library and do not expose the Retain attribute. The persistent home data lives in the technology object and the absolute encoder. Store any user-writable Position value in a separate global DB that you mark as Retain.

Which MC_HOME mode should I choose for an S210 with a multi-turn absolute encoder?

Use Mode 7 (Absolute encoder adjustment, absolute) for commissioning and operator-driven readjustment. Mode 0 (Direct homing absolute) is acceptable for a one-time setup but does not perform the same encoder handshake and can require MC_HOME after every power cycle.

What does HomingDone in the TO StatusWord indicate?

Bit 5 of the TO StatusWord is the HomingDone flag. It is TRUE after a successful homing operation and is the recommended permissive tag for motion commands. For absolute encoders, it should be TRUE on first TO startup without any MC_HOME execution.

My axis loses its home position every time I download to the PLC. Why?

The technology object is being re-downloaded, which resets the internal homing state. Download only the program blocks (OB/FC/FB/DB) and avoid including the TO in the download. The TO should only be downloaded during commissioning or a TO configuration change.

Back to blog