ProtoCore v0.0.1
Deterministic, zero-heap network stack for embedded targets
Loading...
Searching...
No Matches
simatic.h File Reference

Siemens SIMATIC serial point-to-point link (PC_ENABLE_SIMATIC) - the 3964R link protocol + the RK512 computer-link telegrams, zero-heap. More...

#include "protocore_config.h"

Go to the source code of this file.

Detailed Description

Siemens SIMATIC serial point-to-point link (PC_ENABLE_SIMATIC) - the 3964R link protocol + the RK512 computer-link telegrams, zero-heap.

The pre-Ethernet Siemens point-to-point link, two layers:

  • 3964R - a byte-oriented, half-duplex link protocol (S5/S7 PtP CP modules CP 341 / CP 441 / CP 524 / CP 525). A block is framed
    STX <data, DLE bytes doubled> DLE ETX [BCC]
    with an interactive per-block handshake: the sender emits STX and waits for the receiver's DLE (ready) before sending the block, then waits for a final DLE (ok) or NAK (retry). On a simultaneous STX collision the low-priority station yields. The "R" variant appends a BCC - the longitudinal XOR (even parity) of every character of the block after STX, i.e. the stuffed data and the terminating DLE ETX. A payload byte equal to DLE (0x10) is doubled (transparency); a doubled DLE contributes 0x10 ^ 0x10 = 0 to the XOR, so it does not change the BCC.
  • RK512 - fixed-header request/reaction telegrams carried as the 3964R block payload: SEND (write words to the partner) and FETCH (read words from the partner), addressing a data block / flag / I-O area by number + word offset + count. Siemens words are big-endian.

Pure, host-tested (native_simatic) against an independent python 3964R+RK512 reference peer; the RS-232 / RS-485 UART is the application's (like the other serial-bus codecs). Control-char handshake, QVZ/ZVZ timeouts, priority arbitration, BCC, and the RK512 header layout follow the Siemens "3964(R) transmission protocol" and "RK 512 computer link" CP-module manuals.

Author
Douglas Quigg (dstroy0)
Date
2026

Definition in file simatic.h.