Overview
Interfacing a desktop PC to a Siemens S7 PLC lets you build a low-cost HMI, log process data, or develop a SCADA application without licensing a full WinCC runtime. The feasible paths depend on which S7 family is in the cabinet and how much engineering effort you are willing to invest. For an S7-200, the cheapest viable path is the PC/PPI cable (Siemens 6ES7901-3CB30-0XA0) plus PRODAVE or LIBNODAVE on the PC side. For an S7-300/400, the PC/MPI adapter (6ES7972-0CA23-0XA0) plus PRODAVE MPI (6ES7807-4BA00-0YA0) is the historic baseline, although the S7-300/400 can also be reached over PROFIBUS DP and Ethernet (ISO-on-TCP / S7 Communication) if a CP card is fitted.
Before you start, decide three things:
- Which PLC family and firmware is in the rack? S7-200, S7-300, S7-400, S7-1200, and S7-1500 use different transport layers.
- Do you need a one-off pet-project link, or do you need a maintainable, vendor-supported interface that a maintenance technician can re-install in three years?
- Will the PC port be RS-232, USB, or Ethernet? Most legacy adapters assume RS-232, so plan for a USB-to-serial bridge if the laptop lacks DB9.
Prerequisites
| Item | Specification | Notes |
|---|---|---|
| Siemens S7 CPU | S7-200 (CPU 21x/22x), S7-300 (CPU 31x-2DP/PN), S7-400 (CPU 41x), or S7-1200/1500 | S7-200/300/400 are classic targets. S7-1200/1500 use PUT/GET or OPC UA instead of MPI. |
| PC port | RS-232 (DB9 male) or USB with FTDI bridge | Most legacy adapters are RS-232 only. |
| Cable / adapter | PC/PPI (S7-200) or PC/MPI (S7-300/400) | See tables below. |
| PC software | PRODAVE, LIBNODAVE, OPC server, or SCADA package | LIBNODAVE is open source and free. |
| STEP 7 / Micro/WIN | STEP 7 V5.5 (S7-300/400), STEP 7 Micro/WIN (S7-200), or TIA Portal V15+ | Used to confirm the PLC address and bus parameters. |
Siemens S7 Communication Protocols at a Glance
| Protocol | Physical layer | Default baud | Typical target | Notes |
|---|---|---|---|---|
| PPI | RS-485, half-duplex | 9.6 / 19.2 kbaud | S7-200 master/slave | Point-to-Point Interface; master polls slaves on address 1-31. |
| MPI | RS-485, half-duplex | 187.5 kbaud (default) or 19.2 kbaud | S7-300/400 + HMI | Multi-Point Interface; up to 32 nodes, addresses 0-31, max address 15 for programming. |
| PROFIBUS DP | RS-485, half-duplex | 1.5 Mbaud typical, 12 Mbaud max | Distributed I/O, drives, S7-300/400 | DP-V0/V1/V2 master-slave. |
| S7 Communication (ISO-on-TCP / TCP) | Ethernet (CP 343-1, CP 443-1, PN-CPU) | 10/100 Mbit | S7-300/400/1200/1500 | Port 102 (ISO-TSAP) - what PRODAVE, LIBNODAVE, and WinCC use. |
| Freeport (USS / ASCII / Modbus RTU) | RS-485 (CPU port 0/1) or RS-232 on S7-200 | User-defined 1.2 - 115.2 kbaud | S7-200, S7-1200 basic | User programs XMT/RCV (S7-200) or Send_P2P / Receive_P2P (S7-1200). |
Hardware Adapters: PC/MPI and PC/PPI
Siemens sold two RS-232 adapters that have been the workhorse of PC-to-PLC links for over twenty years. They remain the cheapest supported route for a learning project on a real S7.
| Adapter | Siemens part number | Connects to | Max baud | Power | Approx. price |
|---|---|---|---|---|---|
| PC/MPI cable (USB legacy) | 6ES7972-0CA23-0XA0 | S7-300/400 MPI port or PROFIBUS DP segment | 1.5 Mbaud | From PLC 24 V on pin 6/7, draws <100 mA | ~€280 |
| PC/MPI cable (USB version) | 6GK1571-0BA00-0AA0 | Same as above, USB on PC side | 12 Mbaud | From USB | ~€450 |
| PC/PPI cable (RS-232) | 6ES7901-3CB30-0XA0 | S7-200 PPI port (DB9 male) | 187.5 kbaud | From S7-200 PPI port 24 V | ~€90 |
| PC/PPI cable (USB) | 6ES7901-3BD30-0XA0 | Same, USB on PC side | 187.5 kbaud | From USB | ~€110 |
| PROFIBUS PC adapter (USB, CP 5711) | 6GK1571-1AA00 | PROFIBUS DP/MPI | 12 Mbaud | From USB | ~€500 |
| RS-232 PROFIBUS extension cable | 6ES7901-1BF00-0XA0 | Between PC/MPI and PLC | - | Passive | ~€30 |
The original PC/MPI cable terminated in DB9 female on the PC side and DB9 male on the PLC side. It piggybacks 24 V from the PLC's MPI connector (pins 6 and 7) to power its own RS-232 to RS-485 converter. The later USB variant (6GK1571-1AA00) draws power from the PC and is the only safe option on laptops without a serial port.
Pin Assignment Reference
| Pin (DB9) | RS-232 PC side (DTE) | RS-485 PLC side (MPI/DP) |
|---|---|---|
| 1 | DCD | Shield |
| 2 | RXD | NC |
| 3 | TXD | Data B (line -) |
| 4 | DTR | NC |
| 5 | GND | GND (0 V) |
| 6 | DSR | +24 V from PLC |
| 7 | RTS | +24 V from PLC |
| 8 | CTS | Data A (line +) |
| 9 | RI | NC |
S7-200 Freeport Mode
The cheapest way to put a process value from an S7-200 on a PC screen is the Freeport mode of the S7-200. Freeport is the CPU's own RS-485 UART: you set SMB30 (port 0) or SMB130 (port 1) to protocol 01 (Freeport), pick a baud rate and parity, and use the XMT (transmit) and RCV (receive) instructions to ship bytes. The PC side just needs a terminal program or a 20-line QBasic program.
The full procedure lives in S7-200 Tips and Tricks Application Examples, TIP 52 ("Freeport Communication with a PC"). The S7-200 System Manual is the official reference for the SMB30 protocol field encoding:
| SMB30 bits | Function | Values |
|---|---|---|
| SM30.0 - SM30.1 (PP) | Parity | 00 = none, 01 = even, 10 = odd, 11 = reserved |
| SM30.2 - SM30.4 (CCD) | Baud (port 0) | 000 = 38.4k, 001 = 19.2k, 010 = 9.6k, 011 = 4.8k, 100 = 2.4k, 101 = 1.2k, 110 = 115.2k, 111 = 57.6k |
| SM30.5 (SM) | Data bits | 0 = 8 bits, 1 = 7 bits |
| SM30.6 (SPM) | Freeport mode | 0 = PPI master, 1 = Freeport |
| SM30.7 (SPB) | Freeport mode select | 0 = PPI/slave, 1 = Freeport |
Sample ST code (S7-200) - send a process value as ASCII once per second
// MAIN OB1 - cycle every 100 ms
IF First_Scan THEN
SMB30 := 16#09; // 0x09 = 0000 1001 = 9600 baud, no parity, 8 bits, Freeport
RCV_Buf_SIZE := 32; // RCV buffer length
END_IF;
IF T_Pulse THEN // 1 Hz clock bit from SMB34/SMW34
Transmit_Buffer[0] := 'V';
Transmit_Buffer[1] := 'W';
Transmit_Buffer[2] := ':';
INT_TO_ASCII(VW100, Transmit_Buffer[3]); // convert signed word to 4 ASCII digits
XMT(Transmit_Buffer, 8, 0); // transmit 8 bytes from port 0
END_IF;
PC side in QBasic (DOS box, Win9x only)
OPEN "COM1:9600,N,8,1,CD0,CS0,DS0,OP0,RS" FOR RANDOM AS #1 LEN=256
CLS
DO
LINE INPUT #1, dataline$
LOCATE 1,1: PRINT dataline$
IF INKEY$ = CHR$(27) THEN EXIT DO
LOOP
CLOSE #1
PRODAVE Library
PRODAVE is the classic Siemens-supplied DLL that wraps the PC/MPI or PC/PPI cable into a small C/VB API. It hides the byte-level MPI framing and exposes simple read/write calls to data blocks, M, I, Q, and timers.
| Product | Part number | Targets | Notes |
|---|---|---|---|
| PRODAVE MPI / IE V6.0 | 6ES7807-4BA00-0YA0 | S7-300/400 over MPI, PROFIBUS, or Ethernet | Approx. €400; ~500 KB DLL + headers for VB, VC, Delphi. |
| PRODAVE MPI MINI | 6ES7806-2AA00-0YA0 | S7-200/300/400, DB exchange only | Approx. €200; read/write of one DB at a time. |
| PRODAVE S7-IE | 6ES7807-3BA00-0YA0 | S7-300/400 over ISO-on-TCP | For CP 343-1 / CP 443-1, port 102. |
Typical VB6 snippet using PRODAVE MPI
' Must reference "PRODAVE_MPI.DLL" (regsvr32 it first)
Dim adr As Long
Dim ok As Long
ok = MpiInit() ' load the driver
ok = MpiSetBaud(7, 0, 0, 0) ' 187.5 kbaud, 8N1, MPI bus, PC = master
ok = MpiConnect(2, 0) ' PLC at MPI address 2, slot 0 of rack 0
ok = MpiReadS7(0, 0, 1, 100, 20, buf) ' read MB0..MB19 from DB1 starting at DBB100
ok = MpiWriteS7(0, 0, 1, 200, 4, cmd)' write 4 bytes into DB1.DBB200
PRODAVE was designed for Windows 95/98/2000; on a 64-bit Windows 10/11 host you need to either run the host application as 32-bit (WOW6432) and install the legacy USB driver for the PC/MPI cable, or migrate the application to a modern library such as LIBNODAVE, S7.Net, or Snap7.
LIBNODAVE - Open-Source Replacement for PRODAVE
LIBNODAVE is the most common open-source C library for S7 communication. It compiles on Windows, Linux, and macOS, supports MPI (via the PC/MPI cable or a CP5611 card), TCP, and ISO-on-TCP, and exposes the same data-block primitives as PRODAVE.
- Latest stable series: 0.8.5 (Thomas Herger's continuation, hosted on the libnodave source tree at the time of writing; the dotNET binding "libnodave.net" and the "Sharp7" port are also widely used).
- Licence: LGPL - safe to use in a closed-source SCADA project as long as the library and any modifications remain open.
- Transports:
daveMPIserial(PC/MPI cable over RS-232),daveMPIcard(Siemens CP5611/CP5621),daveTcp,daveIsoTcp,davePPIserial.
Sample C client reading 16 bytes from a DB
#include "nodave.h"
#include <stdio.h>
int main(void) {
daveInterface *di = daveNewInterface(IFType_mpiPPI, "COM1:9600", 0, daveProtoMPI2, daveSpeed187k);
daveInitAdapter(di);
daveConnection *dc = daveNewConnection(di, 2, 0, 0); // MPI addr 2
if (daveConnectPLC(dc) == 0) {
unsigned char buf[16];
daveReadBytes(dc, daveDB, 1, 100, 16, buf); // DB1.DBB100..DBB115
printf("DB1.DBW100 = %d\n", (buf[1]<<8)|buf[0]);
daveDisconnectPLC(dc);
}
daveFree(dc);
daveFree(di);
return 0;
}
OPC Server Approach
OPC is the standard for SCADA-to-PLC communication. If you already have a SCADA package (WinCC, Citect, iFIX, Ignition) that speaks OPC DA or OPC UA, the cheapest path is a thin OPC server in front of the S7.
-
SIMATIC NET OPC Server (Siemens, part of STEP 7 V5.5 / TIA Portal): full-featured, supports MPI/PROFIBUS/Ethernet, ships as
S7OPCSimfor offline testing. - IBH OPC Server (IBHsoftec): supports MPI/PPI/TCP, works with LIBNODAVE-style transport, runs as a service on Windows.
- openSCADA / Eclipse SCADA: open-source OPC DA/UA server with an S7 driver built on LIBNODAVE.
OPC UA is the right long-term choice for any new S7-1200/1500 install, since the S7-1500 CPU can host an OPC UA server directly without an extra PC. The S7-1200 needs firmware V4.0+ and a licence on the CPU; see the S7-1200 System Manual for activation.
SCADA / HMI Software Options
| Package | Vendor | S7 driver | Cost | Best use |
|---|---|---|---|---|
| WinCC flexible / WinCC V7 | Siemens | Native MPI/PROFIBUS/TCP | Full licence only - several thousand euros | Plant-floor SCADA, tag logging, redundancy |
| TIA Portal WinCC | Siemens | Native | Bundled with TIA Portal | Engineering with STEP 7 V15+ |
| Citect SCADA (AVEVA) | AVEVA / Schneider | S7-MPI/TCP driver | Free demo - 15 min runtime, restart required | Learning SCADA at no cost |
| Interact | CTC Automation | S7-200/PPI and S7-300/MPI | Free downloadable edition | Small S7-200 HMI on the bench |
| AdvancedHMI | Open source | S7.Net (LIBNODAVE fork) | Free | VB.NET / C# HMI against any S7 |
| Ignition by Inductive Automation | Inductive Automation | OPC UA or Siemens driver | Free trial, ~$4,500 per server | Modern web-based HMI / SCADA |
Citect's 15-minute runtime is the most common way to get a "free" SCADA onto a laptop for a learning project - it is a real Citect runtime with the full driver set, and the 15-minute window restarts cleanly on a service or by re-launching the runtime. Use it to learn the alarm/IO/trend primitives; once the project is stable, the licence cost is the only difference between a demo and a production install.
Alternative: AutomationDirect CLICK PLC as a Reference
If you are flexible on the PLC brand, the AutomationDirect CLICK series ships a built-in RS-232 port and a free programming environment. The CLICK C0, C2, and C3 modules expose DB1-style "XD" registers over Modbus RTU on port 2 and an ASCII protocol on port 1, which is far simpler than MPI for a one-evening project. See the AutomationDirect CLICK PC-to-PLC communications video for a worked example. The trade-off is that the CLICK CPU and its free software are limited to ~200 tags - fine for a bench project, not for a plant install.
Step-by-Step: Cheapest Viable S7-200 to PC Link
- Install STEP 7 Micro/WIN on the PC. Connect the PC/PPI cable (6ES7901-3CB30-0XA0) between the PC's COM1 and the S7-200's port 0. Verify the PC sees the CPU with Communications > PC/PPI Cable PPI - you should read the CPU type and firmware.
- Set the S7-200 to PPI slave address 2, 9.6 kbaud, via the System Block configuration in Micro/WIN.
- Open the TIP 52 example from the S7-200 Tips and Tricks CD. Copy the ST code above into a new OB1, compile, and download to the CPU. Put the CPU in RUN.
- On the PC, run the QBasic program (or a free terminal like PuTTY set to 9600-8-N-1, XON/XOFF off). You should see
VW:<value>rolling up the screen once per second. - Replace the QBasic print loop with a small VB6, VB.NET, or Python application that parses the line and updates a label. At this point you have a working HMI for the price of a PC/PPI cable and an evening's work.
Step-by-Step: S7-300/400 to PC over MPI
- Install STEP 7 V5.5 SP2 (or higher) on the PC. Use the PC/MPI cable (6ES7972-0CA23-0XA0) on COM1. The cable draws 24 V from the CPU MPI connector - you do not need a separate power supply.
- In STEP 7, set Set PG/PC Interface to "PC Adapter (MPI)", 187.5 kbaud, MPI = 0, PC = master.
- Use Accessible Nodes to confirm the PLC is online. Note its MPI address (default 2) and slot (default 2 for an S7-300 CPU).
- Either install PRODAVE MPI (6ES7807-4BA00-0YA0) and use the VB snippet above, or compile LIBNODAVE with the
daveMPIserialtransport and link it to your C/VB application. - For a quick visual check, install Citect or the free Interact edition, point its S7 driver at "PC Adapter (MPI)", and drop a couple of tags. The 15-minute demo runtime is enough to prove the link.
Verification
After the link is up, run these checks before declaring the project complete:
- Cyclic heartbeat: Write a 16-bit counter in the PLC, increment every cycle, and verify the PC side sees the same count over the cable. A stuck or replayed value is the classic sign of a buffer corruption.
- Round-trip time: Measure write-then-read latency. PPI/MPI at 187.5 kbaud is roughly 1-3 ms per 16-byte block, 12 Mbaud PROFIBUS is ~200 microseconds. If your read takes >50 ms, suspect a wrongly addressed partner (MPI bus scan is expensive).
- Bus load: On PROFIBUS, use the diagnostic counters in STEP 7 (PLC > Diagnostics/Settings > Bus Statistics). Bus load >60% on a 1.5 Mbaud segment will cause retries and jitter.
- Driver-level error: PRODAVE returns the error code in the last parameter of every call. Common values: 0x8000 (cable not found), 0x8001 (timeout), 0x8002 (PLC not online), 0x8003 (MPI address conflict).
- Visual confirmation: If using a SCADA, write a tag value from the PLC's HMI and confirm the SCADA animation follows within one scan.
Troubleshooting Matrix
| Symptom | Likely root cause | Fix |
|---|---|---|
| PC/MPI cable LED stays red | No 24 V from PLC MPI port, wrong cable on bus, or PC/MPI driver not installed | Check that 24 V is present on pins 6/7 of the MPI connector; install the legacy Siemens USB driver if you are on a USB variant. |
| PRODAVE returns 0x8001 after 5 s | PLC not on the bus, or wrong MPI address | Use STEP 7 Accessible Nodes to confirm the address; default is 2 for a fresh S7-300. |
| Freeport characters are scrambled | Baud or parity mismatch between SMB30 and PC terminal | Set both sides to 9600-8-N-1; remember SM30.2-SM30.4 = 010 for 9.6 kbaud. |
| OPC server connects but tags are all "Bad" | DB address outside the configured range, or Optimised Access on S7-1200/1500 | Disable Optimised Access on the DB or switch to Symbolic Access; the classic S7-300/400 DB accessors do not read optimised blocks. |
| Libnodave compiles but never connects | Wrong transport (TCP vs ISO) or wrong TSAP on the S7-300 | For ISO-on-TCP use daveIsoTcp; TSAP defaults to 01.00 on the S7-300 side and 02.00 on the PC side. |
| Citect demo restarts every 15 minutes | By design - the demo runtime expires | Use the restart for a long overnight test; the licence unlocks the runtime for production use. |
| Bus scan from the PC disturbs the HMI panel on the same MPI bus | Two masters with overlapping addresses | Re-address one master to a non-conflicting bus address, or insert the PC between the CPU and the panel. |
Field-Proven Notes
A few practical constraints collected from real benches:
- RS-232 ports are gone from most new laptops. Keep one USB-to-RS-232 adapter (FTDI chipset) in your toolbox for legacy Siemens cables. Chipsets labelled "FT232" or "CP2102" work; some Prolific PL2303 clones do not.
- The PC/MPI cable supports MPI up to 1.5 Mbaud; the PC/PPI cable supports PPI up to 187.5 kbaud only. Don't expect to reach PROFIBUS DP 12 Mbaud with the older PC/MPI cable - the bandwidth is hard-limited in the firmware.
- On an S7-300 rack with a CP 343-1, use the Ethernet port - it is faster, electrically isolated, and supported by every modern driver. Save the PC/MPI cable for S7-300 CPUs that have no Ethernet port (older CPU 31x, CPU 31x-2DP).
- For a long-lived plant install, the Maintenance Manual is unambiguous: "Custom HMI applications must be documented, version-controlled, and re-buildable from source code held on a controlled repository." A Freeport QBasic program on a Windows 98 laptop is not a plant install - it is a learning machine.
Can I connect a PC to a Siemens S7 PLC without buying any hardware?
No. Every supported link (PPI, MPI, PROFIBUS, Ethernet) needs at least a cable. The cheapest viable hardware is the Siemens PC/PPI cable (6ES7901-3CB30-0XA0, ~€90) for an S7-200, or the PC/MPI cable (6ES7972-0CA23-0XA0, ~€280) for an S7-300/400. You can use any RS-232-to-RS-485 adapter as long as it can drive the 24 V isolated bus, but the Siemens cables are the only ones Siemens has tested with PRODAVE and STEP 7.
Is the PRODAVE MPI library still supported on modern Windows?
PRODAVE V6.0 (6ES7807-4BA00-0YA0) was last released for Windows XP/2003 and works on 32-bit Windows 7/10 in compatibility mode. On 64-bit Windows 10/11 you need a 32-bit host application and the legacy USB driver for the PC/MPI cable. For new development, use LIBNODAVE (open source) or Snap7, or move the link to OPC UA over the S7-1200/1500 built-in Ethernet port.
What is the difference between PPI, MPI, and PROFIBUS?
PPI is S7-200's point-to-point RS-485 protocol, default 9.6 kbaud, master-slave. MPI is the S7-300/400 multipoint RS-485 protocol, default 187.5 kbaud, used for HMI and programming on the same bus. PROFIBUS DP is the IEC 61158 fieldbus version of the same physical layer, running 1.5-12 Mbaud, used for distributed I/O and drives. They share the same RS-485 hardware but the framing is different - a PC/PPI cable cannot talk PROFIBUS DP at 12 Mbaud, and a PC/MPI cable cannot talk PPI on an S7-200 at 9.6 kbaud without a setting change.
Can a modern laptop without an RS-232 port still talk to an S7-200?
Yes. Use the USB PC/PPI cable (Siemens 6ES7901-3BD30-0XA0) or a third-party USB-to-RS485 converter with a Modbus RTU driver. Micro/WIN supports both. Avoid generic Prolific PL2303 clones - they often fail the Siemens 64-bit driver check.
Is it legal to build a custom SCADA on top of LIBNODAVE for a real plant?
Yes, the LGPL licence allows closed-source commercial use as long as the LIBNODAVE library and any modifications stay open. However, Siemens will not warrant the link, and a failed LIBNODAVE release can leave you without security patches. For a regulated plant, pair LIBNODAVE with a commercial OPC UA server (Siemens SIMATIC NET, IBH, Kepware) and use the SCADA's native OPC UA client.