|
ProtoCore v0.0.1
Deterministic, zero-heap network stack for embedded targets
|
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.
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):
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:
Packets, robot -> PC:
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.
Definition in file fanuc_j519.h.