IMDHMIControls LibraryShop main store

How-to

Exchange data between an S7-300 and S7-200 over MPI

Industrial networks Published 7 min read

Short answer

No ladder program is ever transferred between an S7-300 and an S7-200: each CPU is programmed and downloaded in its own tool, STEP 7 and Micro/WIN. Over MPI the S7-300 does all the communication work, calling X_GET to read and X_PUT to write bytes in the S7-200's V memory, which it addresses as DB1. Match the segment baud rate and station addresses, map the bytes identically on both sides, then prove the exchange with a status chart before trusting it.

On this page
  1. Can I download the ladder programs together in one go?
  2. What actually moves between the two CPUs?
  3. Which network do I have: MPI, PPI or PROFIBUS?
  4. How do I set the segment parameters so both tools connect?
  5. How do I program the S7-300 side with X_GET and X_PUT?
  6. What does a working one-byte exchange look like with real numbers?
  7. How do I program the S7-200 side in Micro/WIN?
  8. How do I prove the link works before I trust it?
  9. What breaks these links most often?
  10. Questions asked

No, you cannot download an S7-300 and an S7-200 ladder program in one operation, and you do not need to: over MPI the two CPUs only swap process data, each keeping its own program and its own programming tool. The S7-300 does all the communication work with its X_GET and X_PUT system functions, reading and writing bytes in the S7-200's V memory, which the S7-300 addresses as data block DB1. Work through the decisions in order: identify the network you actually have, set the segment parameters, program the S7-300 calls, map the S7-200 bytes, and verify the exchange before you trust it. Every address and rate in the worked example below is an example value you replace with your own.

Can I download the ladder programs together in one go? #

No — an S7-300 and an S7-200 never share one download: the S7-300 takes its program from STEP 7, the S7-200 takes its program from Micro/WIN, and you download each project from its own tool separately. The "master and slave" idea describes the data link, not a program transfer. The S7-300 acts as the communication master and polls the S7-200 for data; the S7-200 program never changes because of the link, and nothing in it is sent, received or overwritten by the S7-300. If you first need to bring an existing S7-200 project onto your PC, uploading is its own task: when Micro/WIN refuses an uploaded project, the fix for a block format not recognised on an uploaded S7-200 program covers that error.

What actually moves between the two CPUs? #

Only process data moves: bytes, words and bits that the S7-300 copies out of or into the S7-200's V memory, which the S7-300 addresses as data block DB1. X_GET reads a data area from a partner outside the local S7 station, and X_PUT writes one; both are documented for the S7-300 and S7-400 over MPI. The remote CPU stays passive and calls no communication block of its own. The bytes carry I/O states, counts and setpoints, never logic. When the S7-300 reads DB1 it is reading the S7-200's V memory directly: DB1.DBB100 is VB100, DB1.DBW102 is VW102, and DB1.DBX100.0 is V100.0. That one-to-one offset rule is what keeps the map honest on both sides.

Which network do I have: MPI, PPI or PROFIBUS? #

Read the hardware: an S7-200 with only its CPU port on the cable is an MPI/PPI partner for X_GET and X_PUT, while an S7-200 fitted with an EM277 module is a PROFIBUS-DP slave and uses neither block. The S7-200's CPU port answers as a passive MPI/PPI partner, so the S7-300 can poll it directly over the shared segment. That port is not a DP slave: pointing a DP master at it will not communicate. If an EM277 sits on the S7-200, the design changes completely — the S7-300 exchanges a cyclic I/O window with the module and no X_GET or X_PUT is called at all. Decide by looking in the cabinet before opening either programming tool: CPU port only means the MPI route below, an EM277 means the DP route described in the FAQ.

How do I set the segment parameters so both tools connect? #

Match the segment before you program anything: every node on the cable runs the same baud rate, and every node — including your PC adapter — owns a station address unique on that segment. The S7-200's port rate lives in its system block, downloaded from Micro/WIN. The S7-300's MPI parameters live in the CPU properties' MPI/Network settings, where the highest MPI address must sit above the largest station address on the segment. STEP 7 and Micro/WIN each keep their own interface assignment, so if one PC adapter serves both tools, reselect the active access point each time you change tools — a tool that suddenly cannot connect after the other worked has usually lost that selection. A duplicated station address corrupts traffic for the whole segment, not just one node. When both tools can see their own CPU on the segment, the physical layer and parameters are right.

How do I program the S7-300 side with X_GET and X_PUT? #

The S7-300 does all the communication work: you call X_GET to read and X_PUT to write, from the cyclic program, and each call is request-driven, so it needs a request bit and a status check.

  1. Place the X_GET and X_PUT calls in OB1 or in a block that OB1 calls, so they repeat every scan.
  2. In each call, set the partner's MPI station address to the S7-200's address from the segment settings.
  3. Set the remote address to DB1 with the V-memory byte offset — for example DB1.DBB100 for VB100.
  4. Set the local buffer in the S7-300 to an area at least as long as the transfer length; a length longer than the local area returns an error.
  5. Drive the request with a bit that pulses or runs continuously, and read the status outputs: a BUSY flag that never clears points at a wrong partner address or an absent partner, and a non-zero error value is decoded in the system function description for that block.
  6. Reserve a dedicated V-memory block for the exchange on the S7-200 and document the byte map on both sides, so a future program edit cannot collide with data the S7-200 already uses.

What does a working one-byte exchange look like with real numbers? #

Take example addresses and watch one lamp byte cross the segment: S7-300 at MPI address 2, S7-200 at address 3, PG adapter at 0, segment at 187.5 kbit/s, the rate MPI segments commonly run. The S7-300 writes three traffic-light commands and reads back one status byte. X_PUT copies S7-300 DB1.DBB0 to partner DB1.DBB100 — that is VB100 — one byte, because three command bits fit in one byte: V100.0 red, V100.1 yellow, V100.2 green. X_GET copies partner DB1.DBB101 — VB101 — into S7-300 DB1.DBB1, one byte holding eight S7-200 input states. The offsets match by the DB1 mapping, since MPI byte 100 is V-memory byte 100. The S7-200 ladder does the rest: contacts on V100.0, V100.1 and V100.2 drive the lamp coils, and ordinary coils copy its inputs into VB101.

How do I program the S7-200 side in Micro/WIN? #

Write almost nothing new: the S7-200 program only produces bytes into its V memory and consumes bytes out of it with ordinary contacts and coils, and it calls no communication block at all. Keep the exchange range out of the program's own variable use, including retentive ranges the process already relies on. NETR and NETW are not used here — those instructions make an S7-200 a PPI master toward other S7-200s, which is a different design. Download the S7-200 project from Micro/WIN and the S7-300 project from STEP 7, each separately. If you are setting the tool up from scratch, the guide on getting the right Micro/WIN version for an S7-200 CPU 224 sorts out the software and cable first.

Prove it with a status chart and a forced pattern, and expect the BUSY status to clear and the error output to stay at zero on ten consecutive transfers in both directions. In Micro/WIN, open a status chart on VB100 and toggle the S7-300 request bit: the value must change. Force B#16#01, then B#16#02, then B#16#04 into the S7-300 source byte: the red, yellow and green outputs follow in turn, one bit each. Map an S7-200 input into VB101, toggle it, trigger X_GET, and check the S7-300 target byte shows the same value. Pull the cable from the S7-200: the S7-300 should report a communication error rather than silently holding stale data, and recover once the cable is restored. Run these first tests with the S7-200 outputs disconnected from their loads, so a wrong byte cannot move real hardware.

Most failed links die on the segment or the memory map, not in the ladder: four faults account for nearly every case worth checking first.

  • Treating the exchange as a program transfer and hunting for a download that moves ladder between the CPUs — no such download exists.
  • Leaving the PC adapter bound to the wrong protocol after switching between STEP 7 and Micro/WIN on one adapter.
  • Mapping V-memory offsets inconsistently, such as writing to DB1.DBB100 while the S7-200 program reads VB110, which gives plausible but shifted values.
  • Pointing a DP master at the S7-200 CPU port, which is not a DP slave; that hardware needs an EM277 module or the MPI route above.

Questions asked

Does the S7-200 need NETR or NETW instructions for this link?

No. NETR and NETW belong to a different design, where an S7-200 acts as a PPI master and reads or writes other S7-200s over PPI. In an S7-300 master link the S7-200 stays completely passive: it calls no communication block, and the S7-300's X_GET and X_PUT perform every transfer. The S7-200 program only moves ordinary bytes in and out of the agreed V-memory range with contacts, coils and move instructions.

Why does the S7-300 address the S7-200 memory as DB1?

Because over MPI the S7-200 presents its V memory as data block 1, with offsets equal to the V offsets: DB1.DBB100 is VB100, DB1.DBW102 is VW102, and bit V100.0 is DB1.DBX100.0. Writing the byte map with that equality on both engineering stations is what prevents shifted values, which are the most common silent fault on this class of link.

What changes if the S7-200 has an EM277 module instead?

The design changes from polled MPI data to cyclic PROFIBUS-DP I/O. The EM277's station address is set on the module itself, its GSD file is installed in the STEP 7 hardware configuration, and the configured I/O window is matched to the V-memory offset the S7-200 program uses. The S7-300 then reads and writes that window as ordinary process-image I/O, and X_GET and X_PUT are not called at all.

How often does the exchanged data actually update?

Each X_GET and X_PUT runs once per call, so with both calls in the cyclic program the data refreshes at scan rate whenever the partner is not busy. A call that reports BUSY has not completed its transfer yet, so the previous data still stands until the status clears. Allow for that lag when an exchanged value drives timing, counting or interlock logic on either CPU.

Keep reading

  • Selection guide

    Choosing PLC to SCADA communication over long distances

    For PLC-to-SCADA communication over long distance, choose the transport by reach and connection behavior: fiber Ethernet for a continuous long link (one span rated 2 km), RS-485 where serial fits, extenders or radio on existing pairs, dial-up or leased-line modems on phone service. Direct copper Ethernet fails at 100 m per segment; the SCADA driver or OPC service, not the PLC's ASCII modem commands, carries the protocol.

    Industrial networks

  • How-to

    Link an SLC 5/05 and MicroLogix 1100 over DH-485

    Run a dedicated DH-485 serial network: a 1761-NET-AIC+ on the SLC 5/05 serial channel and a 1763-NC01 from the MicroLogix 1100, unique node addresses at each end, 120 Ω termination at both bus ends. A 20-word exchange at a 1 s period loads 9600 bit/s to about 25%, and a heartbeat watchdog set to three missed cycles makes the link fail safe.

    Industrial networks

  • Troubleshooting

    Configure an S7-200 HMI connection in TIA Portal correctly

    The S7-200's port runs PPI, the RS-485 protocol it was built with; MPI is the PROFIBUS-based protocol of the larger S7 CPUs and the two are not interchangeable. Configure the panel in TIA Portal with the S7-200 connection its driver list documents, set the panel's rate equal to the CPU's configured port rate, and give every station a unique address.

    Industrial networks