Skip to content

Port 7000 Protocol

Overview

Data Frame Structure

ItemLength (Byte)Description
SyncByte20x4E66 fixed header
Length2Hex length 00xffff; does not include data header and command, does not include CRC segment
Command2Command word
dataLengthData segment (primarily JSON data format)
CRC4CRC verification on data excluding the header (CRC32)

Communication Protocol Configuration

Port 7000 supports both TCP and UDP communication protocols. By entering the controller backend and modifying the configuration file config/controller.json, under the hostComputerService node:

  • socketType: socket type, can be "TCP" or "UDP", default is "TCP"
  • checkCRC: whether to perform CRC check; when false, CRC is not checked (but the 4 bytes occupied by CRC still need to be sent), default is true

Status queries can be set to UDP communication for data retrieval, with a minimum cycle of 1ms.


Command Overview

CommandDirectionFunction
0x1E00Host computer → ControllerQuery status
0x1E01Controller → Host computerQuery status reply
0x1E02Host computer → ControllerMotion control
0x1E03Controller → Host computerMotion control reply
0x1E04Host computer → ControllerVariable, IO control
0x1E10Host computer → ControllerServo on/off point motion control
0x1E11Controller → Host computerServo on/off point motion control reply
0x1E12Host computer → ControllerPoint transmission
0x1E13Controller → Host computerPoint transmission reply

1. Query Status (0x1E00)

Request Field Description

FieldTypeDescription
channelintChannel; up to 9 channels, default is 1
stopintStop sending; when 1, stops previous continuous sending; the data below can be omitted
robotintRobot number; range [1, 4]
modeintRequest reply mode; 0: on-demand (one reply per request), 1: continuous (continuous reply after one request)
intervalintContinuous reply interval (ms); only valid when mode=1, range [1, 60000]
queryTypestring[]List of runtime parameters to query; omit those not needed
typeCfgobjectQuery content configuration; only valid when querying related type data

queryType Available Values

ValueDescription
realPosACSReal-time coordinate position (joint coordinate system)
realPosMCSReal-time coordinate position (Cartesian coordinate system)
realPosPCSReal-time coordinate position (tool coordinate system)
realPosUCSReal-time coordinate position (user coordinate system)
axisVelAxis velocity
axisAccAxis acceleration
torqueTorque
electricCurrent
numGVarNumeric variables
IOIO ports
serialNumSerial number
runControlPosRunNumNumber of points already executed in the current trajectory of motion control
detailedMotionPosDetailed motion points (each robot supports only one channel query at the same time)

typeCfg Configuration Description

  • numGVar: Query global variables (int type), e.g., ["GD001", "GA001", "GI001", "GI333"]
  • IO: Query IO ports (string type), e.g., ["DI1", "DI16", "DO1", "DO3", "DO17"]; if the queried IO does not exist, returns -1; the maximum number that can be queried should not exceed the number of IOs
  • detailedMotionPos:
    • num: Number of points replied per data frame (int)
    • optional: Optional parameters (string[]), can be "ACS", "MCS", "time", "reset"

Request Example

json
{
  "channel": 1,
  "stop": 1,
  "robot": 1,
  "mode": 0,
  "interval": 10,
  "queryType": [
    "realPosACS", "realPosMCS", "realPosPCS", "realPosUCS",
    "axisVel", "axisAcc",
    "torque", "electric",
    "numGVar",
    "IO",
    "serialNum",
    "runControlPosRunNum",
    "detailedMotionPos"
  ],
  "typeCfg": {
    "numGVar": ["GD001", "GA001", "GI001", "GI333"],
    "IO": ["DI1", "DI16", "DO1", "DO3", "DO17"],
    "detailedMotionPos": {
      "num": 10,
      "optional": ["ACS", "MCS", "time", "reset"]
    }
  }
}

2. Query Status Reply (0x1E01)

Reply Field Description

FieldTypeDescription
channelintChannel; up to 9 channels
robotintRobot number; range [1, 4]
replyDataobjectReply query results; items not queried will not be replied

Coordinate Data Description

Coordinate format: Robot (first 7) + External axes (last 5)

  • Without external axes, the number of coordinates equals the number of axes
  • With external axes, the number of coordinates is 7 + number of external axes

replyData Field Details

FieldDescription
realPosACSReal-time coordinate position (joint coordinate system), float array
realPosMCSReal-time coordinate position (Cartesian coordinate system), float array
realPosPCSReal-time coordinate position (tool coordinate system), float array
realPosUCSReal-time coordinate position (user coordinate system), float array
axisVelAxis velocity, float array
axisAccAxis acceleration, float array
torqueTorque, float array
electricCurrent, float array
numGVarGlobal variable key-value pairs, e.g., {"GD001": 0.1, "GA001": true, "GI001": 33}
IOIO status key-value pairs, e.g., {"DI1": 1, "DO1": 0}; if IO does not exist, returns -1
runControlPosRunNumNumber of points already executed in the current trajectory of motion control
serialNumSerial number; increments by 1 for each reply, each channel is independent
detailedMotionPosDetailed motion points

detailedMotionPos Details

  • num: Number of points replied per data frame (int)
  • data: Point array, each point contains:
    • ACS: Joint coordinates, float array
    • MCS: Cartesian coordinates, float array
    • time: Timestamp [seconds, nanoseconds], e.g., [123456, 654321]

Reply Example

json
{
  "channel": 1,
  "robot": 1,
  "replyData": {
    "realPosACS": [1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 2.1, 2.2, 2.3, 2.4, 2.5],
    "realPosMCS": [1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 2.1, 2.2, 2.3, 2.4, 2.5],
    "realPosPCS": [1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 2.1, 2.2, 2.3, 2.4, 2.5],
    "realPosUCS": [1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 2.1, 2.2, 2.3, 2.4, 2.5],
    "axisVel":    [1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 2.1, 2.2, 2.3, 2.4, 2.5],
    "axisAcc":    [1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 2.1, 2.2, 2.3, 2.4, 2.5],
    "torque":     [1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 2.1, 2.2, 2.3, 2.4, 2.5],
    "electric":   [1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 2.1, 2.2, 2.3, 2.4, 2.5],
    "numGVar": {"GD001": 0.1, "GA001": true, "GI001": 33, "GI333": -55},
    "IO": {"DI1": 1, "DI16": 0, "DO1": 0, "DO3": 1, "DO17": -1},
    "runControlPosRunNum": 0,
    "serialNum": 1,
    "detailedMotionPos": {
      "num": 10,
      "data": [
        {
          "time": [123456, 654321],
          "ACS": [1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 2.1, 2.2, 2.3, 2.4, 2.5],
          "MCS": [1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 2.1, 2.2, 2.3, 2.4, 2.5]
        }
      ]
    }
  }
}

3. Motion Control (0x1E02)

Request Field Description

FieldTypeDescription
robotintRobot number; range [1, 4]
clearBufferintClear motion trajectory buffer queue; 1: clear (does not affect data currently being transmitted), can be omitted when 0
targetModeintMotion mode; 0: independent point, 1: continuous trajectory
sendModeint0: transmit all trajectory points at once, 1: transmit partial points each time
runModeintValid only when transmitting partial points each time; 0: receive complete trajectory before moving, 1: move while receiving
endint1: stop previous continuous transmission; the data below can be omitted; can be omitted when 0
sumintValid only for "receive complete trajectory before moving"; total number of frames to send
countintValid only for "receive complete trajectory before moving"; current frame number
cfgobjectMotion configuration (only needs to be set for the first frame, and only valid for the first frame)
targetPosfloat[]Single target point (using this field only moves to one target point)
targetVecobject[]Multiple target points (traverse all points in order; when both targetPos and targetVec exist, only targetPos takes effect)

cfg Field Details

FieldTypeDescription
coordstringCoordinate system, e.g., "ACS"
extMoveintWhether there is external axis motion; 1: yes, 0 or omitted: no
syncintWhether external axes are synchronized; 0 or omitted: not synchronized, 1: synchronized
speedintSpeed setting; uses default value if omitted
accintAcceleration setting; uses default value if omitted
plintDefaults to 5 if omitted; only valid for "independent point" with targetVec
moveModestringMotion mode; can be "TeachSet", "MOVJ", "MOVL", "MOVS", default "TeachSet"; only valid for "independent point" with targetVec
timeoutintTimeout (ms); no timeout check if omitted, range 10–10000; only valid for "receive complete trajectory before moving"

Example 1: Independent Point · Transmit All Points at Once

json
{
  "robot": 1,
  "clearBuffer": 1,
  "targetMode": 0,
  "cfg": {
    "coord": "ACS",
    "extMove": 0,
    "sync": 0,
    "speed": 100,
    "acc": 100,
    "pl": 5,
    "moveMode": "TeachSet"
  },
  "targetPos": [1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 2.1, 2.2, 2.3, 2.4, 2.5],
  "targetVec": [
    {"pos": [1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 2.1, 2.2, 2.3, 2.4, 2.5]},
    {"pos": [1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 2.1, 2.2, 2.3, 2.4, 2.5]},
    {"pos": [1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 2.1, 2.2, 2.3, 2.4, 2.5]},
    {"pos": [1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 2.1, 2.2, 2.3, 2.4, 2.5]}
  ]
  // When both targetPos and targetVec exist, only targetPos takes effect
}

Example 2: Independent Point · Transmit Partial Points Each Time · Receive Complete Trajectory Before Moving

json
{
  "robot": 1,
  "clearBuffer": 1,
  "end": 0,
  "targetMode": 0,
  "sendMode": 1,
  "runMode": 0,
  "sum": 10,
  "count": 1,
  "cfg": {
    "coord": "ACS",
    "extMove": 0,
    "sync": 0,
    "speed": 100,
    "acc": 100,
    "pl": 5,
    "moveMode": "TeachSet",
    "timeout": 100
  },
  "targetVec": [
    {"pos": [1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 2.1, 2.2, 2.3, 2.4, 2.5]},
    {"pos": [1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 2.1, 2.2, 2.3, 2.4, 2.5]}
  ]
}

Example 3: Continuous Trajectory · Transmit All Points at Once

json
{
  "robot": 1,
  "clearBuffer": 1,
  "targetMode": 1,
  "sendMode": 0,
  "cfg": {
    "coord": "ACS",
    "extMove": 0,
    "sync": 0,
    "speed": 100,
    "acc": 100
  },
  "targetVec": [
    {
      "pos":       [1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 2.1, 2.2, 2.3, 2.4, 2.5],
      "axisVel":   [1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 2.1, 2.2, 2.3, 2.4, 2.5],
      "axisAcc":   [1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 2.1, 2.2, 2.3, 2.4, 2.5],
      "timeStamp": 10
    },
    {
      "pos":       [1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 2.1, 2.2, 2.3, 2.4, 2.5],
      "axisVel":   [1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 2.1, 2.2, 2.3, 2.4, 2.5],
      "axisAcc":   [1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 2.1, 2.2, 2.3, 2.4, 2.5],
      "timeStamp": 10
    }
  ]
}

timeStamp: Time relative to the start point when reaching this point (ms)

Example 4: Continuous Trajectory · Transmit Partial Points Each Time · Receive Complete Trajectory Before Moving

json
{
  "robot": 1,
  "clearBuffer": 1,
  "end": 0,
  "targetMode": 1,
  "sendMode": 1,
  "runMode": 0,
  "sum": 10,
  "count": 1,
  "cfg": {
    "coord": "ACS",
    "extMove": 0,
    "sync": 0,
    "speed": 100,
    "acc": 100,
    "timeout": 100
  },
  "targetVec": [
    {
      "pos":       [1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 2.1, 2.2, 2.3, 2.4, 2.5],
      "axisVel":   [1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 2.1, 2.2, 2.3, 2.4, 2.5],
      "axisAcc":   [1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 2.1, 2.2, 2.3, 2.4, 2.5],
      "timeStamp": 10
    }
  ]
}

4. Motion Control Reply (0x1E03)

Reply Field Description

FieldTypeDescription
robotintRobot number; range [1, 4]
successbooltrue: success, false: failure
sizeintCurrent number of trajectories in the motion trajectory buffer queue; only present when success=true
causestringFailure reason (empty when successful)

cause Failure Reasons

ValueDescription
"busy"There is data currently being transmitted that has not completed
"timeout"Reception timeout
"dataErr"Data error
"termination"The sender terminated the data being transmitted

Reply Example

json
{
  "robot": 1,
  "success": false,
  "size": 1,
  "cause": "timeout"
}

5. Variable, IO Control (0x1E04)

Request Field Description

FieldTypeDescription
numGVarobjectSet variables; GA is bool type, GI is int type, GD is double type
IOobjectSet IO ports; 1/0 indicates IO port status

Request Example

json
{
  "numGVar": {
    "GA001": true,
    "GI033": 6,
    "GD666": -2.33
  },
  "IO": {
    "DO1": 1,
    "DO13": 0
  }
}

6. Servo On/Off Point Motion Control (0x1E10)

Note: This function cannot be used simultaneously with the "Motion Control" function (0x1E02).

Request Field Description

FieldTypeDescription
robotintRobot number; range [1, 4]
switchbooltrue: on, false: off

Request Example

json
{
  "robot": 1,
  "switch": true
}

7. Servo On/Off Point Motion Control Reply (0x1E11)

Reply Field Description

FieldTypeDescription
successbooltrue: success, false: failure
causestringFailure reason (empty when successful)

cause Failure Reasons

ValueDescription
"busy"Current channel is occupied
"dataErr"Data error
"startupErr"Startup failed

Reply Example

json
{
  "success": false,
  "cause": "busy"
}

8. Point Transmission (0x1E12)

Request Field Description

FieldTypeDescription
robotintRobot number; range [1, 4]
endint1: stop previous continuous transmission; the data below can be omitted; can be omitted when 0. When point transmission is not complete, previously received data will be cleared and a new point queue will be awaited
sumintTotal number of frames to send
countintCurrent frame number
PosVecfloat[][]Point coordinate array; format: robot (first 7) + external axes (last 5)

Request Example

json
{
  "robot": 1,
  "end": 1,
  "sum": 10,
  "count": 1,
  "PosVec": [
    [1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 2.1, 2.2, 2.3, 2.4, 2.5],
    [1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 2.1, 2.2, 2.3, 2.4, 2.5],
    [1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 2.1, 2.2, 2.3, 2.4, 2.5]
  ]
}

9. Point Transmission Reply (0x1E13)

Reply Field Description

FieldTypeDescription
robotintRobot number; range [1, 4]
successbooltrue: reception successful, false: reception failed
causestringFailure reason (empty when successful)

cause Failure Reasons

ValueDescription
"notStart"Servo point motion control mode is not enabled
"dataErr"Data error
"termination"The sender terminated the data being transmitted
"cacheFull"Buffer is full (maximum buffer is 6 trajectories)

Reply Example

json
{
  "robot": 1,
  "success": false,
  "cause": "dataErr"
}