Configuring PC-to-S7-300 Communication: OPC, MPI, and Ethernet

David Krause15 min read
Industrial NetworkingSiemensTutorial / 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

A Siemens SIMATIC S7-300 PLC controlling building doors via digital I/O needs to accept open and close commands from a PC. The PLC executes deterministic logic in OB1 (or a dedicated door-control FB) and drives outputs on an SM322 module; the PC supplies supervisory commands and reads back door status. Three architectural paths deliver PC-to-S7-300 traffic: a commercial OPC server, a vendor SCADA package that bundles its own S7 driver, or a custom client built on a vendor toolkit or SDK.

The cheapest path in absolute license cost is rarely the cheapest in total cost of ownership once commissioning time, support, and lifecycle risk are factored in. This reference walks through each viable option with part numbers, driver requirements, scan-rate guidance, and a commissioning checklist so the right path can be selected for a building door-control scope rather than a plant-wide SCADA retrofit.

System Topology

The PC hosts the OPC server (DA or UA) and the user application. The application reads door status from the S7-300 and writes open/close commands. The OPC server translates those reads and writes into S7 protocol packets on the chosen transport (PROFINET, MPI, or PROFIBUS). The CPU executes the door-control logic and updates the SM322 outputs that drive the door actuators; SM321 inputs return door position and request-to-exit.

PC / Engineering Station OPC DA or OPC UA Server Kepware - SIMATIC NET - Matrikon Door-control HMI / API S7-300 CPU CPU 315-2 PN/DP OB1 / FB Door_Ctrl SM322 DO (Doors) SM321 DI (Status) Door actuators 24 V DC magnetic locks or motorized strikes PROFINET 100 Mbps MPI / PROFIBUS 187.5 kbps to 12 Mbps USB programming cable (PG only)

Communication Paths and Hardware

Pick the transport first; the OPC server choice is downstream of that decision.

Transport Siemens Hardware (examples) Throughput OPC Server Support Recommendation
PROFINET CPU 315-2 PN/DP (6ES7315-2EH14-0AB0) or CP 343-1 Lean (6GK7343-1CX10-0XE0) 100 Mbps full duplex All major vendors Preferred for new and retrofit work
MPI PC Adapter USB A2 (6ES7972-0CB20-0XA0) 187.5 kbps default, 12 Mbps max Limited; requires Siemens or compatible PC hardware Legacy single-PLC link
PROFIBUS DP CPU 315-2 DP (6ES7315-2AH14-0AB0) plus CP 5612 / CP 5621 in the PC 12 Mbps Good via Siemens MPI/DP driver Existing DP networks
Ethernet via CP on legacy CPU CP 343-1 Lean (6GK7343-1CX10-0XE0) 100 Mbps All major vendors Drop-in upgrade for CPU 31x without PN

For door control, the tag count is small (one Boolean command per door plus one or two status inputs), so the PROFINET path dominates because every OPC server speaks it natively and no PC-side proprietary hardware is required beyond a standard network interface. If the existing installation is CPU 314 or 315-2 DP without an Ethernet port, the lowest-friction upgrade is to drop in a CP 343-1 Lean and switch to PROFINET rather than fight with MPI driver support.

OPC Architecture: DA, UA, and S7-300 Reality

OPC Classic (DA 2.05a / 3.0) is COM/DCOM-based and Windows-only. It works well on an isolated engineering network, but DCOM configuration becomes painful across firewalls, ACLs, or workgroup boundaries.

OPC UA (IEC 62541) is cross-platform, secure (authentication and encryption), and uses a single TCP port (4840). For new PC-to-PLC projects prefer OPC UA unless an existing client application mandates OPC DA. The OPC UA specification is maintained by the OPC Foundation.

For S7-300 specifically, OPC UA server support varies by CPU firmware and OPC server product:

  • SIMATIC NET's S7-OPC Server exposes OPC DA. The OPC UA Server component is a separate add-on that wraps the same data.
  • Third-party OPC UA servers (Kepware KepserverEX with the IoT Gateway plug-in or native UA server, MatrikonOPC, Softing) provide OPC UA access directly to the S7-300 via the Siemens TCP/IP driver.
  • The S7 protocol itself is proprietary; every OPC server links against Siemens libraries or implements the protocol from observed traffic. Native S7 access therefore always carries a license burden.

For deterministic small-tag-count door control, OPC DA over PROFINET is sufficient and easier to debug. For projects spanning multiple workgroups, multiple vendors, or requiring remote access over enterprise networks, OPC UA eliminates the DCOM configuration problem entirely.

Commercial OPC Server Comparison

Product S7-300 Driver OPC DA OPC UA Indicative List (USD) Notes
PTC Kepware KepserverEX Siemens TCP/IP Ethernet; Siemens MPI/PROFIBUS Yes Yes (IoT Gateway plug-in or native) $1,500 - $5,000+ depending on driver set 2-hour demo mode for evaluation
Siemens SIMATIC NET S7-OPC Server (bundled with STEP 7 / TIA Portal) Yes Yes (OPC UA Server add-on) Bundled with PC software / licensed per CP Most integrated with STEP 7 / TIA Portal
MatrikonOPC S7 OPC Server S7 MPI / TCP/IP Yes Yes (newer UA wrapper) ~$1,000 - $2,500 Strong in process industries; Hilscher card support
Softing S7/S5 OPC Server S7 MPI / TCP/IP Yes Yes (Softing OPC UA Proxy) ~$1,200 - $3,000 Includes connector toolkit for custom clients
ICONICS OPC Server S7 driver Yes Yes Bundled with ICONICS Suite Best with ICONICS HMI/SCADA

For an S7-300-only door-control scope (tens to low hundreds of tags, deterministic updates), Kepware KepserverEX with the Siemens TCP/IP Ethernet driver is the lowest-friction third-party path. SIMATIC NET is the natural choice if STEP 7 or TIA Portal is already on the engineering station, because no separate driver purchase is required and the S7-OPC Server ships with the PC software. Refer to the PTC Kepware KepserverEX product page for the current driver list and runtime configuration.

Siemens Native Option: SIMATIC NET S7 OPC Server

SIMATIC NET PC Software includes the S7-OPC Server and the Station Configuration Editor. Licensing is by CP (S7-1613 / S7-1623 softnet licenses) or by runtime configuration. The canonical commissioning procedure is documented in the Siemens Industry Online Support entry "SIMATIC NET: PC Software - Commissioning PC Stations".

High-level setup:

  1. Install SIMATIC NET on the engineering station.
  2. Launch Station Configuration Editor, add an OPC Server and either the local NIC or a Siemens PC Adapter.
  3. Configure an S7 connection to the S7-300 CPU; assign rack and slot.
  4. In the STEP 7 / TIA Portal project, add an S7 connection to the PC station (right-click the CPU -> "Insert New Connection").
  5. Place OPC items in the PLC's symbol table and expose them via the S7-OPC Server.
  6. Test with OPC Scout (ships with SIMATIC NET) to confirm tag browse, read, and write before commissioning the custom application.

OPC Scout is the workhorse for commissioning: it browses the S7 symbol table, watches live updates, and forces values to verify the wiring end-to-end without the custom PC application being ready. Refer to the S7-300 hardware manuals on Siemens Industry Online Support for slot and addressing conventions.

Step-by-Step: Configuring Kepware KepserverEX for S7-300 PROFINET

Prerequisites:

  • Windows 10/11 or Windows Server 2016 or later.
  • Layer-3 reachability between PC and S7-300 (verify with ping <PLC_IP>).
  • STEP 7 or TIA Portal project for the S7-300 (or at minimum the PLC IP address, rack, and slot).
  • Kepware KepserverEX installation media and runtime license (or 2-hour demo mode for evaluation).
  • S7-300 CPU with PUT/GET access enabled (CPU Properties -> Protection -> "Permit access with PUT/GET communication from remote partner").

Procedure:

  1. Launch Kepware Configuration. Right-click Connectivity -> New Channel. Name it S7_300_Channel. Select "Siemens TCP/IP Ethernet" as the driver. Leave the default port (102). Accept the default scan mode (Respect client-specified scan rate) unless you have a reason otherwise.
  2. Adjust the default device scan rate to 100 ms. Door control does not need sub-100 ms update latency, and 100 ms keeps the OPC server CPU load negligible.
  3. Right-click the channel -> New Device. Set Device ID = PLC IP (e.g., 192.168.0.10) and rack/slot. For a CPU 315-2 PN/DP on rack 0, slot 2, the driver expects the IP and rack 0, slot 2 in the device properties. Verify with the hardware configuration in STEP 7 / TIA Portal.
  4. Right-click the device -> New Tag. Create one tag per door:
    • Door_01_Command - Boolean, address DB1.DBX0.0, read/write (1 = unlock, 0 = lock).
    • Door_01_Status_Closed - Boolean, address I0.0, read only.
    • Door_01_Status_Open - Boolean, address I0.1, read only.
    • Door_01_Heartbeat - Word, address MW10, read only (incremented each OB1 cycle for liveness check).
  5. Apply. Right-click the channel -> Quick Client. Verify Quality = Good and that forcing Door_01_Command = 1 from Quick Client turns on the corresponding DO LED on the SM322 module.
  6. From the PC application, connect via any OPC DA client (OPC Quick Client, custom .NET code via OpcNetApi or the OPC Foundation .NET Standard stack for OPC UA) and read/write tags.

Canonical reference: "Siemens TCP/IP Ethernet Driver Help" inside the KepserverEX install and the PTC Kepware KepserverEX product page.

PUT/GET access on the S7-300 CPU must be enabled in the CPU's protection properties. Without it, every tag shows Quality = Bad and the OPC server returns an object-access-not-allowed error at the application layer. This is the single most common commissioning mistake on S7-300 PROFINET links.

MPI/USB Adapter Limitations

The Siemens PC Adapter USB A2 (6ES7972-0CB20-0XA0) terminates the MPI or PROFIBUS segment and presents the bus as a USB interface to the PC. It supports both MPI (187.5 kbps to 12 Mbps) and PROFIBUS DP master.

The engineering gotcha is that most third-party OPC servers do not support the PC Adapter USB natively. They expect one of the following:

  • Standard Ethernet to a PROFINET-capable CPU (preferred path).
  • A Siemens CP card (CP 5611, CP 5612, CP 5621) installed in the PC acting as the PROFIBUS or MPI master.
  • An Hilscher CIFX card with appropriate PROFIBUS firmware loaded.

If the existing cable plant is MPI and a re-pull of Ethernet is undesirable, two practical options exist:

  1. Add a CP 343-1 Lean (6GK7343-1CX10-0XE0) to the S7-300 and switch to PROFINET. This is the lower-friction option in roughly 90 percent of legacy MPI installations and re-uses standard Ethernet patch cabling.
  2. Install a CP 5612 or CP 5621 in the PC and use the Siemens MPI/PROFIBUS driver in Kepware (or equivalent in MatrikonOPC / Softing). This is more expensive but preserves the MPI cable plant.

The PC Adapter USB programming cable is intended for STEP 7 / TIA Portal programming traffic, not high-rate OPC polling. Using it as a primary OPC path is discouraged because throughput is low and concurrent online programming sessions block traffic.

Alternative Approaches: From SCADA to Excel/VBA

Full SCADA packages (Siemens WinCC / TIA Portal WinCC, Wonderware InTouch / ArchestrA, Inductive Automation Ignition, Movicon, Indusoft) bundle an OPC server, HMI editor, alarms, trending, and historical logging. For door control alone this is overkill, but for building access systems that grow into HVAC, lighting, and security dashboards the SCADA license often amortizes quickly.

  • Siemens WinCC (TIA Portal): ships with built-in S7 drivers. If the engineering station is already running STEP 7 / TIA Portal, a WinCC screen can be built with buttons tied directly to PLC tags without a separate OPC server license.
  • Wonderware InTouch / ArchestrA: uses the ArchestrA DAServer for S7. Licensing is independent of the InTouch runtime.
  • Inductive Automation Ignition: uses the Siemens S7 driver module (Cirrus Link or third-party). It is OPC UA-native and a strong choice if web-based HMI clients are anticipated.

Excel / VBA: With staff fluent in VBA, Excel can act as an OPC DA client through the OPC Automation Wrapper. Add a reference to "OPC Automation 2.0" in the VBA project and connect to the OPC server by ProgID (for Kepware, Kepware.KEPServerEX.V6). This is genuinely the cheapest path in licensing terms but the worst path in lifecycle terms: DCOM permissions must be set on Windows, no native redundancy, no built-in security, and a single-file deployment that does not scale.

Custom .NET client: For maximum control, write a C# or VB.NET application using the OPC Foundation .NET Standard stack (for OPC UA) or the Kepware client API (for OPC DA). This is the recommended path if door control is being embedded into a larger building management application.

For platform-agnostic PC-to-PLC integration beyond Siemens, AutomationDirect publishes a reference video "CLICK PLC - How to Establish PC to PLC Communications" (AutomationDirect support video) illustrating the same general pattern for the CLICK series. The S7-300 variant uses the Siemens TCP/IP driver instead of Modbus but the architecture is identical.

Verification and Commissioning Checklist

  1. ping <PLC_IP> from the PC command prompt. Successful reply confirms layer-3 reachability.
  2. From STEP 7 / TIA Portal, Go Online with the CPU. Confirms bidirectional traffic and gives access to the diagnostic buffer.
  3. In the OPC server configuration, force a known value (e.g., Door_01_Command = 1) and confirm the corresponding DO LED on the SM322 module illuminates within one scan cycle.
  4. Place a voltmeter on the door actuator terminals; verify 24 V DC appears within the configured OPC scan rate plus one PLC cycle.
  5. Run the OPC test client (OPC Scout for SIMATIC NET, Quick Client for Kepware). Verify Quality = Good on every tag and that the value updates when forced.
  6. Force a PLC fault (e.g., simulate a wire break on the DI by disconnecting the field terminal). Verify the OPC client sees the input transition within the scan rate.
  7. Disable the network connection between PC and PLC. Verify the OPC client sees Quality = Bad within the configured timeout (typically 5 - 10 s for TCP keepalive).
  8. Capture a screenshot of the OPC test client, the OPC server configuration file, and the STEP 7 hardware configuration for the as-built record.

Troubleshooting Matrix

Symptom Likely Cause Resolution
OPC Quality = Bad on all tags, ping works PUT/GET access disabled on CPU, or wrong rack/slot Enable PUT/GET in CPU Protection; verify rack/slot in driver device properties against HW config
Quality = Bad intermittent Duplicate IP on PROFINET subnet, ARP storm, or unmanaged switch flooding Confirm unique PLC IP; isolate PC and PLC on a managed switch or dedicated VLAN
Tags read fine, writes have no effect DB write protection in CPU; wrong DB number; tag address not byte-aligned Check DB attributes in STEP 7; confirm DB is not optimized; verify DB number and byte/bit offset
OPC server crashes after 2 hours Kepware running in demo mode (2-hour time bomb) Apply a runtime license; demo mode is for evaluation only
OPC DA client cannot enumerate server across workgroup boundary DCOM permissions on Windows Configure DCOMCNFG with explicit launch/access permissions, or switch to OPC UA to bypass DCOM entirely
Tags update slowly (> 2 s scan) Excessive tag count per scan or non-contiguous DB blocks Group tags into contiguous DB blocks; lower per-group scan rate; use block read where the driver supports it
"Cannot connect to PLC" with Siemens MPI driver Wrong MPI address, PC Adapter not enumerated, or terminating resistor missing Verify MPI address (default 2 for CPU); confirm PC Adapter is visible in driver diagnostic page; check bus terminator
OPC UA discovery returns Bad_ServerUriInvalid Wrong endpoint URL or firewall blocking TCP 4840 Use opc.tcp://<PLC_IP>:4840 exactly; open TCP 4840 inbound on the PC firewall

Field-Proven Recommendations

For a building door-control application with an existing S7-300, choose the path that matches your organization:

  • Siemens-only shop, STEP 7 or TIA Portal already loaded: use SIMATIC NET + S7 OPC Server. Lowest incremental cost, best diagnostics integration, native WinCC option, OPC Scout as the commissioning tool.
  • Mixed-vendor shop with a long history of HMI/SCADA: use Kepware KepserverEX with the Siemens TCP/IP Ethernet driver. Wide driver library, well-documented, OPC UA path forward.
  • Single-purpose PC application written in-house: use OPC UA on Kepware or SIMATIC NET, with a .NET Standard or .NET 8 client. Avoid OPC DA unless the team is fluent in DCOM.
  • New construction: specify S7-1500 instead of S7-300. Native OPC UA server in CPU firmware, no separate OPC server license for basic use, broader long-term support horizon.

Plan for network segmentation: put the PC-to-PLC link on a dedicated VLAN or industrial switch. Door control is a security-relevant function, and OPC DA in particular uses DCOM which is brittle across routed enterprise networks. OPC UA on a dedicated subnet with explicit firewall rules is the most robust long-term architecture.

FAQ

Can I use the Siemens USB programming cable (PC Adapter USB A2) to run OPC traffic to the S7-300?

No. The PC Adapter USB A2 (6ES7972-0CB20-0XA0) is designed for STEP 7 / TIA Portal programming traffic, not high-rate OPC polling. Most third-party OPC servers do not support it natively; they require a Siemens CP card (CP 5611 / 5612 / 5621) or an Hilscher CIFX card to act as the PROFIBUS or MPI master. For new PC-to-PLC links use PROFINET and a standard NIC.

Do I need a separate license for the Siemens SIMATIC NET S7 OPC Server?

SIMATIC NET PC Software ships with the S7-OPC Server. The license is keyed to the PC station and to the CP or softnet license used (S7-1613 / S7-1623 are the standard softnet license SKUs). If you already own STEP 7 or TIA Portal, the incremental cost of running an OPC server is typically limited to the softnet license.

Why do all my OPC tags show Quality = Bad even though ping to the PLC works?

The most common cause is PUT/GET access disabled on the CPU. In STEP 7 / TIA Portal, open the CPU Properties -> Protection tab and enable "Permit access with PUT/GET communication from remote partner (PLC, HMI, OPC, ...)." Without this flag the S7-300 rejects all external read/write requests at the protocol level. Second most common cause is wrong rack/slot in the OPC server device properties.

Is OPC UA supported natively on the S7-300 CPU firmware?

No. The S7-300 CPU firmware does not include a native OPC UA server. OPC UA access to an S7-300 is provided by an OPC server running on the PC (SIMATIC NET OPC UA Server, Kepware KepserverEX with the IoT Gateway or native UA server, MatrikonOPC, or Softing). For native OPC UA server support, specify an S7-1500 CPU.

What is the cheapest credible path for a small S7-300 door-control project?

For a single PLC with tens of tags and a PC that already runs STEP 7 or TIA Portal, the cheapest credible path is SIMATIC NET with the bundled S7-OPC Server, OPC Scout for commissioning, and a small custom client (VBA via the OPC Automation Wrapper for ad-hoc use, or .NET OPC DA for production). Expect $0 incremental software cost on the engineering station plus the softnet license (a few hundred USD). For a brand-new PC and a single-purpose application, Kepware KepserverEX is comparable in cost and dramatically better-documented.

Back to blog