58#ifndef PROTOCORE_FANUC_J519_H
59#define PROTOCORE_FANUC_J519_H
63#if PC_ENABLE_FANUC_J519
69#define PC_J519_UDP_PORT 60015
75#define PC_J519_THRESHOLDS 20
81 PC_J519_LEN_START = 8,
82 PC_J519_LEN_MOTION = 64,
84 PC_J519_LEN_REQUEST = 16,
85 PC_J519_LEN_STATUS = 132,
86 PC_J519_LEN_ACK = 184,
93enum class J519Type : uint32_t
95 J519_START_OR_STATUS = 0,
98 J519_REQUEST_OR_ACK = 3,
102enum class J519DataStyle : uint8_t
104 J519_STYLE_CARTESIAN = 0,
105 J519_STYLE_JOINT = 1,
109enum class J519IoType : uint8_t
129enum class J519ThresholdType : uint32_t
131 J519_THR_VELOCITY = 0,
132 J519_THR_ACCELERATION = 1,
140 J519_STATUS_READY = 0x01,
141 J519_STATUS_CMD_RECEIVED = 0x02,
142 J519_STATUS_SYSRDY = 0x04,
143 J519_STATUS_IN_MOTION = 0x08,
147struct J519MotionCommand
150 uint32_t sequence_no;
152 uint8_t read_io_type;
153 uint16_t read_io_index;
154 uint16_t read_io_mask;
156 uint8_t write_io_type;
157 uint16_t write_io_index;
158 uint16_t write_io_mask;
159 uint16_t write_io_value;
160 float joint_data[PC_J519_AXES];
164struct J519RobotStatus
167 uint32_t sequence_no;
169 uint8_t read_io_type;
170 uint16_t read_io_index;
171 uint16_t read_io_mask;
172 uint16_t read_io_value;
174 float cartesian_pose[PC_J519_AXES];
175 float joint_pose[PC_J519_AXES];
176 float motor_current[PC_J519_AXES];
184 uint32_t threshold_type;
192 uint32_t threshold_type;
193 uint32_t max_cart_speed;
195 float threshold_no_load[PC_J519_THRESHOLDS];
196 float threshold_max_load[PC_J519_THRESHOLDS];
209bool pc_j519_peek(
const uint8_t *buf,
size_t len, uint32_t *type, uint32_t *version_no);
214size_t pc_j519_build_start(uint8_t *buf,
size_t cap, uint32_t version_no);
217size_t pc_j519_build_stop(uint8_t *buf,
size_t cap, uint32_t version_no);
220size_t pc_j519_build_motion(uint8_t *buf,
size_t cap,
const J519MotionCommand *cmd);
223size_t pc_j519_build_request(uint8_t *buf,
size_t cap,
const J519Request *req);
228bool pc_j519_parse_motion(
const uint8_t *buf,
size_t len, J519MotionCommand *out);
231bool pc_j519_parse_request(
const uint8_t *buf,
size_t len, J519Request *out);
236size_t pc_j519_build_status(uint8_t *buf,
size_t cap,
const J519RobotStatus *st);
239size_t pc_j519_build_ack(uint8_t *buf,
size_t cap,
const J519Ack *ack);
244bool pc_j519_parse_status(
const uint8_t *buf,
size_t len, J519RobotStatus *out);
247bool pc_j519_parse_ack(
const uint8_t *buf,
size_t len, J519Ack *out);
User-facing configuration for ProtoCore.