Troubleshooting S7-1200 RCV_PTP RS232 Weighing Scale Data Loss

David Krause13 min read
S7-1200SiemensTroubleshooting
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

Problem Profile: RCV_PTP Returns No Data from RS232 Weighing Scale

Field experience with the SIMATIC S7-1200 PTP receive path is consistent: the RCV_PTP instruction is wired into OB1, the module reports no fault, the STATUS word returns 0x0000, and yet no bytes are copied into the receive buffer. The same characters visible in a Windows HyperTerminal session on the same COM port never appear in the instance DB. The symptom is independent of the weighing scale brand (Mettler-Toledo, CAS, Avery Berkel, Cardinal, GSE, Rice Lake, etc.) and points to one of five recurring classes of mismatch between the Windows terminal session and the PLC configuration: cable topology, interface configuration, receive trigger, buffer management, and termination character handling.

This reference walks through the diagnostic path for each class, with the parameter names, register/tag addresses, firmware versions, and SCL code fragments used in TIA Portal V15.1 through V18. It assumes the SIMATIC S7-1200 Programmable Controller System Manual and the CM 1241 Communication Module Manual are available as the primary reference, and builds the practical debugging procedure on top of them.

System Architecture for RS232 Weighing Scale Communication

The S7-1200 does not include an onboard RS232 port on the CPU body. RS232 communication requires a CM 1241 communication module installed on the left side of the CPU. The relevant part numbers are:

Module Order Number Interface Ports Typical Use
CM 1241 RS232 6ES7241-1AH32-0XB0 DB9 male, DTE 1 Weighing scale, barcode reader, modem
CM 1241 RS232 6ES7241-1AH30-0XB0 DB9 male, DTE 1 Legacy firmware, lower baud rates
CM 1241 RS485 6ES7241-1AF30-0XB0 DB9 male 1 Half-duplex, not used for RS232 scales
CB 1241 RS485 6ES7241-1CH30-1XB0 Board-type 1 RS485 only
Only the CM 1241 RS232 (6ES7241-1AH32-0XB0) is applicable for direct RS232 connection to a weighing scale. Do not confuse the RS485 modules with RS232; the firmware, configuration blocks, and pinout are not interchangeable.

The CM 1241 RS232 supports baud rates of 300, 600, 1200, 2400, 4800, 9600, 19200, 38400, 57600, 76800, and 115200 bit/s. The most common weighing scale defaults are 9600 8N1 (CAS, Cardinal, GSE), 9600 7E1 (older Mettler-Toledo), and 4800 8N1 (Avery Berkel). Match these exactly in both TIA Portal and the Windows terminal session or the symptom will be identical: the terminal decodes the stream, the PLC discards every byte at the framing stage.

CM 1241 RS232 Hardware Setup

Insert the CM 1241 RS232 into the left bus of the CPU until the side connector locks. Power-cycle the CPU so the new module is detected, then confirm its presence in the device view of TIA Portal. Open the module's properties and verify the following before any PTP instructions are placed:

  1. Hardware identifier — record the HW-ID displayed in the module properties. The CM 1241 RS232 typically assigns HW-ID 269 (decimal) when mounted in the first slot. This value is required as the PORT input of RCV_PTP.
  2. Module diagnostics enabled — enable Diagnostics under the module's properties so that wire-break and frame errors surface as diagnostics events in the online diagnostics view.
  3. Receive line initial state — for RS232 with RTS/CTS handshake, set RTS to ON in the idle state if the scale requires the handshake line asserted to begin transmission.
If the HW-ID is wrong by one digit, RCV_PTP will return STATUS 0x8085 (parameter assignment error) and copy zero bytes. This is the most common first-time configuration mistake.

RS232 Cable Wiring and Null Modem Considerations

The CM 1241 RS232 exposes a DB9 male connector wired as DTE (Data Terminal Equipment). The weighing scale is also DTE. Two DTE devices cannot be connected with a straight-through cable; a null modem (crossover) cable is required. The minimum pinout for a 3-wire application (no hardware handshake) is:

CM 1241 DB9 pin Signal Direction (CM 1241 → Scale) Scale DB9 pin (typical)
2 RxD (Receive Data) ← 3 (Scale TxD)
3 TxD (Transmit Data) → 2 (Scale RxD)
5 Signal Ground ↔ 5 (Scale GND)
7 RTS (Request To Send) → 8 (Scale CTS)
8 CTS (Clear To Send) ← 7 (Scale RTS)

The 2↔3 crossover is the single most common cabling error. HyperTerminal succeeds with a straight-through cable because the PC's COM port is wired as DTE, and the scale is also DTE — both TxD lines drive pin 3 and both RxD lines listen on pin 2. HyperTerminal still works because the application reads whichever physical line the operating system mapped to "receive data." The CM 1241 RS232, by contrast, is hard-wired to the EIA-574 pinout, and pin 3 on its connector is its transmit line, not its receive. If you wire pin 3 to pin 3, the PLC transmits into its own receiver and never sees a byte from the scale.

Field-proven verification:

  1. Disconnect the cable at the scale end.
  2. Use a multimeter in continuity mode between CM 1241 pin 2 (RxD) and the conductor reaching the scale's transmit pin (typically pin 3 on a DB9 scale or pin 2 on a 25-pin scale). A beep confirms the receive path.
  3. Repeat for pin 3 (TxD) — continuity to the scale's RxD.
  4. Confirm pin 5 continuity end-to-end. A missing ground return is the second-most-common cabling error and produces characters that appear with a corrupted high bit at the receiver.
If the scale's documentation lists a 25-pin connector, the receive line is DB-25 pin 3 and the transmit line is DB-25 pin 2. A DB9-to-DB25 null modem adapter must follow the same crossover (2↔3) logic.

TIA Portal Project Configuration

Open the device configuration for the CM 1241 RS232. Under Properties > Port Configuration, set the following parameters to match the weighing scale's datasheet exactly:

Parameter Field in TIA Portal Typical weighing scale value Notes
Baud rate Transmission speed 9600 bit/s Match Windows terminal exactly
Data bits Data bits per character 8 7 only for legacy ASCII-only frames
Parity Parity None Even for Mettler-Toledo continuous mode 7E1
Stop bits Stop bits 1 2 for 9600 8N2 scales (rare)
Flow control Flow control None RTS/CTS only if scale requires handshake
End-of-receive criteria End of receive character 0x0A (LF) Or 0x0D, 0x03 (ETX), or custom
End-of-receive criteria Receive buffer size 1024 bytes Range 1–4096, power-of-2 recommended
End-of-receive criteria Character timeout 4 character times Forces receive to complete when frame stalls

Compile the project and download. Online, open the module's diagnostics buffer to confirm zero active diagnostics alarms. A persistent Wire break alarm at this stage points to a physical layer issue, not a configuration issue — re-verify the cable and the scale's power supply.

RCV_PTP Instruction Programming

The RCV_PTP instruction is part of the Point-to-Point library that ships with TIA Portal. Place the block from Instructions > Communication > Point-to-Point. It generates an instance DB that owns the receive buffer pointer.

Inputs:

  • REQ — boolean trigger, latched. A rising edge starts the receive operation.
  • PORT — HW identifier of the CM 1241 RS232 module. For slot 101 (first CM), this is decimal 269.
  • BUFFER — pointer to a byte array in a global or instance DB. Example: P#DB100.DBX0.0 BYTE 1024.
  • LEN — maximum number of bytes to copy into the buffer per call.

Outputs:

  • DONE — TRUE for one cycle when a frame was received successfully.
  • ERROR — TRUE for one cycle when an error occurred.
  • STATUS — hex status word. 0x0000 means idle/no error. See the STATUS table in the diagnostics section.
  • RCVD_LEN — actual bytes copied into the buffer on the last completed receive.

The canonical SCL block to receive continuously from a weighing scale in a cyclic OB looks like this:

// Weighing scale receive, SCL for use in OB1
IF "Scale_Run" AND "Scale_Trigger_Pulse" THEN
    "RCV_PTP_DB"(REQ := TRUE,
                 PORT := 269,                // HW-ID of CM 1241 RS232
                 BUFFER := P#DB100.DBX0.0 BYTE 1024,
                 LEN := 1024);
    IF "RCV_PTP_DB".DONE THEN
        "Scale_Frame_OK" := TRUE;
        "Scale_Bytes_Received" := "RCV_PTP_DB".RCVD_LEN;
        // Copy bytes to processing area or parse directly from DB100
        "Scale_Trigger_Pulse" := FALSE;     // arm next receive
    ELSIF "RCV_PTP_DB".ERROR THEN
        "Scale_Last_Status" := "RCV_PTP_DB".STATUS;
        "Scale_Trigger_Pulse" := FALSE;     // arm retry
    END_IF;
END_IF;

// Re-arm trigger on rising edge of a heartbeat or scan-cycle flag
IF "Heartbeat_1Hz" AND NOT "Heartbeat_Last" THEN
    "Scale_Trigger_Pulse" := TRUE;
END_IF;
"Heartbeat_Last" := "Heartbeat_1Hz";
The single biggest error observed in the field is calling RCV_PTP only at startup. The instruction enables the receiver for one frame and then idles. The scale transmits continuously, but with no re-trigger the buffer never refills. Always retrigger on DONE, on ERROR, or on a periodic timer.

Protocol Parameter Mapping Between HyperTerminal and TIA Portal

The Windows HyperTerminal session proves that the physical layer and the framing are correct: bytes are arriving at the PC's UART with the right polarity, at the right speed, with the right number of data bits and the right parity. The same five parameters must therefore be set identically in TIA Portal, even though the field names differ:

HyperTerminal field TIA Portal field Byte-level effect
Bits per second Transmission speed UART clock divider
Data bits Data bits per character Length of the LSB-aligned word
Parity Parity Parity bit position and expected value
Stop bits Stop bits Trailing idle bit count
Flow control Flow control RTS/CTS gating or XON/XOFF

If any of these five values diverge by even one parameter, the UART in the CM 1241 will either mis-frame every byte (parity error, framing error) or fail to synchronize to the start bit (baud rate mismatch). HyperTerminal decodes the stream because it is set to the same values the scale is set to. Replicate exactly.

Trigger and Receive Buffer Management

The RCV_PTP instruction only completes a receive when one of three end conditions is met:

  1. Termination character — the configured end-of-frame character (default 0x0A LF) is received. The complete frame, including the termination character, is copied into the buffer.
  2. Buffer full — the configured buffer length is reached. The receive completes with the buffer partially filled. STATUS remains 0x0000.
  3. Character timeout — no new character arrives within the configured timeout (in character times). The CM 1241 assumes the frame ended and copies whatever is in the receive FIFO.

Many weighing scales append CR LF (0x0D 0x0A) at the end of every frame. If the termination character is set to LF only, the trailing CR is copied into the buffer and the frame ends one byte after where it should. Set the termination character to whichever byte the scale appends last, or to a value that the scale's protocol never embeds inside the payload.

Buffer sizing: the receive buffer size in the port configuration sets the maximum frame length the CM 1241 will accept. The LEN input of RCV_PTP sets the maximum number of bytes copied into the instance DB per call. The two values are independent — set both to the same value to avoid truncation.

Diagnostic Procedures and STATUS Word Evaluation

When RCV_PTP completes with ERROR = TRUE, evaluate STATUS against the following table (hex values per the SIMATIC S7-1200 PTP instruction library reference):

STATUS Meaning Corrective Action
0x0000 No error, idle or completed successfully Check RCVD_LEN; if 0, no bytes arrived
0x8085 Parameter assignment error (HW-ID, buffer pointer) Verify PORT matches module HW-ID and BUFFER pointer syntax
0x8088 Sequence error: REQ issued before prior receive finished Wait for DONE/ERROR before re-triggering
0x8183 Frame error (stop bit missing or extra start bit) Match baud rate, parity, data bits to scale datasheet
0x8184 Parity error Parity setting or wiring inversion; check pin 2↔3 crossover
0x8187 Buffer overflow in CM 1241 FIFO Increase character timeout or reduce scale update rate
0x8190 Hardware fault on module Power-cycle, swap module, verify 24 V supply

Add an HMI tag or watch table entry that latches the STATUS value at every ERROR transition. The hex code alone resolves roughly 80% of "no data" symptoms without further instrumentation.

Common Pitfalls and Field-Proven Corrections

Symptom Likely Cause Correction
RCV_PTP STATUS 0x0000 but RCVD_LEN always 0 REQ held high in a single OB1 cycle Use a one-shot pulse on REQ; re-arm on DONE/ERROR
RCVD_LEN cycles between 0 and 1 Buffer overflow at CM 1241 FIFO Increase character timeout or re-trigger faster
Received bytes contain a corrupted high bit Missing ground on pin 5 Verify ground continuity; replace cable
HyperTerminal reads ASCII, PLC reads garbage Pin 2/3 straight-through instead of crossover Re-wire as null modem or use null modem adapter
Works at 9600, fails at 19200 Scale and PLC baud rate mismatch by ±2% Lock both to crystal-derived baud; avoid non-standard rates
Frame ends one byte short Termination character set to wrong byte Set termination to scale's final byte (LF, ETX, etc.)
ERROR 0x8085 immediately on first call Wrong PORT (HW-ID) Read HW-ID from device view, not from documentation
Module not visible in TIA Portal Module not latched or wrong order number Confirm 6ES7241-1AH32-0XB0; reseat module; power-cycle
Receives 16 bytes every 10 seconds instead of continuously Scale is in polled mode, not continuous Send poll command via SEND_PTP first, or change scale mode

Verification Procedure

  1. Place a watch table online with the CM 1241 module. Confirm zero diagnostics alarms.
  2. Create a watch table for the receive DB and the instance DB of RCV_PTP. Observe DONE, RCVD_LEN, and the first 32 bytes of the buffer in real time.
  3. Apply a stable load to the scale and verify a new frame appears in the buffer every cycle of the scale's transmission period.
  4. Decode the buffer bytes as ASCII. Confirm the frame starts with the expected STX (0x02) or sign character and ends with the configured termination character.
  5. Cross-check the gross/net/tare fields against the scale's display. A consistent offset of one byte typically points to a wrong termination character setting; a corrupted high bit points to a ground issue.
  6. Disconnect the cable at the PLC and connect to a laptop running Tera Term or PuTTY with the same parameters. Verify identical bytes are received — if not, the scale itself is the variable.

Frequently Asked Questions

Why does HyperTerminal read the weighing scale but the S7-1200 RCV_PTP receives zero bytes?

HyperTerminal works because the PC COM port and the scale both default to DTE pinout and can often accept a straight-through cable without hardware handshake. The CM 1241 RS232 is hard-wired to the EIA-574 DTE pinout and requires a 2↔3 crossover (null modem). Re-wire or insert a null modem adapter, then verify pin 5 ground continuity. Also confirm the CM 1241 module order number is 6ES7241-1AH32-0XB0 and that the PORT input of RCV_PTP matches the module's hardware identifier (typically decimal 269).

What value should the PORT input of RCV_PTP have for the CM 1241 RS232?

Read the hardware identifier from the module's properties in TIA Portal's device view. For a CM 1241 RS232 mounted in the first slot to the left of the CPU, the HW-ID is typically decimal 269 (hex 0x10D). The exact value depends on the slot count and on whether other CMs are inserted; never assume the documentation value — read it from the online configuration.

How do I trigger RCV_PTP repeatedly in a cyclic OB?

Use a one-shot pulse on the REQ input. Re-arm the trigger on the DONE or ERROR output transition. The canonical pattern is to set a trigger flag from a 1 Hz heartbeat or scan-cycle pulse, run RCV_PTP with REQ=TRUE only on the first scan of that pulse, then clear the trigger when DONE/ERROR fires. Calling RCV_PTP with REQ held TRUE will not start a second receive after the first completes — STATUS will report a sequence error (0x8088).

What does RCV_PTP STATUS 0x8085 mean?

Parameter assignment error. The PORT input is wrong, the BUFFER pointer syntax is wrong, or the CM 1241 module has not been fully configured and downloaded. Verify the HW-ID against the device view, recheck the BUFFER pointer (format P#DB100.DBX0.0 BYTE 1024), and recompile/download the project.

How should the receive buffer be sized for a weighing scale frame?

Set the port configuration buffer size to the maximum expected frame length plus 16 bytes of headroom (typical weighing scale frames are 14–32 bytes; set the buffer to 1024 to be safe). Set the LEN input of RCV_PTP to the same value. If the scale's termination character is configured correctly, each frame will be copied in one RCV_PTP call with RCVD_LEN equal to the frame length.

My S7-1200 receives bytes but every other byte has its high bit corrupted. What is wrong?

Missing ground. The CM 1241 and the scale must share a common ground reference on pin 5 of the DB9 connector. With a floating ground, the receiver thresholds shift and the UART occasionally samples the wrong side of the bit. Verify continuity end-to-end on pin 5, then verify the scale's logic ground is bonded to the panel ground that the CM 1241's 24 V supply returns to.

Back to blog