Managing I/O Faults on S7-1200 with GETIO/SETIO and OB86

David Krause21 min read
S7-1200SiemensTutorial / 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: I/O Fault Management on the S7-1200

When migrating a Profibus drive-control application from an S7-300 to an S7-1200, the I/O fault-handling strategy must be reworked. The S7-300's familiar DPRD_DAT and DPWR_DAT instructions that move entire consistent Profibus telegrams from a drive (for example, an ABB ACS / DCS-series Profibus adapter on an ET200S station) are not directly user-callable on the S7-1200 in the same way. The replacement approach is:

  1. Install a Profibus master communications module (CM 1243-5, 6GK7243-5DX30-0XE0) on the S7-1200 to keep existing ET200S stations or Profibus drives wired in.
  2. Disable the automatic peripheral-to-process-image update on the affected input and output ranges so the user program can decide what to do with the data.
  3. Read the consistent telegram in a cyclic OB using the GETIO instruction (which internally calls DPRD_DAT) and write to the drive using SETIO (which internally calls DPWR_DAT).
  4. Check the STATUS output of every GETIO/SETIO call and treat any non-zero value as bad data; this avoids the data-consistency window that an OB86 race can introduce.
  5. Add an OB86 fault routine as a safety net to clear diagnostic events, prevent CPU STOP on rack/slave failure, and force peripheral-data bad flags.

The advantage of this approach: it decouples the data-consistency check from the interrupt-driven OB86 model. OB86 runs at priority class 26 and can interrupt OB1 mid-cycle. If your control logic only reads a "data is good" flag set by OB86, you can read stale good-flag state with bad data (or vice-versa) for at least one OB1 scan. The GETIO/SETIO model removes that race entirely.

Note on scope: This article addresses Profibus DP master scenarios using the CM 1243-5. For PROFINET IO scenarios, the equivalent instructions are GETIO / SETIO on PROFINET IO devices with appropriate submodule configuration, and the OB86 fault IDs shift to the 04/05/0A/0B/0C/0D range. The OB86 logic below covers both Profibus and PROFINET cases. The S7-1200 system manual is available on the Siemens Industry Online Support portal.

Prerequisites

Item Required Notes
S7-1200 CPU Firmware V4.2 or later GETIO/SETIO instructions are present in the instruction catalog from V4.2 onwards. Earlier firmware does not expose them. CPU 1212C, 1214C, 1215C, 1217C are all supported.
TIA Portal V15.1 or later Use V16+ for best Profibus GSD import behaviour. V17 and V18 are recommended for new projects.
CM 1243-5 (Profibus DP master) 6GK7243-5DX30-0XE0 One per S7-1200. CM 1242-5 (slave) is a different module and cannot be used as DP master.
ET200S Profibus slave IM151-1 (6ES7151-1AA06-0AB0) or later Existing field stations are kept; only the master is replaced.
ABB drive Profibus adapter RPBA-01, NPBA-12, or vendor-specific module Telegram length is typically 4, 12, 20, or 24 bytes depending on PPO type.
GSD file for the ABB drive Vendor-supplied (e.g., ABB_0812.GSD) Import into TIA Portal under Options > Manage general station description files (GSD).
S7-PLCSIM (TIA-bundled) V16 or later Required for offline validation. PLCSIM V15 and earlier do not fully support S7-1200.
S7ProSimLib or NetToPLCSIM Third-party .NET / TCP gateway For the plant-simulator over Ethernet path described in the PLCSim section.

Hardware and Profibus Topology

The S7-1200 has no integrated Profibus interface, so the CM 1243-5 is mandatory for any Profibus DP master application. The module plugs into the left side of the CPU alongside signal modules and is addressed as a Profibus master at the configured node address (default 2, configurable in TIA Portal under the CM's properties > Profibus interface > Address). The CM occupies one slot in the S7-1200's signal board / module expansion area and counts against the CPU's maximum module count.

Wiring follows the standard Profibus DP conventions: shielded twisted-pair Profibus cable (typically violet) with bus terminators enabled at both ends of the segment. Maximum segment length depends on baud rate (1200 m at 9.6 kbps, 100 m at 12 Mbps). For multi-segment networks, repeaters are required.

S7-1200 CPU 1215C FW 4.2+ CM 1243-5 DP Master Profibus DP violet cable ET200S IM151-1 Profibus Addr 3 ABB ACS Drive RPBA-01, Addr 4 I/O Mapping %IB100..%IB111 %QB100..%QB111

In TIA Portal, after adding the CM, configure the Profibus network, set the master address, and drag the ABB drive's GSD device into the topology. The Profibus slave address of the drive determines the start address of its I/O area in the CPU. Typical configuration: ABB drive at Profibus address 4 occupies input bytes 100..111 (%IB100..%IB111) and output bytes 100..111 (%QB100..%QB111) when mapped via the CM 1243-5. The I/O area can be 4, 12, 20, or 24 bytes depending on the PPO type selected in the drive's configuration (covered in the worked example below).

Disabling Automatic Process Image Updates

For consistent data transfer (a whole Profibus telegram moved atomically), the standard automatic copy from the peripheral area to the process image must be disabled on the affected address range. The S7-1200 system manual describes this as removing the address from the "automatic process-image update" list, which the manual treats as a prerequisite for DPRD_DAT/DPWR_DAT usage.

In TIA Portal:

  1. Open the device view of the S7-1200 CPU.
  2. Select the CM 1243-5 or the slave's I/O area in the device configuration.
  3. In Properties > I/O addresses, uncheck "Automatic update of process image" (or "Process image: automatic", depending on TIA version) for the input range that the drive occupies.
  4. Repeat for the output range.

After this change, the CPU will not refresh the process image for that range automatically. The peripheral area (%I100:P) holds the most recent peripheral read and is updated by the next GETIO call. The standard process image (%I100) is updated only by your explicit program logic.

Important: every time the program is restarted or downloaded, the process image for the affected range is not initialised from the peripheral. Your first OB1 cycle must execute GETIO (or copy a safe default, e.g., all-zeros, to the image) before any logic depends on those addresses. Skipping this step can cause one scan of "all zero" data to propagate to the controlled process.

GETIO and SETIO Instructions

GETIO and SETIO are the S7-1200 / S7-1500 wrappers around DPRD_DAT and DPWR_DAT. They are the recommended way to access consistent data on distributed I/O without disabling the entire process image for unrelated inputs. The S7-1200 system manual lists them in the "Distributed I/O" instruction group and notes that the underlying DPRD_DAT/DPWR_DAT are still compiled into the program, so the on-wire behaviour is identical.

Block Interface (LAD / FBD)

Parameter Declaration Type Description
LADDR INPUT WORD Logical base address of the I/O range. For an ABB drive at Profibus addr 4 mapped to %IB100, set LADDR := W#16#64 (decimal 100).
SLOT INPUT BYTE Slot number on the slave. Default 0 for head station. For modular slaves, set the slot of the relevant submodule.
RECORD IN_OUT VARIANT Destination (GETIO) or source (SETIO) buffer. Size in bytes must match the configured I/O length.
STATUS OUTPUT WORD Return code (see table below).

GETIO / SETIO Return Codes

STATUS (hex) Meaning Recommended action
0000 No error; RECORD contains valid process data. Use the data.
8090 Specified logical base address invalid (slave not configured, or wrong LADDR). Verify HW config; recompile and re-download.
8092 RECORD variant type does not match (e.g., BOOL where BYTE expected). Match RECORD type to the slave's I/O layout.
8093 LADDR refers to an output for GETIO or an input for SETIO. Swap to the correct instruction or correct address.
80A0 Negative acknowledgement from module (read access rejected). Slave is busy or denied the read; retry next cycle.
80A1 Negative acknowledgement from module (write access rejected). Slave is busy or denied the write; retry next cycle.
80B0 Module fault; data is not valid. Treat as bad; OB86 will fire in parallel.
80B1 Specified RECORD length is invalid or exceeds the configured length. Match RECORD length to the slave's I/O length.
80C0 Data consistency loss; data is not valid. Treat as bad; do not process.
80C1 Specified length of the write data invalid. Reduce write length to match the slave's output length.
80D0 / 80D1 System error; firmware-level. Re-initialise the CM; if persistent, replace.
80E0 I/O not configured at this LADDR. HW config error; re-import GSD.
80E1 I/O currently being updated; try again. Retry next cycle.
80F0 Internal firmware error. Power-cycle; if persistent, contact Siemens support.
80F1 I/O has been removed; data not valid. Slave is missing; treat as bad; OB86 will fire.

Any non-zero STATUS must be treated as "data is bad" by the application. The recommended pattern is to set a bad-data flag and skip processing of that range for the cycle.

Ladder Sample

      +--------+
--[EN]-+ GETIO  +---ENO--
      |        |
      | LADDR  |---W#16#64   // decimal 100
      | SLOT   |---B#16#0
      | RECORD |---P#DB100.DBX0.0 BYTE 11
      | STATUS |---%MW200
      +--------+

ST/SCL Sample (Cyclic OB1 Read and Write)

// Cyclic read of the ABB drive input telegram
IF "sim_mode" = FALSE THEN
    "drive_getio_status" := GETIO(LADDR  := 16#0064,    // 100 decimal
                                  SLOT   := 16#00,
                                  RECORD := "drive_in_buffer",
                                  STATUS => "drive_status");
    IF "drive_getio_status" = 0 THEN
        "drive_data_ok" := TRUE;
    ELSE
        "drive_data_ok" := FALSE;
        "drive_fault_id" := "drive_status";
    END_IF;
ELSE
    // PLCSIM mode: copy simulated input from the plant simulator DB
    "drive_in_buffer" := "sim_drive_in";
    "drive_data_ok"   := "sim_drive_data_ok";
END_IF;

SETIO is invoked the same way, but RECORD is the source buffer (your output telegram) and the data is written atomically to the peripheral. Use it for control words, setpoints, and reference values:

// Cyclic write of the ABB drive output telegram
IF "sim_mode" = FALSE THEN
    "drive_setio_status" := SETIO(LADDR  := 16#0064,
                                  SLOT   := 16#00,
                                  RECORD := "drive_out_buffer",
                                  STATUS => "drive_status_out");
    "drive_write_ok" := ("drive_setio_status" = 0);
ELSE
    "sim_drive_out" := "drive_out_buffer";
    "drive_write_ok" := TRUE;
END_IF;

OB86: Rack and Station Failure

OB86 is the S7-1200 / S7-1500 organisation block for rack failure, distributed I/O failure, and PROFINET IO station failure events. It is required if you want the CPU to remain in RUN when a Profibus slave drops off the network. Without OB86, a slave failure causes a diagnostic interrupt that the CPU cannot service and the CPU goes to STOP.

OB86 Temporary (Local) Variables

Variable Type Description
OB86_EV_CLASS BYTE Event class. B#16#38 = incoming event (failure just detected). B#16#39 = outgoing event (failure cleared).
OB86_FLT_ID BYTE Fault ID. See the table below.
OB86_PRIORITY BYTE Priority class (typically 26 in default configuration).
OB86_OB_NUMBR BYTE OB number (86).
OB86_RESERVED_1 BYTE Reserved.
OB86_RESERVED_2 WORD Reserved.
OB86_MDL_ADDR WORD Logical base address of the affected module.
OB86_Z23 WORD / DWORD Subfield depending on FLT_ID (rack number, slave address, slot, subslot, channel).
OB86_DATE_TIME DATE_AND_TIME Time stamp of the event.
Note on EV_CLASS semantics: the values B#16#38 (incoming) and B#16#39 (outgoing) are the standard Siemens definitions. Incoming (38) means a new fault has just been detected by the CPU; outgoing (39) means the fault condition has cleared. Treat the incoming event as "data is now bad" and the outgoing event as "data may now be valid, but verify with GETIO before trusting it". Some field documentation reverses these labels; the system manual's definition is the canonical one.

OB86_FLT_ID Values (subset relevant to S7-1200)

FLT_ID (hex) Meaning Direction
01 Rack failure (central) Incoming
02 Distributed I/O slave failure (Profibus DP station failure) Incoming
03 Channel fault on a digital/analog module Incoming
04 PROFINET IO station failure Incoming
05 PROFINET IO station return Outgoing
06 Rack return Outgoing
07 Distributed I/O slave return Outgoing
08 Channel fault cleared Outgoing
0A PROFINET IO submodule error Incoming
0B PROFINET IO submodule error cleared Outgoing
0C PROFINET IO submodule slot error Incoming
0D PROFINET IO submodule slot error cleared Outgoing
0E H system (redundant) failure Incoming
0F H system return Outgoing
10 Interface (e.g., CM 1243-5) failure Incoming
11 Interface return Outgoing

For the ABB drive scenario, expect FLT_ID = 02 (slave failure) when the drive drops off, and FLT_ID = 07 (slave return) when it comes back. The OB86_MDL_ADDR field will hold the logical base address of the failed station — in the typical mapping above, this is 100 (W#16#64) for the ABB drive at Profibus address 4.

OB86 Sample Code (SCL)

// OB86: Rack / Slave / Profibus station failure and return
// Purpose: mark drive data bad on slave failure, clear flag on return
// Note: this is a SAFETY NET. Primary data validity is checked
//       from GETIO.STATUS in OB1.

IF #OB86_EV_CLASS = B#16#38 THEN
    // Incoming event - a new fault has been detected
    CASE #OB86_FLT_ID OF
        B#16#02:  // Distributed I/O slave (Profibus DP) failure
            IF #OB86_MDL_ADDR = W#16#64 THEN
                "drive_comm_fault" := TRUE;
                "drive_data_ok"    := FALSE;
                "drive_fault_id"   := 16#0002;
            END_IF;
        B#16#10:  // CM 1243-5 interface failure
            "cm1243_5_fault" := TRUE;
            "drive_data_ok"  := FALSE;
        B#16#01:  // Central rack failure (less common on S7-1200)
            "rack_fault" := TRUE;
        ELSE
            "last_ob86_fault" := #OB86_FLT_ID;
    END_CASE;
ELSIF #OB86_EV_CLASS = B#16#39 THEN
    // Outgoing event - the fault has cleared
    CASE #OB86_FLT_ID OF
        B#16#07:  // Distributed I/O slave return
            IF #OB86_MDL_ADDR = W#16#64 THEN
                "drive_comm_fault" := FALSE;
                // Do NOT set "drive_data_ok" = TRUE here.
                // Let the next OB1 GETIO confirm data is good.
            END_IF;
        B#16#11:  // CM 1243-5 interface return
            "cm1243_5_fault" := FALSE;
        B#16#06:  // Rack return
            "rack_fault" := FALSE;
        ELSE
            ;
    END_CASE;
END_IF;

OB86 Interrupt Behaviour

OB86 is an interrupt OB at priority class 26. It can interrupt OB1 (priority class 1). The risk is that if your only data-validity mechanism is "set a bit in OB86, read it in OB1", you may read the bit one cycle too early or too late. The S7-1200 system manual recommends DPRD_DAT/DPWR_DAT (and by extension GETIO/SETIO) for applications that need a single consistent read with validity status returned synchronously.

The recommended pattern is therefore:

  • OB1 uses GETIO/SETIO and checks STATUS for every cycle. This is the primary data-validity check.
  • OB86 exists only to keep the CPU in RUN, log the event, and update a "last comm fault" diagnostic word. Do not make the safety logic depend on OB86 flag toggles.

Data Consistency Considerations

When OB86 fires for a slave failure, the CPU does not propagate the failure to your control logic until your next read. If your OB1 reads the process image (%I100 rather than %I100:P) and the image still contains the last good read, you can act on stale data. The window is short (one OB1 scan), but in motion or safety-related code it is significant.

GETIO reads the peripheral area directly and atomically. If the read fails, STATUS is non-zero and the data in RECORD is marked invalid. The instruction either returns a good read or a non-zero status — never a half-update. This is the property that DPRD_DAT had on the S7-300 and the property the S7-1200's GETIO preserves.

The key configuration that makes this work: the address range must be removed from the automatic process-image update, so the standard OB1 cycle does not silently overwrite your last GETIO result with stale peripheral data.

A second consideration: the use of MOVE_BLK_VARIANT to copy the consistent data from %I100:P to %I100 does not preserve consistency on its own. The MOVE_BLK_VARIANT instruction copies one element at a time and can be interrupted by OB86 mid-copy, leaving the process image in a partially-updated state. DPRD_DAT/GETIO are the only instructions on the S7-300/1200 that guarantee an atomic copy of the entire consistent data range.

PLCSim Integration Strategy

S7-1200 PLCSIM (in TIA Portal V16+) does not allow the user to write to the process input area (%I); writes from the simulation are immediately overwritten by the cyclic peripheral-to-process-image update. This makes it difficult to integrate an external plant simulator that needs to inject sensor values into the simulated PLC's inputs.

The workaround is:

  1. Disable the automatic process image update on the simulated input ranges (same as the real PLC).
  2. In the plant simulator (e.g., a C# application using S7ProSimLib or a TCP-based NetToPLCSIM connection), write directly to a DB that the PLC code is reading conditionally.
  3. In the PLC code, use a runtime flag (set by the simulator) to switch between GETIO/SETIO (real PLC) and direct DB read/write (PLCSIM mode).

The decision flag can be a single bit in a known DB:

  • In real PLC: sim_mode := FALSE. Code uses GETIO/SETIO.
  • In PLCSIM: sim_mode := TRUE. Code reads drive input from a simulated DB written by the plant simulator, writes drive output to the same DB; the plant simulator consumes the output and updates the input DB on the next cycle.

This pattern lets a single TIA project run on both PLCSIM and the real PLC without conditional code paths for the I/O calls themselves, only for the source/destination of the data.

NetToPLCSIM acts as a TCP-to-PLCSIM gateway and runs as a small Windows service. It exposes PLCSIM on a TCP port so the plant simulator can connect over standard Ethernet without needing the S7ProSimLib's in-process API. For a simple architecture: PLCSIM runs on the engineering PC, NetToPLCSIM exposes it on TCP port 102, the plant simulator (also on the engineering PC or on a separate machine) connects via S7 client calls to read the simulated outputs and write the simulated inputs. The PLC code, in PLCSIM mode, sees the DB updates from the simulator and never calls GETIO/SETIO.

ABB Drive PPO Configuration and Worked Example

Most ABB drives (ACS800, ACS550, ACS355 with RPBA-01, ACS880 with NPBA-12) use a Profibus profile called PPO (Parameter/Process Data Object). PPO types are:

PPO Type PKW (parameter) words PZD (process data) words Total input/output length
1 4 2 8 words / 16 bytes
2 4 6 10 words / 20 bytes
3 0 2 2 words / 4 bytes
4 0 6 6 words / 12 bytes
5 0 10 10 words / 20 bytes
6 0 12 12 words / 24 bytes
7 4 10 14 words / 28 bytes

For a 1-word control word + 1-word setpoint and 1-word status word + 1-word actual value, PPO 3 is the minimum. For full diagnostics with 6 PZD words each direction, PPO 4 is common. PPO 5 and 6 are used for ABB drives with extended status/control word sets and fieldbus adapter parameter access.

Configure the PPO type on the drive (drive parameter group 51 / 52 typically, depending on the drive family) to match the GSD selection in TIA Portal. The PPO type drives both the telegram length on the wire and the mapping of the I/O words in the PLC's address space.

Worked example: PPO 4, 12 bytes I/O, ABB drive at Profibus address 4 mapped to %IB100..%IB111 and %QB100..%QB111.

// Data block "drive_data"
// Drive input (from drive to PLC)
"drive_in_buffer".status_word      AT %IB100 : WORD;  // ABB status word
"drive_in_buffer".actual_speed     AT %IB102 : WORD;  // Actual speed (scaled)
"drive_in_buffer".output_freq      AT %IB104 : WORD;  // Output frequency
"drive_in_buffer".motor_current    AT %IB106 : WORD;  // Motor current
"drive_in_buffer".dc_bus_voltage   AT %IB108 : WORD;  // DC bus voltage
"drive_in_buffer".fault_word_1     AT %IB110 : WORD;  // Fault / alarm word

// Drive output (from PLC to drive)
"drive_out_buffer".control_word    AT %QB100 : WORD;  // ABB control word
"drive_out_buffer".speed_ref       AT %QB102 : WORD;  // Speed reference
"drive_out_buffer".reserved_1      AT %QB104 : WORD;  // Reserved
"drive_out_buffer".reserved_2      AT %QB106 : WORD;  // Reserved
"drive_out_buffer".reserved_3      AT %QB108 : WORD;  // Reserved
"drive_out_buffer".reserved_4      AT %QB110 : WORD;  // Reserved

In OB1, the read and write sequence is:

// OB1: cyclic drive I/O
IF "sim_mode" = FALSE THEN
    // Read 12 bytes from drive peripheral
    "drive_getio_status" := GETIO(LADDR  := 16#0064,
                                  SLOT   := 16#00,
                                  RECORD := "drive_in_buffer",
                                  STATUS => "drive_status");
    "drive_data_ok" := ("drive_getio_status" = 0);
    
    // Process control logic
    IF "drive_data_ok" THEN
        "drive_out_buffer".control_word := "control_word_calc";
        "drive_out_buffer".speed_ref    := "speed_ref_calc";
    ELSE
        // Fault path: command drive to safe state
        "drive_out_buffer".control_word := 16#0000;  // OFF1 stop
        "drive_out_buffer".speed_ref    := 0;
    END_IF;
    
    // Write 12 bytes to drive peripheral
    "drive_setio_status" := SETIO(LADDR  := 16#0064,
                                  SLOT   := 16#00,
                                  RECORD := "drive_out_buffer",
                                  STATUS => "drive_status_out");
END_IF;

The control_word_calc is the result of the drive state-machine logic, which uses status_word to determine the current drive state. Common ABB control word transitions: 16#0006 = OFF1 stop, 16#0007 = OFF2 stop (coast), 16#000F = run enable, 16#047F = run with ramp, 16#04FF = fault reset (rising edge). Common status word values: 16#0000 = not ready, 16#0347 = ready, 16#0237 = running, 16#0F37 = fault active.

Verification, Commissioning, and Troubleshooting

Use this checklist when validating the migration:

  1. Hardware: CM 1243-5 is detected in TIA Portal, online diagnostics show it as OK (green). The CM's BF (bus fault) LED must be off and the RUN LED must be green.
  2. Profibus: All slaves (IM151, ABB drive) appear with green status in the online diagnostics. Use "Online > Online and diagnostics" on the CM, then the "Profibus diagnostics" buffer, to verify bus health.
  3. GSD: ABB drive GSD is imported; PPO type matches the drive configuration; I/O length matches (e.g., 12 bytes for PPO 4).
  4. Process image: Automatic update is disabled for the affected input and output ranges.
  5. GETIO / SETIO instructions return STATUS = 0 under steady-state conditions. Verify with a watch table on drive_status and drive_status_out.
  6. OB86 is present in the project and the project downloads without the "OB86 missing" warning.
  7. Force a slave failure: pull the Profibus connector from the IM151. CPU remains in RUN. OB86 fires with FLT_ID = 02, EV_CLASS = 38, MDL_ADDR = 100. STATUS of the next GETIO call is non-zero (e.g., 80B0 or 80F1). drive_data_ok flag is FALSE in both OB86 and OB1.
  8. Reconnect the slave. OB86 fires with FLT_ID = 07, EV_CLASS = 39. The next GETIO returns STATUS = 0. drive_data_ok returns to TRUE.
  9. PLCSIM: project runs offline. Plant simulator can drive the simulated drive state machine. sim_mode flag is set. GETIO/SETIO are not called in simulation mode (or are called and the simulator intercepts the result).
  10. HMI: KTP700 shows the "drive comm fault" diagnostic and the last-known good status when the Profibus is broken. The bad-data flag must be visible to the HMI for operator diagnostics.

Troubleshooting Matrix

Symptom Likely cause Diagnostic step Fix
GETIO.STATUS = 8090 LADDR does not match HW config; slave not configured or wrong address Check the I/O addresses in device configuration of the CM 1243-5; recompile and re-download Correct LADDR or fix HW config
GETIO.STATUS = 80B0 and OB86 does not fire Module-level fault, not a station-level fault Check the slave's channel diagnostics; verify the drive is powered and responding on the bus Fix the slave or its power supply
CPU goes to STOP on slave failure OB86 is missing from the project Check the project for an OB86 block under Program blocks Add OB86 and re-download
OB86 fires with FLT_ID = 10 (CM 1243-5 interface failure) CM 1243-5 has lost its Profibus connection or has a hardware fault Check CM LEDs; check Profibus cable; try a known-good slave Replace cable, connector, or CM module
GETIO.STATUS = 80C0 (consistency loss) MOVE_BLK_VARIANT was used to copy peripheral to image; data torn by interrupt Search project for MOVE_BLK instructions targeting the affected range Replace MOVE_BLK_VARIANT with GETIO
OB86 fires but GETIO.STATUS = 0 Race between OB86 clearing the flag and the next GETIO reading good data This is expected during recovery; do not rely on flag-only validity Trust GETIO.STATUS; treat OB86 as informational
PLCSIM writes to %I100 are immediately overwritten Automatic process image update is still enabled Check device configuration > I/O addresses Disable automatic process image update for the affected range
KTP700 displays all values as zero GETIO not called in OB1, or RECORD is the wrong variant type Watch table on drive_getio_status and drive_in_buffer Add GETIO to OB1; verify RECORD is a BYTE array of correct length
Drive does not respond to control words PPO type mismatch between drive parameter and PLC configuration Check drive parameter group 51/52 and compare to TIA Portal GSD selection Align PPO type on both sides
OB86 fires repeatedly on each cycle Slave is on the bus but is not communicating (e.g., wrong Profibus address) Check Profibus address on the drive's display or RPBA-01 DIP switches Set the correct address; cycle power to the drive

Fault Handling State Diagram

Power-on OB1 cycle 0 GETIO called STATUS -> %MW200 Data BAD drive_data_ok=FALSE drive -> safe state Data GOOD drive_data_ok=TRUE process drive STATUS <> 0 STATUS = 0 OB86: FLT_ID=07, EV=39 (parallel) loop

Frequently Asked Questions

Why does DPRD_DAT not work the same way on the S7-1200 as on the S7-300?

The S7-1200 instruction catalog exposes GETIO and SETIO (which internally call DPRD_DAT and DPWR_DAT) as the primary interface for consistent distributed I/O access. DPRD_DAT/DPWR_DAT are still present in the compiled code, but the user-callable wrapper is GETIO/SETIO. Behaviour is equivalent to S7-300 when the address range is removed from the automatic process-image update.

Do I need both GETIO and OB86?

Yes, but for different reasons. OB86 prevents the CPU from going to STOP when a slave fails; without it, a Profibus drop will halt the CPU. GETIO is the actual data-validity check used by your application code. OB86 is a safety net, not the primary mechanism.

What is the priority class of OB86 and can it interrupt OB1?

OB86 runs at priority class 26 in the default configuration. It can interrupt OB1 (priority class 1). This is why checking only an "OB86 set" flag from OB1 is unsafe — your read can race the interrupt. Use GETIO.STATUS for the application-level data-validity check.

Which CM module do I need for Profibus DP master on the S7-1200?

The CM 1243-5 (Siemens part number 6GK7243-5DX30-0XE0). The CM 1242-5 is a slave module and cannot act as DP master. The CM 1243-5 is supported on S7-1200 CPUs with firmware V4.x or later, configured under the CM's properties in the TIA Portal device view.

How do I keep the same TIA project running on PLCSIM and the real PLC?

Disable the automatic process image update on the affected ranges, then use a runtime sim_mode flag to switch between GETIO/SETIO (real PLC) and direct DB read/write (PLCSIM). The plant simulator writes/reads the simulation DB through S7ProSimLib (in-process) or NetToPLCSIM (TCP gateway on port 102). The single TIA project source compiles for both targets unchanged.

What STATUS value from GETIO indicates the slave is gone vs. just briefly busy?

80F1 means the I/O has been removed (slave missing — OB86 will fire in parallel). 80B0 is a module fault (also OB86-class). 80A0/80A1 are transient negative acknowledgements and typically clear in one cycle. 80E1 means the I/O is mid-update and you should retry the next OB1 cycle.

Back to blog