IMDHMIControls LibraryShop main store

Troubleshooting

Fix an S7-300 PROFIBUS gateway: module address above the image

Industrial networks Published 7 min read

Short answer

The PROFIBUS side is fine: the S7-300 accepted the GSD file and the telegram carries your values. The assigned module addresses sit above the CPU's process image, so ordinary I and Q access reads zeros. Move them into bytes 0 to 127, or read and write them with peripheral access.

On this page
  1. Why does the S7-300 detect the gateway but read no I/O?
  2. What does a missing parameter or configuration error prove?
  3. Where does the S7-300 process image end?
  4. How do I move the GSD module addresses into the process image?
  5. How do I keep the high addresses and still exchange data?
  6. What does the address check look like with real numbers?
  7. How do I verify the exchange after the change?
  8. Which fix should I choose?
  9. Questions asked

Your PROFIBUS configuration is not the fault. The S7-300 accepted the gateway's GSD file, reports no parameter or configuration error, and the DP telegram carries your values — the failure is in addressing: the gateway's GSD modules were assigned above the CPU's process image, so ordinary I and Q reads return a copy the operating system never refreshes. Move the module addresses as low as the existing allocation allows, or leave them and use peripheral access (PIW/PQW). Lowering the addresses restored data exchange in the documented case, and the checks below walk you from symptom to verified fix.

Why does the S7-300 detect the gateway but read no I/O? #

Because the gateway's GSD modules were assigned addresses above the CPU's process image: the configuration is valid, the cyclic data arrives and is stored at those addresses, but your program's ordinary I and Q access reads a copy the operating system never refreshes, so it stays zero.

The S7-300 operating system transfers the process image once per cycle: input bytes inside the image are copied to the inputs the program reads before OB 1 runs, and output bytes are written out after OB 1 ends. Bytes assigned above the image boundary are skipped by that transfer. They still hold live data — the DP master stores the slave's telegram contents at the assigned addresses — but the only way to reach them from the program is direct peripheral access. The documented case, a PROFIBUS/PROFINET gateway configured from the HMSA183B.GSD file, failed exactly here, and lowering the addresses restored the exchange.

What does a missing parameter or configuration error prove? #

It proves only that the downloaded GSD slave configuration matches what the gateway expects — slot layout, identification numbers and telegram length — not that your program can reach the data at the tool-assigned addresses.

Read each observation for what it actually establishes:

Observation What it establishes
Gateway diagnostics on the far side show data The PROFINET side exchanges correctly.
A PROFIBUS analyzer shows the value in the telegram The gateway transmits and the master receives.
The CPU detects the device, no parameter or configuration error The GSD configuration is accepted; slots and IDs match.
Program monitoring shows nothing at the I/Q addresses The program-to-data link is broken, not the fieldbus.

Detection and parameter assignment complete before cyclic data exchange starts, and cyclic exchange was already working. The program's access path is the only link left untested. If the fault sits on the Ethernet end instead — a refused connection rather than a silent image — fixing PROFINET connect errors between a controller and an S7-1200 is the path that case needs.

Where does the S7-300 process image end? #

At byte 127: on the classic S7-300 CPUs the process image covers 128 bytes, bit addresses 0.0 to 127.7, while the I/O address area continues to 1023.7 — so every module byte from 128 upward needs peripheral access.

The address area is a CPU property, not a family constant: the technical data for a CPU 315T-2 DP, for example, lists 2048 bytes each for inputs and outputs, against the 1024-byte area of the classic CPUs. The number that decides this fault is the image boundary, and on these CPUs it sits after byte 127. Configuration tools also let you assign each module to OB1-PI or to a partition PIP 1 through PIP 15, documented for S7-300/400; a partition refreshes only when an OB assigned to it runs, so leave gateway modules in OB1-PI unless you deliberately run that OB cyclically. On the S7-1500 generation the trap mostly disappears, because input and output process images reach 65,534 bytes each. Word and double-word accesses need an even start byte, so PIW 126 is the last word fully inside the image.

How do I move the GSD module addresses into the process image? #

Open the hardware configuration, select each module created from the gateway's GSD file, and overwrite its start address until the highest byte lands at 127 or below — with the 128-byte image, every gateway byte must sit inside 0 to 127.

  1. Open the S7-300 hardware configuration and double-click the gateway's DP slave to list the slot modules the GSD file created.
  2. Record each module's start address and length, for inputs and outputs separately — the two areas are independent and may overlap numerically.
  3. Compute the highest byte of each module: start + length − 1. Any result above 127 sits outside the image.
  4. Overwrite the start addresses, beginning at the lowest bytes your existing I/O leaves free.
  5. Compile and download the hardware configuration, then update every program reference (I, Q, IW, QW) to the new addresses.

How do I keep the high addresses and still exchange data? #

Leave the module addresses alone and switch the program to peripheral access: read with PIW, write with PQW in STEP 7, or append :P to the address in TIA Portal — each access goes straight to the module instead of the image.

Peripheral access works at word and double-word width (PIW/PQW and PID/PQD). When the GSD declares a module's data consistent over more than four bytes, transfer the whole module with SFC 14 (DPRD_DAT) and SFC 15 (DPWR_DAT); those system functions read and write the peripheral area directly, so they also work above the image. Every peripheral access costs bus time on each execution, so read each gateway word once per scan and buffer it. Treat this as the fallback: the cleaner and confirmed correction is moving the addresses.

What does the address check look like with real numbers? #

A 16-byte input module that begins at byte 256 fails the check: 256 + 16 − 1 = 271, which is 144 bytes past the 127 limit; the same module at byte 96 passes, ending at 96 + 16 − 1 = 111 with 16 bytes to spare.

Worked example, a gateway with 16 input bytes and 16 output bytes:

  • As configured: input bytes 256 to 271 and output bytes 256 to 271. The program reads IW 256 and gets zero, because the image transfer never touches those bytes.
  • The DP master still writes the received telegram into bytes 256 to 271 every cycle, so PIW 256 would show the live value even before you move anything.
  • After reassigning: inputs at bytes 96 to 111 (96 + 16 − 1 = 111, inside the limit) and outputs at the same numbers in the Q area. The program reads IW 96 through IW 110 and writes QW 96 through QW 110.
  • Headroom check: 127 − 111 = 16 bytes remain in the image for anything else.

Decision from these inputs: with 16 bytes per direction and free space below the boundary, move the addresses; there is no reason to carry peripheral access for a block this small.

How do I verify the exchange after the change? #

Watch the gateway input words move while the far side sends live values, and write a recognizable output word you can confirm in the gateway's own I/O diagnostic — each direction must prove itself separately, one at a time.

  • Have the far side change a value and confirm the matching input word (IW 96 in the example) follows within a cycle or two.
  • Write a fixed pattern such as 16#A55A to the output word and confirm it in the gateway diagnostic, and on the PROFIBUS analyzer if one stays connected.
  • Check the CPU diagnostic buffer stays free of I/O access errors over a full run.
  • Record the old and new address ranges in the commissioning record so the correction is auditable against the CPU configuration.

One caution belongs here: forcing or writing outputs to test them can move the machine, so do it only with the machine in a safe state and drives disabled. If data starts flowing and then drops out, the fault is a different one — troubleshooting intermittent PROFIBUS dropouts on an S7-400 network follows that path.

Which fix should I choose? #

Move the addresses: it is the confirmed correction in the documented case, it costs nothing at runtime, and it keeps the program on ordinary image access; fall back to peripheral access only when the image is already full.

  • Free space inside the image: reassign the modules as low as the existing allocation allows, then verify both directions as above.
  • Image full: keep the addresses, read and write with PIW/PQW or SFC 14/15, and buffer the values once per scan.
  • New design rather than a repair: budget the gateway's bytes into the image up front, so an assigned slave address never lands above the boundary.

Questions asked

Why did the PROFIBUS analyzer show values while the CPU program saw nothing?

The analyzer proves the fieldbus side: the gateway placed the values in the telegram and the master accepted them. The CPU then stores those bytes at the assigned addresses, but only addresses inside the process image are copied into the image the program reads. The data was in the CPU the whole time and reachable with PIW at the assigned address; the program was reading the image copy, which stays zero.

What is the highest word address that still lies in the process image?

PIW 126 and PQW 126. A word occupies two bytes, so a word that begins at 126 covers bytes 126 and 127, exactly the last two inside a 128-byte image; a word at byte 128 or higher is already outside. Double words must begin at 124 or lower. For a 16-byte module the latest possible start is 112, because 112 + 16 - 1 = 127.

Do I need to change the gateway or its GSD file too?

No. The gateway was accepted with no parameter or configuration error, which means the slot layout and telegram contents already match. The correction happens entirely in the CPU project: the module start addresses in the hardware configuration, and the matching reads and writes in the program. Nothing on the PROFIBUS or PROFINET side needs to change.

Does the same limit apply to an S7-1500 or S7-400?

Not in the same way. S7-1500 CPUs provide process images of up to 65,534 bytes for inputs and for outputs, so a gateway lands far below the boundary in practice. S7-400 CPUs make the image size a configurable CPU property rather than a fixed limit. The fixed 128-byte image is the specific S7-300 trap.

Will peripheral access slow my scan cycle?

Each peripheral access is a direct read or write on the I/O bus instead of a free copy from the image, so it costs cycle time on every execution. A handful of gateway words read once per scan is a reasonable price when the image is full; hundreds of words would not be. Buffer the values after the single read and reuse the buffer in the rest of the program.

Keep reading

  • Troubleshooting

    Connecting STARTER to a PROFIBUS drive through an S7-300

    Being online with the S7-300 does not put STARTER online with the drive. Confirm the drives are on PROFIBUS, make the drive's station address match the one the project expects, select the routed path through the S7-300 in STARTER, and save the new parameters to EEPROM with P0971 = 1.

    Industrial networks

  • Troubleshooting

    Troubleshooting ControlNet scanning of legacy 1771 specialty I/O

    When a legacy 1771 specialty module will not scan over ControlNet, separate three layers before touching hardware: the chassis backplane allows two master/slave connections and each expander-class module takes one, the TIC-chip ASIC conflict applies to specific pairs only, and RSLogix 5000 gives you no configuration wizards for 1771 block transfer. Bench-test the exact module-and-chassis combination before go-live.

    Industrial networks

  • Troubleshooting

    Troubleshooting intermittent PROFIBUS dropouts on an S7-400 network

    Save and read the CPU diagnostic buffer before touching anything: the earliest OB86/OB85 entries, mapped against the physical segment drawing, tell you whether the losses share one repeater segment. On a bus that ran seven years and began failing after an encoder tie-in was relocated and re-terminated, one physical-layer fault at that tie-in or its segment's end termination explains all three DP indicators and the self-recovery.

    Industrial networks