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

FANUC Stream Motion (option J519) UDP codec (PC_ENABLE_FANUC_J519) - the robot counterpart to the shipped FOCAS CNC codec (services/focas). More...

#include "protocore_config.h"

Go to the source code of this file.

Detailed Description

FANUC Stream Motion (option J519) UDP codec (PC_ENABLE_FANUC_J519) - the robot counterpart to the shipped FOCAS CNC codec (services/focas).

Stream Motion is FANUC's real-time external motion interface on R-30iB / R-30iA robot controllers: an external controller streams joint (or Cartesian) setpoints to the robot over UDP at the controller's interpolation rate (typically 125 Hz or 250 Hz) and the robot answers every command with its measured state. This is a pure, zero-heap codec for that wire protocol - the caller owns the UDP socket and the real-time cadence.

Wire format (UDP port PC_J519_UDP_PORT, default 60015). Every packet opens with an 8-octet header, and unlike FOCAS every multi-octet field is LITTLE-endian (floats are IEEE-754 binary32):

header (8)
packet type (4) u32 le - see J519Type
version no (4) u32 le

The packet type does NOT identify a packet on its own: the numeric space is reused per direction (type 0 is Start from the PC but Robot Status from the robot; type 3 is Request from the PC but Ack from the robot). A decoder must therefore know which way the datagram travelled - hence the direction is in the function name, not a runtime flag. Sizes disambiguate in practice (Start 8 vs Status 132, Request 16 vs Ack 184) and every parser here checks the exact length.

Packets, PC -> robot:

Start (type 0) 8 octets header only
Motion (type 1) 64 octets seq, last_data, read-IO selector, data style, write-IO, 9 x f32 setpoints
Stop (type 2) 8 octets header only
Request (type 3) 16 octets axis no + threshold type (asks for the motion-limit tables)

Packets, robot -> PC:

Status (type 0) 132 octets seq, status bits, read-IO value, timestamp,
9 x f32 Cartesian pose + 9 x f32 joint pose + 9 x f32 motor current
Ack (type 3) 184 octets axis no, threshold type, max Cartesian speed,
20 x f32 thresholds at NO load + 20 x f32 at MAX load

The codec is symmetric (like services/scpi): the PC-side builders pair with robot-side parsers and vice versa, so a build -> parse round trip is exact and the device can act as either end (streaming controller, or a robot simulator for bench work).

Field layout, packet sizes, the type codes, the I/O-type and threshold-type enumerations, and the status bit assignments were taken from the public Wireshark dissector fanuc-stream-motion/packet-fanuc-stream-motion-j519 (the same class of public reference the FOCAS codec was cross-checked against). No FANUC source or header is used or required. Pure codec, host-tested; no heap, no stdlib.

Author
Douglas Quigg (dstroy0)
Date
2026

Definition in file fanuc_j519.h.