JRBusTCP is a proprietary binary communication protocol designed for efficient, deterministic data exchange between JRobo / JRoboPLC instances and client applications. The protocol operates over TCP/IP and is optimized for:
The protocol follows a request/response model with client-initiated communication. All messages are framed, version-agnostic at transport level, and protected by CRC32 checksums.
Maximum supported message size is 16384 bytes.
—
JRBusTCP does not define connection establishment beyond TCP. Session state (authentication, tag list, update state) is maintained per TCP connection.
—
+--------+--------+----------------------------+--------+ | size | header | payload | crc | | 2 B | 2 B | (size - 4 - 4 bytes) | 4 B | +--------+--------+----------------------------+--------+
Where payload has the following structure:
+---------+------+---------------------------+ | reqId | cmd | body | | 4 B | 1 B | variable length | +---------+------+---------------------------+
Server does not validate or interpret `reqId`.
—
| Code | Name |
|---|---|
| 0x01 | INIT |
| 0x02 | LIST |
| 0x03 | UPDATE |
| 0x04 | READ |
| 0x05 | WRITE |
| 0x06 | CRC |
| 0x07 | AUTH_INIT |
| 0x08 | AUTH_SUBMIT |
| 0xFE | UNAUTHENTICATED |
| 0xFF | UNKNOWN |
Response commands are formed by setting the highest bit (`cmd | 0x80`).
—
Initializes tag list and session parameters.
cmd : 0x01 flen : 1 byte filter : flen bytes (UTF-8 regex) clen : 1 byte client : clen bytes (UTF-8) flags : 2 bytes
cmd : 0x81 listsize : 3 bytes (uint24)
`listsize` indicates total number of tags selected.
—
Retrieves tag metadata in chunks.
cmd : 0x02 index : 3 bytes (uint24)
cmd : 0x82 index : 3 bytes quantity : 3 bytes next : 3 bytes [tag entries]
type : 1 byte nlen : 1 byte tagname : nlen bytes (UTF-8) dlen : 1 byte descr : dlen bytes (UTF-8)
| Code | Type |
|---|---|
| 1 | BOOL |
| 2 | INT32 |
| 3 | INT64 |
| 4 | DOUBLE |
| 5 | STRING |
—
Checks for tag value changes.
cmd : 0x03
cmd : 0x83 quantity : 3 bytes next : 3 bytes liststate : 1 byte
—
Reads tag values.
cmd : 0x04 index : 3 bytes
cmd : 0x84 index : 3 bytes quantity : 3 bytes next : 3 bytes [data blocks]
Status bit: b4 of first value byte (if INIT.flags.b1 = 1)
—
Writes tag values.
cmd : 0x05 index : 3 bytes quantity : 3 bytes [data blocks]
cmd : 0x85
—
Returns CRC32 checksum of all tag values after last UPDATE.
cmd : 0x06
cmd : 0x86 crc : 4 bytes
—
request: cmd : 0x07 klen : 2 bytes keyname : klen bytes response: cmd : 0x87 status : 1 byte nlen : 2 bytes nonce : nlen bytes
Status:
request: cmd : 0x08 nlen : 2 bytes nonce : nlen bytes response: cmd : 0x88 status : 1 byte
Status:
—
—
1. TCP connect 2. AUTH_INIT / AUTH_SUBMIT (optional) 3. INIT 4. LIST (paged) 5. UPDATE 6. READ / WRITE 7. CRC (optional) 8. TCP disconnect
—
—
This document defines JRBusTCP Protocol v1. Any incompatible changes MUST increment protocol version and be negotiated out-of-band.
—
Client Server | | |--- TCP CONNECT ---------------->| | | |--- INIT ----------------------->| |<-- INIT RESPONSE (listsize) ----| | | |--- LIST (index=0) ------------->| |<-- LIST (chunk 1) --------------| |--- LIST (next) ---------------->| |<-- LIST (last chunk) -----------| | | |--- UPDATE --------------------->| |<-- UPDATE (quantity,next) ------| | | |--- READ (index=first changed) ->| |<-- READ (values) ---------------| | | |--- UPDATE / READ (loop) --------| | |
+---------+------+---------+-----------+-----------+----------------+ | reqId | cmd | index | quantity | next | data blocks | | 4 B | 1 B | 3 B | 3 B | 3 B | variable | +---------+------+---------+-----------+-----------+----------------+
+---------+------+---------+-----------+----------------+ | reqId | cmd | index | quantity | data blocks | | 4 B | 1 B | 3 B | 3 B | variable | +---------+------+---------+-----------+----------------+
—
—
00 1A AB CD 00 00 00 01 01 05 2E 2A 00 06 4A 52 6F 62 6F 00 03 A1 B2 C3 D4
00 14 AB CD 00 00 00 05 84 00 00 01 00 00 01 00 00 00 F8 00 00 00 2A DE AD BE EF
—