S7-1500 Send_P2P Receive_P2P Freeport ASCII Troubleshooting

David Krause14 min read
Serial CommunicationSiemensTroubleshooting
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 Overview

Engineers commissioning a SIMATIC S7-1500 CPU 1513-1 PN (6ES7513-1AM02-0AB0) with a CM PtP RS422/485 BA or CM PtP RS422/485 HF (6ES7541-1AB00-0AB0) communication module frequently hit two recurring failure modes when implementing Freeport (ASCII) point-to-point links in TIA Portal V13 SP1 / V14 SP1:

  1. Send_P2P returns no DONE, the TX LED never lights, and no bytes appear on the bus. The PC-side serial sniffer (COM port monitor) confirms zero traffic from the CM.
  2. Receive_P2P latches on STATUS = 16#7002 ("interim call - data transmission running") indefinitely, even though the slave sensor is known to broadcast RS232/RS422 frames continuously at power-up.

Both faults block the entire application even though the hardware is wired, the protocol is selected, and the program logic looks correct. The cause is rarely the cable or the slave device; it is a combination of buffer addressing, instruction instance-data layout, and EN/REQ timing on the Send_P2P / Receive_P2P function blocks.

Important: Freeport (ASCII) is a freely programmable frame-based protocol, also referred to as the ASCII driver. It controls data transmission via start and end identifiers, idle-line time, and fixed/variable character length. The Freeport protocol is documented in the Siemens manual "Configuring Point-to-Point Links S7-1500 / Communication Using Freeport (S7-1500)". See: Data transmission with Freeport (S7-1500).

Affected Hardware, Firmware, and Software

Item Catalog Number / Version Notes
CPU 1513-1 PN 6ES7513-1AM02-0AB0 Firmware V2.0 or higher recommended for CM PtP integration
CM PtP RS422/485 BA 6ES7540-1AB00-0AB0 Basic module; does NOT support Modbus RTU master/slave; Freeport/ASCII only
CM PtP RS422/485 HF 6ES7541-1AB00-0AB0 High-feature; supports Modbus RTU, USS, Freeport/ASCII
CM PtP RS232 HF 6ES7541-1AD00-0AB0 Listed for reference; commonly swapped in field troubleshooting
TIA Portal V13 SP1 / V14 SP1 V14 SP1 added Send_P2P / Receive_P2P multi-instance bug fix; V15+ recommended for production
STEP 7 V13 SP1 Update 4 or later Required for correct Send_P2P buffer-length behavior

Freeport (ASCII) Configuration on the CM PtP Module

Freeport on the S7-1500 CM PtP requires the following parameters to be loaded from the project into the module during PLC startup. Verify each setting in the module's device configuration under "Properties → Port configuration → Protocol":

Parameter Sensor Example Acceptable Range Comment
Baud rate 115 200 bit/s 300 - 115 200 Freeport allows 110 - 115 200; 115200 demands clean cabling and short runs
Parity None None / Even / Odd / Mark / Space Must match slave exactly; mixed parity silently drops every byte
Data bits 8 7 or 8 Freeport ASCII is typically 8N1
Stop bits 1 1 or 2 Sensor default is 1
Flow control None None / XON-XOFF / RTS-CTS RS422/485 has no hardware flow control; select None
End delimiter 0x0D (CR) User-defined Use one or two byte sequence, e.g. 0x0D 0x0A
Start delimiter None / disable User-defined Disable for continuous broadcast from sensor
Idle line time 40 bit times 0.01 - 6553.5 ms Set to >= 1 frame time at configured baud

These values must match the sensor byte-for-byte. The CM PtP does not auto-negotiate; a single mismatched bit will cause both Send_P2P and Receive_P2P to appear to "do nothing" because the UART never sees a valid frame and the module never raises the receive-complete status.

Root Cause #1 — Send_P2P Buffer Indexing

The most common reason Send_P2P refuses to transmit is incorrect slice indexing on the input parameter DATA (also labeled SEND in some TIA Portal versions). Engineers often pass a single indexed element of an array instead of the full array.

Failing Pattern

// FB instance: "out" (instance DB of Send_P2P)
// User DB: "DataBuffer" with array [0..31] of BYTE named Static_1

// WRONG — passes only one byte, LEN=0 internally, nothing to send
"out".SEND    := "DataBuffer".Static_1[0];  // single BYTE
"out".LEN     := 10;
"out".REQ     := TRUE;

When SEND is a single BYTE element, the instruction's LEN check evaluates against the source length and concludes the buffer is empty. The CM never receives a transmit request; STATUS returns 16#7001 ("job running") for a few cycles, then 16#7000 ("no job active") without ever leaving the PLC.

Correct Pattern

// RIGHT — pass the whole array slice so LEN references the real buffer size
"out".SEND    := "DataBuffer".Static_1;     // whole array reference
"out".LEN     := 10;                         // bytes to transmit (0 = use full buffer length)
"out".REQ     := TRUE;
Rule: Always pass the entire array (or the full struct slice), not a single indexed element. LEN := 0 means "send the full length of the input buffer". A non-zero LEN that exceeds the source length silently truncates and may return 16#8085 ("invalid parameter LEN").

Root Cause #2 — Receive_P2P Stuck on 16#7002

Status 16#7002 on Receive_P2P means "interim call - data transmission in progress". It is the same as the in-flight status 16#7001 on Send_P2P and is normal for one cycle. When the value persists continuously, the receive job is never being started by the CM because:

  1. EN_R is not latched TRUE — Receive_P2P only checks for incoming bytes while EN_R is high. If EN_R is pulsed by mistake, the job is repeatedly started and aborted without ever capturing a frame.
  2. Send_P2P holds the port — The CM PtP is half-duplex. If a Send_P2P job is still in flight (REQ high, DONE not yet seen), Receive_P2P is suspended on the bus. STATUS sits at 16#7002 until the send completes (or times out at 16#80C0).
  3. No end delimiter configured — The CM receives bytes but the Freeport driver never marks a frame complete, so NDR is never set and the receive job remains "active".
  4. No termination character on the wire — The sensor may broadcast ASCII lines terminated with CR/LF. If the CM end-delimiter is set to a different character (or to "none"), frames never close.

Step-by-Step Diagnostic for 16#7002

  1. Disconnect the slave cable. In a watch/force table, force EN_R := TRUE permanently and trigger REQ := TRUE on Send_P2P with a 5-byte buffer (e.g. ASCII "HELLO"). Observe the CM TX LED; it should flash for the duration of transmission, then DONE should set for one cycle.
  2. If TX LED still does not light, the fault is in the Send_P2P buffer indexing (see Root Cause #1). Fix it before continuing.
  3. Reconnect the slave cable. With a known-good free-port end-delimiter (CR, LF, or CR+LF) configured, force EN_R := TRUE on Receive_P2P. Watch NDR and the data area. The first complete frame should raise NDR for one cycle and load the buffer.
  4. Capture the bytes on the wire with an RS422 USB sniffer (FTDI USB-RS422-WE-1800-BT or similar) to confirm framing, baud, and delimiters independently of the PLC.

Root Cause #3 — Overlap Between Send_P2P and Receive_P2P

The CM PtP RS422/485 is a half-duplex UART. While Send_P2P owns the transmit register, Receive_P2P is paused. A frequent programming mistake is to wire DONE of Send_P2P to EN_R of Receive_P2P, then drive REQ of Send_P2P from the same bit memory used for EN_R. This creates a one-cycle overlap where the bus is being driven by both instructions.

Safe Sequencing Pattern

// Single shared request bit "sendReq" (BOOL) - never pulsed during a Receive
IF "startCmd" AND NOT "busBusy" THEN
    "sendReq" := TRUE;
END_IF;

// Send_P2P instance "sendInst"
"sendInst".REQ   := "sendReq";
"sendInst".SEND  := "txBuffer".frame;        // full array, not [0]
"sendInst".LEN   := UINT#10;

IF "sendInst".DONE THEN
    "sendReq"     := FALSE;                   // drop REQ on DONE
    "txComplete"  := TRUE;                    // latched for one cycle
END_IF;

IF "sendInst".ERROR THEN
    "sendReq" := FALSE;
    "txError" := TRUE;
END_IF;

// Receive_P2P instance "recvInst" - EN_R held continuously after first send completes
"recvInst".EN_R := "txComplete" OR "rcvActive";
"recvInst".LEN  := 0;                         // accept variable length

IF "recvInst".NDR THEN
    // copy "recvInst".DATA into a working DB
    BLKMOV ; // user processing
    "rcvActive" := TRUE;                      // keep EN_R latched
END_IF;
Caution: Per Siemens documentation, "if several instructions need to read or write data records simultaneously on a CPU, the user program may need to create a time offset between the calls of each instruction." On S7-1500 the scheduler handles this if Send_P2P and Receive_P2P are called in different OB priority classes (e.g. Send in OB1, Receive in a cyclic OB with longer time), but the safest field-proven approach is to keep EN_R low until the send job is DONE, then latch EN_R high.

Special Character Handling — The $ Sign

In Freeport configuration of the CM PtP, the $ character is reserved as an escape prefix. Common sequences:

Literal Hex Value Meaning
$L 0x0A Line feed (LF)
$R 0x0D Carriage return (CR)
$N 0x0A 0x0D CR/LF pair
$T 0x09 Tab
$xhh 0xhh Arbitrary hex byte
$$ 0x24 Literal $ character

If the application must transmit a literal dollar sign as data, the configuration must contain $$. A single $ is consumed by the parser and never reaches the wire. This applies to the Freeport message configuration in the module properties, not to the runtime buffer passed to Send_P2P (which is raw bytes).

Modbus RTU Limitation on CM PtP RS422/485 BA

The BA variant (6ES7540-1AB00-0AB0) supports Freeport (ASCII) only. The HF variant (6ES7541-1AB00-0AB0) supports Modbus RTU master/slave, USS, and Freeport. If a project is migrated from a Modbus RTU slave to a BA module, the port configuration will be rejected at compile time, or — if previously compiled and downloaded — the module returns STATUS = 16#80A1 ("parameter assignment error") and the protocol does not start.

Options When the Wrong Module is Installed

  1. Replace the BA module with the HF module (catalog 6ES7541-1AB00-0AB0). Same wiring, same project footprint.
  2. Implement Modbus RTU inside the user program on top of Freeport — not recommended, only viable for small PDUs at low baud.
  3. Bridge through a third-party Modbus TCP ↔ RTU gateway connected to the CPU 1513-1 PN's PROFINET port. Recommended when the sensor/actuator vendor does not support PROFINET directly.

Diagnostic LED Behavior on the CM PtP

LED Color / State Meaning
DIAG (green) On, steady Module healthy, configuration loaded
DIAG (green) Flashing No configuration / wrong slot
DIAG (red) Flashing Group or channel error (STATUS contains code)
TX (yellow) Flicker on transmit Byte sent on the bus — first verification point
RX (yellow) Flicker on receive Byte received on the bus — confirms slave is talking
RX (yellow) Always on Framing error / noise — check bias resistors, termination, shielding

Status Code Reference for Send_P2P and Receive_P2P

STATUS (hex) Meaning Recommended Action
16#0000 Idle / no job active Normal between calls
16#7000 No job currently being processed Trigger REQ or EN_R
16#7001 First call of the job, data transmission started Wait for DONE / NDR / ERROR
16#7002 Interim call, transmission running Continue polling, or check overlap with other instruction
16#80A1 Parameter assignment error (port not configured) Re-download hardware configuration to CM
16#80C0 Frame transmission aborted (e.g. line disturbance) Check wiring, baud, terminator
16#80C1 Frame reception aborted Verify end delimiter matches slave
16#8085 LEN parameter does not match SEND source length Fix LEN or buffer indexing
16#80D0 No end delimiter received within the configured timeout Increase idle-line time, verify slave line ending
16#80FF Hardware fault on module Replace module

Resolution Procedure (Step-by-Step)

  1. Confirm module type. In the device configuration of the S7-1500 station, verify the CM PtP catalog number is 6ES7541-1AB00-0AB0 (HF) if Modbus is required, or 6ES7540-1AB00-0AB0 (BA) for Freeport-only.
  2. Re-download hardware configuration to the CPU. The CM PtP does not retain its port parameters across power cycles unless configuration is online.
  3. Match port parameters with the slave: baud 115200, parity none, 8 data bits, 1 stop bit, end delimiter = CR (0x0D) or CR+LF (0x0D 0x0A).
  4. Fix Send_P2P buffer indexing. Replace any reference of the form "out".Static_1[0] with the full array reference "out".Static_1.
  5. Test Send_P2P without slave. Force REQ := TRUE from a watch table with a 5-byte buffer. Confirm TX LED flashes; expect DONE := TRUE for one cycle.
  6. Wire Receive_P2P after Send completes. Latch EN_R := TRUE from a "first DONE" memory; never pulse it on every scan.
  7. Test Receive_P2P with slave connected. Watch NDR; the data area should populate with the first full frame.
  8. Decouple SEND and RECEIVE by calling them in separate OB priority classes if high baud is sustained.
  9. Capture traffic independently with a USB RS422 sniffer to verify framing, delimiters, and that the slave is in fact transmitting continuously.
  10. Document final STATUS code in HMI for first-line diagnostic. Use 16#80D0, 16#80C0, 16#80C1 as alarm categories for operator action.

Verification Checklist

  • [ ] CM PtP DIAG LED steady green within 2 seconds of CPU RUN.
  • [ ] TX LED flickers on every Send_P2P REQ cycle.
  • [ ] RX LED flickers on every slave frame, independent of the program.
  • [ ] Send_P2P DONE asserts for exactly one scan per REQ pulse.
  • [ ] Receive_P2P NDR asserts for exactly one scan on each complete frame.
  • [ ] No concurrent REQ and EN_R active at the same time (verify with cross-reference watch table).
  • [ ] STATUS = 16#0000 between jobs.
  • [ ] A USB sniffer on the bus shows the exact same bytes seen by Receive_P2P.
  • [ ] Buffer overflow does not occur; consider ring buffer if frames arrive faster than processing.

Performance and Timing Considerations

At 115 200 bit/s, 8N1, a 32-byte frame is approximately 3.2 ms on the wire. Receive_P2P must complete its user-side processing (BLKMOV, parsing, write to DB) before the next frame arrives, or the buffer is overwritten. A sensor broadcasting at 10 Hz (every 100 ms) gives 30 ms of headroom. A sensor at 100 Hz leaves only 7 ms — long enough on S7-1500 only if the parsing logic is implemented in a fast OB (OB1) and the data target is an optimized DB.

For sustained high-rate links, distribute load by:

  • Moving parsing into a time-driven OB (e.g. OB30 at 1 ms) separate from the cyclic OB.
  • Using a ring-buffer DB large enough for several seconds of frames.
  • Reducing baud to 19 200 or 38 400 if the slave supports it — halves or quarters the time pressure.

Migration Notes to TIA Portal V15 / V16 / V17 / V18 / V19 / V20

The Freeport configuration on the CM PtP is forward-compatible across TIA Portal versions. Projects created in V13 SP1 / V14 SP1 open in V15+ and continue to work after recompile. Notable changes that affect field troubleshooting:

  • V15: added diagnostics blocks for PtP modules under "PtP_PortStatus", reducing the need to evaluate STATUS manually.
  • V16: enhanced status code set for Receive_P2P, including 16#80E0 for buffer-overrun on extended frames.
  • V17 / V18: Send_P2P / Receive_P2P migrated to the unified "PtP" instruction namespace; the legacy names remain available as aliases.
  • V20: the canonical documentation entry for Freeport is the "Data transmission with Freeport (S7-1500)" page in the TIA Portal Help, linked in the References section above.

Troubleshooting Matrix

Symptom Most Likely Root Cause First Action
TX LED never on, DONE never set Send_P2P passes array index instead of array Change SEND to full array reference
Receive stuck on 16#7002 EN_R not latched, or Send owns the bus Latch EN_R after first send DONE
Receive NDR never set, RX LED active End delimiter mismatch Set Freeport end delimiter to 0x0D 0x0A
Intermittent byte corruption RS422 termination / bias missing Add 120 Ω termination, fail-safe bias resistors
STATUS 16#80A1 on cold start Hardware configuration not downloaded Recompile and download HW config
STATUS 16#8085 on send LEN > source buffer length Set LEN := 0 or trim to real length
STATUS 16#80FF Module hardware fault Replace CM PtP module

Frequently Asked Questions

Why does Send_P2P never light the TX LED on my S7-1500 CM PtP RS422/485 module?

The most common cause is passing an indexed element such as "out".Static_1[0] as the SEND parameter instead of the full array "out".Static_1. The instruction then evaluates LEN against a single BYTE and concludes the buffer is empty. Replace the indexed reference with the full array reference and re-test.

What does Receive_P2P status 16#7002 mean and is it always a fault?

16#7002 means "interim call, data transmission running." It is normal for one cycle after the instruction is started. If it persists, either the receive job is waiting for an end delimiter that never arrives, EN_R is being pulsed instead of latched, or a concurrent Send_P2P is holding the bus. Verify the Freeport end delimiter matches the slave's line-ending character and latch EN_R after the first send completes.

Can the CM PtP RS422/485 BA (6ES7540-1AB00-0AB0) act as a Modbus RTU master or slave?

No. The BA module supports Freeport (ASCII) only. For Modbus RTU master/slave, use the HF variant 6ES7541-1AB00-0AB0, which also supports USS and Freeport. Mixing the wrong module in a project that expects Modbus RTU produces STATUS 16#80A1 (parameter assignment error).

How do I send a literal dollar sign ($) in a Freeport message configuration?

Use two dollar characters $$. A single $ is consumed as the escape prefix for sequences such as $L (0x0A line feed), $R (0x0D carriage return), or $xhh (arbitrary hex byte). $$ produces a single 0x24 on the wire.

What baud rate, parity, and framing should I use for a 115200 8N1 sensor on the S7-1500 CM PtP?

Configure the port for 115 200 bit/s, parity = None, 8 data bits, 1 stop bit, flow control = None (RS422 has no hardware handshake). Set the Freeport end delimiter to the byte the sensor emits at the end of each frame — typically 0x0D (CR) or 0x0D 0x0A (CR+LF) for ASCII sensors. A single mismatched bit will silently drop every byte without raising a STATUS error.

Back to blog