Configuring Siemens OP7 Communication with S5-135U CPU 948

David Krause13 min read
HMI / SCADASiemensTutorial / 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

The Siemens OP7 is a text-based operator panel from the SIMATIC HMI product line, designed as a low-cost replacement for the older OP5. When migrating from an OP5 to an OP7 while keeping the existing controller (in this case an S5-135U with CPU 948), the operator panel must still be coupled to the controller through the original AS511 serial protocol. On the S5-135U side, the standard method for handling this communication is to load the function block FB51 (block name TDOP:511, distributed as part of the standard driver file S5TD24ST.S5D) into the CPU. FB51 converts OP/OP7 message frames into S5 data-access operations and back.

This article consolidates the field-proven steps for getting the OP7 online with a CPU 948, including the required software blocks, the AS511 link parameters, the wiring between the OP7 serial port and the S5 CPU's serial interface, and a verification procedure. The original Siemens documentation that describes this link is the manual referenced in the Siemens support database, entry 1137086.

Scope note. The CPU 948 is the high-end processor of the S5-135U family. It has a different firmware base and instruction set than the CPU 928 or CPU 922, which is why some legacy COM packages distributed for the OP3/OP5/OP15/OP25 series continue to work but must be matched to the CPU 948 binary format. FB51 is the matching handler for this controller when the OP7 acts as a passive AS511 terminal.

System Architecture

A point-to-point AS511 link between an OP7 and an S5-135U has three logical layers:

  1. Physical layer – A TTY (20 mA current loop) or RS-232 connection between the OP7's serial port (PG/OP interface) and the CPU 948's IF1/IF2 serial interface module. The S5-135U uses a 15-pin Sub-D front connector on the CPU/CP for COM, while the OP7 exposes a 15-pin PG interface on its rear face.
  2. Protocol layer – The AS511 protocol (also documented as the SIMATIC S5 programming/operator protocol). AS511 is a half-duplex, master/slave protocol; the OP7 plays the role of the master and the CPU 948 is the slave.
  3. Application layer – The S5 program block FB51 on the CPU side, plus the OP7 project generated in ProTool/ProTool Lite or the older GRAPH5/ComText toolchain. FB51 is responsible for converting the OP7 area requests (e.g., output fields, input fields, status displays) into S5 data block reads/writes.

Prerequisites

Before commissioning, confirm the following items are present:

Item Detail
Controller SIMATIC S5-135U with CPU 948 in slot 1 of the central/expansion rack
HMI SIMATIC OP7 (3.5" or 5.7" monochrome variant, any firmware branch that supports AS511)
Driver file S5TD24ST.S5D – standard driver disk from the OP7 ProTool/ProTool Lite distribution, or from the OP7 COM package
Function block FB51 (symbolic name TDOP:511) – must match the CPU 948 code format
Serial cable OP7 to S5-135U point-to-point cable, TTY (20 mA) or RS-232, end connectors 15-pin Sub-D male on the S5 side, 15-pin Sub-D male on the OP7 side (verify pinout against the manual cited above)
PG/PC tool STEP 5 (STL or LAD/FBD editor) for downloading the block; ProTool/ProTool Lite or older ProTool/ProTool for OP7 for designing the screens
Power 24 V DC supply for the OP7; the S5-135U is powered by the 115/230 V AC rack PSU
Note on the OP5 → OP7 migration. Because the OP7 is a drop-in replacement for the OP5 from a project-file and connector standpoint, the wiring harness, the PLC program structure, and the FB51 instance can typically be reused. The difference between the two operator panels is the screen type and firmware; the COM behavior on the S5 side does not change, which is why FB51 remains the correct block.

FB51 — The Standard OP-Com Handler

FB51 (block name TDOP:511) is delivered as part of the standard driver package S5TD24ST.S5D. It is a standard software block, not a user-written function. Its role is to:

  • Receive the AS511 request frames sent by the OP7 master.
  • Decode the request (read data word, write data word, read DB, write DB, etc.).
  • Issue the equivalent S5 internal read/write calls against the operand areas that the OP7 project references.
  • Return the response (or an error code) back over the serial link.

FB51 is called periodically by the S5 user program, conventionally in OB1 (or in a time-driven OB such as OB10/OB13 if the OP traffic is to be offloaded from the free-cycle scan). The block has a fixed set of input/output parameters; the only field that may need adjustment is the interface number and the baud rate expected by the OP7. Default AS511 parameters for an OP7 are:

Parameter Value
Baud rate 9600 bit/s (some OP7 firmwares also allow 19200)
Data bits 8
Parity Even
Stop bits 1
Handshake None on the OP7 side; current-loop or XON/XOFF depending on the cable

Loading FB51 into the CPU 948

  1. Start STEP 5 and go online with the CPU 948 over the programming port.
  2. Open the S5TD24ST.S5D file from the project file manager.
  3. Verify that the block FB51 listed in the file shows the CPU 948 signature (i.e., the block was built for the 948 code path). The OP7 driver set is supplied in CPU-specific variants; using the wrong variant produces a STACKS error at the first call.
  4. Transfer FB51 into the S5 program memory and document its DB/DBW instance assignments.
  5. Add the FB51 call to OB1 with the required parameter block (an instance DB such as DB51 for the OP7). A minimal STL fragment is shown below.
// OB1 (CPU 948 STL)
// Cyclic OP7 handler
//
      JU   FB51
NAME : TDOP:511
DBNR : DB51        // instance data block for OP7
SSNR : 0           // 0 = IF1, 1 = IF2 on the S5-135U
A-NR : 0           // 0 = first OP on this interface
PAFE : F0.0        // operator-error flag (user-defined)
Tip. If the existing program already calls FB51 against a different OP number, the OP7 may be re-issued the same number. In that case, you do not need to change the call; you only need to make sure the OP7 has been configured with that same OP number on the OP7 side (typically via ProTool/ProTool Lite setup).

AS511 Protocol Summary

AS511 is the proprietary point-to-point protocol used by SIMATIC S5 controllers and their operator/programmer devices. It uses a single character with an even parity bit and a start/stop bit pair. The OP7 acts as the master:

  • The OP7 initiates every transaction.
  • The CPU 948 only ever replies.
  • There is no collision handling – only one OP or PG can be on the bus at a time.
  • Each request has a known turnaround, so a watchdog timer at the OP7 is used to flag a lost slave.

Because the link is single-master, the OP7 takes the place of the previous OP5 without any controller-side change. If a PG (STEP 5 programmer) is plugged into the same interface, the OP7 traffic will be interrupted, and the PG will have to be unplugged for the OP7 to resume.

Wiring the OP7 to the CPU 948

The S5-135U's CPU 948 exposes the same 15-pin Sub-D front connector used by the rest of the S5-135U family. The OP7's PG/OP port is also a 15-pin Sub-D. The cable is point-to-point, with no termination, and is generally supplied by Siemens as the OP5/OP7 standard cable (often catalog 6ES5 731-… or 6ES7 901-… depending on vintage). When you build or re-pin a cable, the following general rules apply:

  • Use a shielded cable, shield grounded at one end only (typically the cabinet/ground bar end).
  • Keep the cable away from VFD power conductors and other noisy sources; the AS511 link is sensitive to common-mode noise on the 20 mA loop.
  • Maximum cable length is a few hundred meters on TTY (20 mA) and roughly 15 m on RS-232; the OP7 typically uses the RS-232 variant internally, so plan on staying under 15 m unless the installation includes a TTY isolator/repeater.
  • If the OP7 is mounted in the cabinet door, leave a service loop so the door can be opened without straining the connector.
Pinout disclaimer. The exact pin mapping (e.g., whether pins 11/13 form the active 20 mA loop or whether pins 2/3/5 carry the RS-232 signals) depends on whether the cable is a TTY version or an RS-232 version. Always confirm against the diagram shipped with your specific OP7 cable and the S5-135U manual entry linked in this article.

Configuring the OP7 Project

The OP7 project is created in ProTool/ProTool Lite (or the older GRAPH5 / ComText tool, depending on the firmware level of the OP7). The relevant configuration items are:

  1. Controller selection – Choose SIMATIC S5 – AS511 as the controller type. Do not choose SIMATIC S5 – AS511 V2 unless the CPU 948 firmware has been verified to support the V2 extensions; the safer default is the original AS511.
  2. Interface – IF1 on the CPU 948 side, or the equivalent on the OP7 side, with the baud/parity/stop bits set to the values in the table above.
  3. OP number – Set the OP number to the value referenced by the A-NR parameter in the FB51 call (0 by default for the first OP on IF1).
  4. Area pointers – Define the area pointer for area pointers, status, messages, and any curves you intend to use. These map onto DBs that FB51 will subsequently read or write.
  5. Compile and transfer – Compile the project to the OP7 firmware and transfer it to the panel over the same serial port, or via a separate transfer cable depending on the tooling in use.

Verifying the Link

After loading FB51 into the CPU 948 and the project into the OP7, bring the controller to RUN with the OP7 powered up. Verify in this order:

  1. OP7 boots and shows the project screens (not the "no project" or "wait for master" message).
  2. No PLC stop on first FB51 call. If the CPU 948 goes to STOP and the stacker lists a parameter error in FB51, the most common cause is a mismatched FB51 variant. Re-check the block's CPU signature against the 948.
  3. Online test from PG. Connect a PG to the CPU 948's IF1 and use Test/Status Variable to flip a flag. The corresponding OP7 bit should follow in real time. This confirms that the read direction (CPU → OP) works.
  4. Input from OP7. Use the OP7's input-field screen to write a value to a DBW. Verify in STEP 5 that the value lands in the correct DB and DBW. This confirms the write direction (OP → CPU).
  5. Alarm/Message screens. Trigger a message condition in the S5 program; the OP7 should display the message bitmap and the message number.

Fault-Code Reference

Although FB51 does not surface a single human-readable error code, the CPU 948 stacker and the OP7 firmware each give useful pointers. The most frequent conditions encountered in the field are summarized below.

Symptom Likely cause First check
OP7 stays on "Wait for link" / "No link" Cable, baud rate, or OP number mismatch Verify cable pinout; confirm 9600/8E1 on both sides; check OP number
CPU 948 enters STOP on first OB1 scan FB51 called with wrong SSNR or wrong block version Check FB51 signature; re-load FB51 from the CPU 948-compatible driver file
OP7 reads DB values but does not write back Area pointer assignments do not include a writable area Re-check area-pointer configuration in the OP7 project
PG and OP7 interfere with each other Single-master AS511 limitation Plug PG only when OP7 is not in operation, or use a CP for the PG
Intermittent timeouts after a few hours EMI on the serial cable, especially near VFD outputs Re-route the cable; bond the shield at one end only
OP7 displays a status code (e.g., 0x10, 0x12) OP7 firmware-specific AS511 status Cross-reference the OP7 status code list in the OP7 manual

Performance and Scan-Time Considerations

FB51 is called once per OB1 pass, but the AS511 turnaround takes on the order of a few milliseconds per request at 9600 bit/s. With a small OP7 project (tens of variables), the link is comfortably under 100 ms total round-trip, so a polled screen update looks near-instant to the operator. If the OP7 project is large (hundreds of variables, plus a curves log), the OP7 firmware will itself throttle requests, and the user will notice a few hundred milliseconds of latency. CPU 948 scan time is rarely the bottleneck – the AS511 link is.

Migration Notes and Field Tips

  • Same FB51 works. The OP7 is binary-compatible with the OP5 at the COM layer, so an existing FB51 call in OB1 of the CPU 948 program can typically be left untouched after the panel swap.
  • Project reuse. An OP5 ProTool/ComText project will not load into the OP7 directly. The screen definitions and area pointers must be re-compiled under ProTool/ProTool Lite for the OP7 firmware. The variable addresses in the S5 program, however, are preserved.
  • Memory in the CPU 948. FB51 occupies a small fixed footprint; if you have an instance DB (e.g., DB51), make sure it is not used by the user program for any other purpose.
  • Watch the power supply. A common field failure on OP5→OP7 retrofits is a 24 V DC rail that was sized only for the OP5 (lower backlight current). The OP7 with a 5.7" screen draws more current, so a 24 V rail that was marginal on the OP5 will drop out on the OP7. Check PSU sizing before commissioning.

Step-by-Step Commissioning Checklist

  1. Confirm the S5-135U is on, the CPU 948 is in RUN with the existing user program, and no faults are present.
  2. Open STEP 5, go online, and verify that FB51 (block name TDOP:511) is already present. If not, load it from S5TD24ST.S5D matching the CPU 948 variant.
  3. Confirm OB1 contains a call to FB51 with the appropriate instance DB and SSNR/A-NR parameters.
  4. Power up the OP7, connect the serial cable to IF1 on the CPU 948.
  5. Transfer the OP7 project (compiled in ProTool/ProTool Lite for the OP7 firmware).
  6. Watch the OP7 boot into the project screens.
  7. From a PG, force a value in the CPU and confirm it appears on an OP7 output field.
  8. From the OP7, change an input field and confirm the value lands in the expected DBW.
  9. Trigger an alarm condition and confirm the OP7 displays it.
  10. Document the OP7 project name, firmware version, and the FB51 instance DB number in the panel drawing set.

FAQ

Can I keep the same FB51 call in OB1 when I swap an OP5 for an OP7 on a CPU 948?

Yes. The OP7 behaves like an OP5 at the AS511 link layer, so an existing FB51 call against DB51 (or whichever instance DB is in use) with the same SSNR and A-NR values will handle the OP7 traffic without code change. Only the panel-side project has to be recompiled for the OP7 firmware.

Which file contains FB51 for the S5-135U with CPU 948?

FB51 (block name TDOP:511) is delivered as part of the standard driver file S5TD24ST.S5D, which is shipped on the OP7 COM package disk or the ProTool/ProTool Lite distribution. Make sure the FB51 inside that file is the CPU 948 binary variant – using the wrong variant leads to a stacker error on the first call.

Do I need a CP module or can I plug the OP7 directly into the CPU 948?

For a single OP7 on a point-to-point AS511 link, the OP7 can be plugged directly into the CPU 948's built-in serial interface (IF1 or IF2). A CP (e.g., a CP 521 SI or CP 523) is only required if you need multiple OPs, an MPI-style multi-drop, or a different physical layer such as RS-485.

What baud rate should I use for OP7 / CPU 948 communication?

The conventional AS511 setting for an OP7 against a CPU 948 is 9600 bit/s, 8 data bits, even parity, 1 stop bit. Some OP7 firmwares also support 19200 bit/s, but the default project template uses 9600 to keep the link robust over the existing OP5-era cabling.

Where can I find the official Siemens manual for this link?

The original Siemens entry that documents the OP7 / S5-135U / CPU 948 / FB51 combination is Siemens support entry 1137086. Use it as the primary reference for the cable pinout and the FB51 parameter set, and confirm any specific wiring against the OP7 cable drawing shipped with your hardware.

Back to blog