Sinumerik 840C PLC Interface: STEP5 RS232 Connection Guide

David Krause12 min read
Serial CommunicationSiemensTutorial / 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

Sinumerik 840C PLC Interface to PC with STEP5 V7.23 over RS232

The Sinumerik 840C is a CNC controller whose integrated PLC is a derivative of the Simatic S5 family. The CPU mounted inside the 840C is functionally identical to a standard S5 PLC (commonly the CPU 130W or CPU 150 family), with the addition of NC-specific data blocks and I/O mappings. Because the PLC portion of the 840C is a stock Simatic S5, it can be programmed, monitored, and diagnosed with the original Siemens STEP5 package — no NC-specific offline editor is required for pure PLC work.

Online communication between a PC and the 840C PLC is performed over the AS511 protocol carried on a serial physical layer. This guide covers hardware selection, the correct 25-pin cable pinout, STEP5 V7.23 commissioning, and the recovery of the common "Undefined Character from AS" fault reported when the wrong converter or the wrong pinout is in use.

1. System Overview and Architecture

The 840C control consists of three logical subsystems:

  • NC kernel (residing in the NC-CPU).
  • PLC subsystem (residing on the S5 CPU board, slot-based I/O backplane).
  • HMI / MMC panel.

The PLC subsystem communicates with the NC kernel over a dual-port RAM. For external engineering access, the PLC side exposes a serial interface on the back of the 840C housing. That interface is wired as RS232 (V.24) on a 25-pin D-sub female connector, not as a 20 mA TTY current loop. This is the single most important fact when troubleshooting connectivity: a TTY converter is not required for the 840C PLC port — the port is already a true RS232 (V.24) interface.

Field note: The Sinumerik 840C PLC port is a standard RS232 V.24 port (25-pin female), unlike many S5 CPUs of the same era which offered a TTY (20 mA) connector. Using a 15-pin TTY converter in line with the 840C's 25-pin RS232 port will either fail to handshake or produce the "Undefined Character from AS" error in STEP5.

2. Prerequisites

Item Specification
Engineering PC Laptop or desktop with a native RS232 (COM1/COM2) port. USB-to-serial adapters are unreliable with STEP5 and AS511 and should be avoided for first-time commissioning.
Operating System Windows XP SP3 is the most reliable platform for STEP5 V7.23. Windows 2000 works; Windows 7 32-bit is acceptable with compatibility shim; 64-bit Windows is unsupported.
STEP5 Software STEP5 V7.23 (or V7.2x) installed with the S5-DOS-ST or STEP5 / Win package.
Cable 25-pin male to 9-pin female (PC) or 25-pin male to 25-pin female (older PC) RS232 cable, wired straight-through on the relevant signal lines only (see Section 4).
Converter None required for the 840C PLC port. Do not insert the 15-pin TTY converter.

3. Hardware Identification — Locating the PLC Port on the 840C

The PLC programming interface is a 25-pin female D-sub connector located on the rear of the 840C chassis, distinct from the operator panel connector and the NC service port. In most installations it is labelled X1 or X121 on the backplane silk-screen. The pin numbering is the standard TIA-574 / ISO 2110 layout:

Pin (840C, 25-pin female) RS232 Signal Direction (PC ↔ PLC)
2 TXD (Transmit Data) PC → PLC
3 RXD (Receive Data) PLC → PC
4 RTS (Request to Send) PC → PLC
5 CTS (Clear to Send) PLC → PC
6 DSR (Data Set Ready) PLC → PC
7 Signal Ground (SGND) —
8 DCD (Data Carrier Detect) PLC → PC
20 DTR (Data Terminal Ready) PC → PLC
1, 9–19, 21–25 Not connected —

4. Cable Wiring (25-pin 840C ↔ 9-pin PC)

The cable is a straight-through 3-wire RS232 link with hardware handshaking loops. The PC's DTR/DSR and RTS/CTS pairs are looped back at the PC end to satisfy the AS511 driver's expectation of a fully wired modem interface.

4.1 Recommended 25-pin (840C) to 9-pin (PC) pinout

Signal 25-pin (840C PLC) 9-pin (PC COM)
TXD 2 2
RXD 3 3
RTS 4 7
CTS 5 8
DSR 6 6
SGND 7 5
DCD 8 1
DTR 20 4

Loops at the PC end (solder bridges inside the 9-pin hood):

  • Pin 4 (DTR) ↔ Pin 6 (DSR) — local handshake loop.
  • Pin 7 (RTS) ↔ Pin 8 (CTS) — local handshake loop.
The local loops on the PC side are mandatory. STEP5's AS511 driver interprets the absence of CTS/DSR as a "modem not ready" condition and aborts the connection before any PLC telegram is exchanged.

4.2 25-pin (840C) ↔ 25-pin (older PC or Siemens PG) pinout

Signal 25-pin (840C PLC) 25-pin (PC COM)
TXD 2 3
RXD 3 2
RTS 4 5
CTS 5 4
DSR 6 20
SGND 7 7
DCD 8 8
DTR 20 6

This is a true crossed-cable layout (TX/RX and RTS/CTS/DSR/DTR swaps). It corresponds to the wiring used by the original Siemens PG685/PG720 programming consoles and works with any PC that has a 25-pin COM port.

5. STEP5 V7.23 COM-Port Configuration

STEP5 reads its serial parameters from S5CONV.S5P or from the Online dialog. The default AS511 parameters for an S5-CPU are fixed; on the PC side you only need to set the baud rate, parity, and COM number.

Parameter Value (PC side)
COM port COM1 (or whichever the cable is plugged into; set in Control Panel → Ports)
Baud 9600 bit/s
Data bits 8
Stop bits 1
Parity Even
Protocol AS511 (no other protocol is supported on this port)

The baud rate is not adjustable on the 840C PLC side — it is fixed by the CPU firmware. Do not attempt to change it; STEP5 will not negotiate. The PLC sends its 11-bit frame (8E1) at 9600 bit/s on cold connection, and STEP5 auto-synchronises.

6. Step-by-Step Connection Procedure

  1. Power down the 840C. Locate the 25-pin PLC port on the rear of the unit (typically labelled X1 / X121).
  2. Verify the connector is 25-pin female on the 840C side. If a 15-pin female is present, that is the NC service port, not the PLC port.
  3. Connect the cable described in Section 4 between the 840C and the PC COM port. Do not insert the RS232-to-TTY (15-pin) converter; the 840C PLC port is V.24.
  4. Power up the 840C. Wait for the PLC to complete its cold-restart sequence (the "Run" LED on the PLC-CPU card stays solid when ready).
  5. Boot the PC into Windows XP, log in as Administrator.
  6. Verify the COM port in Control Panel → System → Device Manager → Ports (COM & LPT). Note the COM number.
  7. Start STEP5 V7.23.
  8. Select Project → Set → Interface (or the equivalent in your localized STEP5 build). Choose AS511 and the COM port number from step 6. Leave baud at 9600, parity Even, 8 data, 1 stop.
  9. Select Online → Connect to PLC (or press the corresponding function key).
  10. STEP5 sends the AS511 init telegram; the PLC replies with its system message including the CPU type, firmware version, and total I/O count.
  11. If the handshake is successful, STEP5 displays the connected CPU in the status bar and the online blocks can be browsed.

7. Troubleshooting: "Undefined Character from AS"

The error "Undefined Character from AS" (or its localized equivalent) indicates that the PC received one or more bytes from the PLC's serial line that did not match the AS511 frame format. The fault is almost always at the physical layer; PLC firmware and STEP5 code are correct by construction.

Likely Cause Symptom Confirmation Remediation
RS232-to-TTY converter in line 25-pin male on the 840C side is being fed into a 15-pin TTY device Remove the 15-pin TTY converter. The 840C PLC port is V.24 RS232 native.
Crossed / straight-through mismatch TX/RX swapped — STEP5 receives its own echo Re-wire per Section 4.1 or 4.2 according to the PC COM connector.
Missing PC-side handshaking loops CTS / DSR low; driver aborts the read Add the bridge pairs 4↔6 and 7↔8 inside the 9-pin connector shell.
USB-to-serial adapter Bit timing jitter, dropped characters at 9600 bit/s Use a laptop with a real RS232 (DB9 or DB25) port, or a PCMCIA RS232 card.
Wrong COM port number selected in STEP5 Driver is reading from an idle / open port Verify in Device Manager. Some laptop BIOSes remap COM1 to COM3.
Baud / parity mismatch Constant framing errors at the UART STEP5 must be 9600, 8E1. Do not change.
Shield not grounded on one end Intermittent on long runs, OK at short length Bond the cable shield at the PC end only. Use ≤ 15 m cable.
PLC in STOP with hardware fault PLC "Run" LED off, error LED on Resolve the hardware fault first; the PLC will not respond to AS511 in hard-stop.
Another engineering tool holding the port Port appears open in Device Manager with a "In Use" flag Close ProTool, WinCC flexible, or any other COM client.
Important: A USB-to-serial adapter is the single most common cause of "Undefined Character from AS" on modern laptops. STEP5's AS511 driver uses polling on the UART and does not tolerate the 1–2 ms latency that most USB-CDC chips introduce on Windows XP. Use only a native RS232 port, or a PCMCIA/ExpressCard RS232 card based on the Oxford OX16C950 or compatible high-performance UART.

8. Why the TTY Converter Fails on the 840C

Many S5 CPUs of the same generation expose a 15-pin TTY (20 mA current loop) connector on their programming port. To connect them to a PC, an active or passive RS232-to-TTY converter is required. The TTY converter inserts an opto-isolated current loop driver between the PC and the S5.

The Sinumerik 840C breaks this rule. Its PLC port was engineered as a V.24 (RS232 level) port specifically so that an engineering laptop with a native COM port could be plugged in without converter hardware. When the user inserts a TTY converter between the 840C and the PC, two issues arise:

  1. The TTY converter expects to source the 20 mA current loop. The 840C's RS232 driver does not generate a current loop — it drives ±12 V levels. The converter therefore idles with no signal, and any noise on the line is interpreted as an undefined character by the STEP5 AS511 driver.
  2. The handshake pairs on a TTY converter (pin 4 RTS / pin 20 DTR on the 25-pin side) are usually looped. But the absence of a clean carrier from the 840C means STEP5 never receives the AS511 init response, and the driver eventually times out and reports the undefined-character error.

Conclusion: bypass the 15-pin TTY converter entirely on the 840C.

9. Verification Checklist

After a successful online connection, the following items should be confirmed before starting any online editing or download:

  • STEP5 status bar shows "Online – CPU 130W" (or the actual CPU type string returned by the PLC).
  • Block list populated: at least the OB1, OB21, OB22, FB/FC/DX/DB directories appear.
  • Force table accessible: Online → Force/Set returns a "VAR" header without error.
  • Diagnostic buffer readable: Online → Module Information → Diagnostic Buffer lists the most recent restart events.
  • Scan time visible: Online → Module Information → Scan Cycle Time returns a numeric value in ms.

10. Common Edge Cases and Field Notes

ESD / Backplane Lock-up: Connecting a serial cable to a powered 840C occasionally stalls the PLC scan if the PC ground and the cabinet ground differ by more than a few volts. If the PLC goes to STOP immediately after plugging the cable, lift the cable shield bond at the PC end and re-test.

NC Key Switch in the Wrong Position: Some 840C builds lock the PLC programming port when the NC key switch is in position 0. Turn the key to position 1 or higher before attempting online access.

STEP5 Project Mismatch: STEP5 V7.23 will refuse to write blocks whose number is already in the offline project but does not match the online content. The error is not "Undefined Character" but rather a block-comparison warning. Use Online → Block Comparison to identify differences before downloading.

Hot Plug During Cold Restart: If the PLC is mid cold-restart (the S5 "OB21 / OB22" phase) when the PC connects, the AS511 driver may issue a connection timeout. Wait 30–60 s after the "Run" LED is solid before starting STEP5 online.

Multiple COM Ports on Laptops: Many business laptops have COM1 disabled in the BIOS to free IRQ 4 for an IR port. Enable the COM port in BIOS before expecting STEP5 to find it.

11. Quick Reference

Question Answer
Is a TTY converter required? No. 840C PLC port is RS232 V.24 on a 25-pin female D-sub.
What is the connector on the 840C? 25-pin female (DB25F).
What is the AS511 baud rate? 9600 bit/s, fixed by PLC firmware.
What is the format? 8 data bits, Even parity, 1 stop bit (8E1).
Can I use a USB-to-serial adapter? Not recommended. Use a native RS232 or a PCMCIA RS232 card.
What OS should I use? Windows XP SP3 (best), Windows 2000, or Windows 7 32-bit with compatibility.
What is the "Undefined Character from AS" error? Frame/handshake error at the physical layer. Remove TTY converter, check pinout, add PC-side handshake loops, use native COM port.

What causes the "Undefined Character from AS" error in STEP5 V7.23 with a Sinumerik 840C?

The error is a physical-layer frame fault: the PC's AS511 driver received bytes that did not match the 9600 bit/s, 8E1 AS511 frame. The most common causes are (1) an RS232-to-TTY (15-pin) converter left in the line, (2) crossed instead of straight-through wiring, (3) missing PC-side handshake loops (bridge pins 4↔6 and 7↔8 on the 9-pin shell), or (4) a USB-to-serial adapter with too much latency. Remove the TTY converter, re-wire per the 25-pin pinout, and use a native COM port.

Do I need a TTY converter to connect a laptop to the Sinumerik 840C PLC?

No. The 840C PLC programming port is a true RS232 (V.24) interface on a 25-pin female D-sub, not a 20 mA TTY current loop. Plug the PC COM port directly into the 840C with a correctly wired 25-pin cable. A TTY converter is only required for older S5 CPUs (S5-95U, S5-100U) that expose a 15-pin TTY port.

What serial parameters should be set in STEP5 V7.23 for the 840C?

Set the interface to AS511, COM1 (or whichever native COM port is in use), 9600 bit/s, 8 data bits, Even parity, 1 stop bit. The baud rate and frame format are fixed by the 840C PLC firmware; STEP5 will not negotiate. Do not change them.

Which Windows version is supported for STEP5 V7.23 with the 840C?

Windows XP SP3 is the most reliable. Windows 2000 is supported. Windows 7 32-bit can be used with the compatibility shim. Windows Vista, Windows 7 64-bit, Windows 8/10/11 are not officially supported and frequently produce AS511 handshake errors.

Can I use a USB-to-serial adapter with STEP5 V7.23 and a Sinumerik 840C?

Not reliably. The AS511 driver in STEP5 polls the UART synchronously and is intolerant of the 1–2 ms latency introduced by typical USB-CDC chips (FT232, CH340, CP2102). If a native RS232 port is unavailable, use a PCMCIA or ExpressCard RS232 card based on a high-performance UART such as the Oxford OX16C950. The card should be configured to 9600 8E1 in Device Manager before launching STEP5.

Back to blog