Edit on GitHub

Protocol 2.0

Instruction Packet

Instruction Packet is the command data sent to the Device.

Header1 Header2 Header3 Reserved Packet ID Length1 Length2 Instruction Param Param Param CRC1 CRC2
0xFF 0xFF 0xFD 0x00 ID Len_L Len_H Instruction Param 1 Param N CRC_L CRC_H

The field indicates the start of the Packet

Reserved

0x00 (0xFD cannot be used)

Packet ID

The field that indicates the ID of the Device that should receive the Instruction Packet and process it

  1. Range : 0 ~ 252 (0x00 ~ 0xFC), which is a total of 253 numbers that can be used
  2. Broadcast ID : 254 (0xFE), which makes all connected devices execute the Instruction Packet
  3. 253(0xFD), 255(0xFF) : These are not used in order to avoid duplicate use with Header

Packet Length

The length after the Packet Length field (Instruction, Parameter, CRC fields). Packet Length = number of Parameters + 3

Instruction

The field that defines the type of command.

Value Instructions Description
0x01 Ping Instruction that checks whether the Packet has arrived to a device with the same ID as Packet ID
0x02 Read Instruction to read data from the Device
0x03 Write Instruction to write data on the Device
0x04 Reg Write Instruction that registers the Instruction Packet to a standby status; Packet is later executed through the Action command
0x05 Action Instruction that executes the Packet that was registered beforehand using Reg Write
0x06 Factory Reset Instruction that resets the Control Table to its initial factory default settings
0x08 Reboot Instruction to reboot the Device
0x55 Status(Return) Return Instruction for the Instruction Packet
0x82 Sync Read For multiple devices, Instruction to read data from the same Address with the same length at once
0x83 Sync Write For multiple devices, Instruction to write data on the same Address with the same length at once
0x92 Bulk Read For multiple devices, Instruction to read data from different Addresses with different lengths at once
0x93 Bulk Write For multiple devices, Instruction to write data on different Addresses with different lengths at once

Parameters

  1. As the auxiliary data field for Instruction, its purpose is different for each Instruction.
  2. Method of expressing negative number data : This is different for each product, so please refer to the e-manual of the corresponding product.

CRC

16bit CRC field checks if the Packet has been damaged during communication. Please refer to the CRC calculation code.

Status Packet

Header1 Header2 Header3 Reserved Packet ID Length1 Length2 Instruction ERR PARAM PARAM PARAM CRC1 CRC2
0xFF 0xFF 0xFD 0x00 ID Len_L Len_H Instruction Error Param 1 Param N CRC_L CRC_H

Instruction

Instruction of the Status Packet is designated to 0x55 (Status)

Error

The field that indicates the processing result of Instruction Packet

Bit 7 Bit 6 ~ Bit 0
Alert Error Number
Value Error Description
0x01 Result Fail Failed to process the sent Instruction Packet
0x02 Instruction Error Undefined Instruction has been used
Action has been used without Reg Write
0x03 CRC Error CRC of the sent Packet does not match
0x04 Data Range Error Data to be written in the corresponding Address is outside the range of the minimum/maximum value
0x05 Data Length Error Attempt to write Data that is shorter than the data length of the corresponding Address
(ex: when you attempt to only use 2 bytes of a item that has been defined as 4 bytes)
0x06 Data Limit Error Data to be written in the corresponding Address is outside of the Limit value
0x07 Access Errer Attempt to write a value in an Address that is Read Only or has not been defined
Attempt to read a value in an Address that is Write Only or has not been defined
Attempt to write a value in the ROM domain while in a state of Torque Enable(ROM Lock)

Parameter

  1. As the auxiliary data field for Instruction, its purpose is different for each Instruction.
  2. Method of expressing negative number data : This is different for each product, so please refer to the e-manual of the corresponding product

Packet Process

Processing Order of Transmission

  1. Generate basic form of Packet and afterwards Byte Stuffing(0xFD)
    • Inspection range : Everything within the Instruction field to the Parameter field (not the CRC)
    • Processing method : When the pattern “0xFF 0xFF 0xFD” appears, add Byte Stuffing (0xFD) (If “0xFF 0xFF 0xFD” already exists, add a 0xFD to change it to “0xFF 0xFF 0xFD 0xFD”)
  2. Packet Length : Modify to Packet Length with Byte Stuffing applied
  3. CRC : Calculate CRC with Byte Stuffing applied

Processing Order of Reception

  1. Search for Header(0xFF 0xFF 0xFD) : Ignore the Byte Stuffing(“0xFF 0xFF 0xFD 0xFD”).
  2. Packet ID : If Packet ID is valid, receive additional transmission the size of Packet Length
  3. CRC : Calculate with the received Packet with Byte Stuffing included, and once CRC is matched then remove Byte Stuffing

Instruction Details

Ping

Description

Packet Parameters

Note Status Packet is received from each Device.

Status Packet Description
Parameter 1 Model Number LSB
Parameter 2 Model Number MSB
Parameter 3 Version of Firmware

Example 1

Conditions

Ping Instruction Packet

H1 H2 H3 RSRV ID LEN1 LEN2 INST CRC1 CRC2
0xFF 0xFF 0xFD 0x00 0x01 0x03 0x00 0x01 0x19 0x4E

ID 1 Status Packet

H1 H2 H3 RSRV ID LEN1 LEN2 INST ERR PARAM1 PARAM2 PARAM3 CRC1 CRC2
0xFF 0xFF 0xFD 0x00 0x01 0x07 0x00 0x55 0x00 0x06 0x04 0x26 0x65 0x5D

Example 2

Conditions

Ping Instruction Packet

H1 H2 H3 RSRV ID LEN1 LEN2 INST CRC1 CRC2
0xFF 0xFF 0xFD 0x00 0xFE 0x03 0x00 0x01 0x31 0x42

ID 1 Status Packet

H1 H2 H3 RSRV ID LEN1 LEN2 INST ERR PARAM1 PARAM2 PARAM3 CRC1 CRC2
0xFF 0xFF 0xFD 0x00 0x01 0x07 0x00 0x55 0x00 0x06 0x04 0x26 0x65 0x5D

ID 2 Status Packet

H1 H2 H3 RSRV ID LEN1 LEN2 INST ERR PARAM1 PARAM2 PARAM3 CRC1 CRC2
0xFF 0xFF 0xFD 0x00 0x02 0x07 0x00 0x55 0x00 0x06 0x04 0x26 0x6F 0x6D

Read

Description

Packet Parameters

Instruction Packet Description
Parameter 1 Low-order byte from the starting address
Parameter 2 High-order byte from the starting address
Parameter 3 Low-order byte from the data length (X)
Parameter 4 High-order byte from the data length (X)
Status Packet Description
Parameter 1 First Byte
Parameter 2 Second Byte
Parameter X X-th Byte

Example

Conditions

Read Instruction Packet

H1 H2 H3 RSRV ID LEN1 LEN2 INST PARAM1 PARAM2 PARAM3 PARAM4 CRC1 CRC2
0xFF 0xFF 0xFD 0x00 0x01 0x07 0x00 0x02 0x84 0x00 0x04 0x00 0x1D 0x15

ID 1 Status Packet

H1 H2 H3 RSRV ID LEN1 LEN2 INST ERR PARAM1 PARAM2 PARAM3 PARAM4 CRC1 CRC2
0xFF 0xFF 0xFD 0x00 0x01 0x08 0x00 0x55 0x00 0xA6 0x00 0x00 0x00 0x8C 0xC0

Write

Description

Packet Parameters

Instruction Packet Description
Parameter 1 Low-order byte from the starting address
Parameter 2 High-order byte from the starting address
Parameter 2+1 First Byte
Parameter 2+2 Second Byte
Parameter 2+X X-th Byte

Example

Conditions

Write Instruction Packet

H1 H2 H3 RSRV ID LEN1 LEN2 INST P1 P2 P3 P4 P5 P6 CRC1 CRC2
0xFF 0xFF 0xFD 0x00 0x01 0x09 0x00 0x03 0x74 0x00 0x00 0x02 0x00 0x00 0xCA 0x89

ID 1 Status Packet

H1 H2 H3 RSRV ID LEN1 LEN2 INST ERR CRC1 CRC2
0xFF 0xFF 0xFD 0x00 0x01 0x04 0x00 0x55 0x00 0xA1 0x0C

Reg Write

Description

Packet Parameters

Instruction Packet Description
Parameter 1 Low-order byte from the starting address
Parameter 2 High-order byte from the starting address
Parameter 2+1 First Byte
Parameter 2+2 Second Byte
Parameter 2+X X-th Byte

Example

Condition

Reg Write Instruction Packet

H1 H2 H3 RSRV ID LEN1 LEN2 INST P1 P2 P3 P4 P5 P6 CRC1 CRC2
0xFF 0xFF 0xFD 0x00 0x01 0x09 0x00 0x04 0x68 0x00 0xC8 0x00 0x00 0x00 0xAE 0x8E

ID 1 Status Packet

H1 H2 H3 RSRV ID LEN1 LEN2 INST ERR CRC1 CRC2
0xFF 0xFF 0xFD 0x00 0x01 0x04 0x00 0x55 0x00 0xA1 0x0C

Action

Description

Example

Condition

Action Instruction Packet

H1 H2 H3 RSRV ID LEN1 LEN2 INST CRC1 CRC2
0xFF 0xFF 0xFD 0x00 0x01 0x03 0x00 0x05 0x02 0xCE

ID 1 Status Packet

H1 H2 H3 RSRV ID LEN1 LEN2 INST ERR CRC1 CRC2
0xFF 0xFF 0xFD 0x00 0x01 0x04 0x00 0x55 0x00 0xA1 0x0C

Factory Reset

Description

Parameters

Instruction Packet Description
Parameter 1 0xFF : Reset all
0x01 : Reset all except ID
0x02 : Reset all except ID and Baudrate

Example

Conditions

Factory Reset Instruction Packet

H1 H2 H3 RSRV ID LEN1 LEN2 INST P1 CRC1 CRC2
0xFF 0xFF 0xFD 0x00 0x01 0x04 0x00 0x06 0x01 0xA1 0xE6

ID 1 Status Packet

H1 H2 H3 RSRV ID LEN1 LEN2 INST P1 CRC1 CRC2
0xFF 0xFF 0xFD 0x00 0x01 0x04 0x00 0x55 0x00 0xA1 0x0C

Reboot

Description

Example

Conditions

Reboot Instruction Packet

H1 H2 H3 RSRV ID LEN1 LEN2 INST CRC1 CRC2
0xFF 0xFF 0xFD 0x00 0x01 0x03 0x00 0x08 0x2F 0x4E

ID 1 Status Packet

H1 H2 H3 RSRV ID LEN1 LEN2 INST P1 CRC1 CRC2
0xFF 0xFF 0xFD 0x00 0x01 0x04 0x00 0x55 0x00 0xA1 0x0C

Sync Read

Description

Parameters

Instruction Packet Description
Parameter 1 Low-order byte from the starting address
Parameter 2 High-order byte from the starting address
Parameter 3 Low-order byte from the data length(X)
Parameter 4 High-order byte from the data length(X)
Parameter 4+1 ID of the 1st Device
Parameter 4+2 ID of the 2nd Device
Parameter 4+X ID of the X-th Device

Note Status Packet is received from each Device.

Status Packet Description
Parameter 1 Frist Byte
Parameter 2 Second Byte
Parameter X X-th Byte

Example

Conditions

Sync Read Instruction Packet

H1 H2 H3 RSRV ID LEN1 LEN2 INST P1 P2 P3 P4 P5 P6 CRC1 CRC2
0xFF 0xFF 0xFD 0x00 0xFE 0x09 0x00 0x82 0x84 0x00 0x04 0x00 0x01 0x02 0xCE 0xFA

ID 1 Status Packet

H1 H2 H3 RSRV ID LEN1 LEN2 INST ERR PARAM1 PARAM2 PARAM3 PARAM4 CRC1 CRC2
0xFF 0xFF 0xFD 0x00 0x01 0x08 0x00 0x55 0x00 0xA6 0x00 0x00 0x00 0x8C 0xC0

ID 2 Status Packet

H1 H2 H3 RSRV ID LEN1 LEN2 INST ERR PARAM1 PARAM2 PARAM3 PARAM4 CRC1 CRC2
0xFF 0xFF 0xFD 0x00 0x02 0x08 0x00 0x55 0x00 0x1F 0x08 0x00 0x00 0xBA 0xBE

Sync Write

Description

Parameters

Instruction Packet Description
Parameter 1 Low-order byte from the starting address
Parameter 2 High-order byte from the starting address
Parameter 3 Low-order byte from the data length(X)
Parameter 4 High-order byte from the data length(X)
Parameter 5 [1st Device] ID
Parameter 5+1 [1st Device] 1st Byte
Parameter 5+2 [1st Device] 2nd Byte
[1st Device]…
Parameter 6+X [2nd Device] X-th Byte
Parameter 6 [2nd Device] ID
Parameter 6+1 [2nd Device] 1st Byte
Parameter 6+2 [2nd Device] 2nd Byte
[2nd Device]…
Parameter 6+X [2nd Device] X-th Byte

Example

Conditions

Sync Write Instruction Packet

H1 H2 H3 RSRV ID LEN1 LEN2 INST P1 P2 P3 P4
0xFF 0xFF 0xFD 0x00 0xFE 0x11 0x00 0x83 0x74 0x00 0x04 0x00
P5 P6 P7 P8 P9 P10 P11 P12 P13 P14 CRC1 CRC2
0x01 0x96 0x00 0x00 0x00 0x02 0xAA 0x00 0x00 0x00 0x82 0x87

Bulk Read

Description

Parameters

Instruction Packet Description
Parameter 1 [1st Device] ID
Parameter 2 [1st Device] Low-order byte from the starting address
Parameter 3 [1st Device] High-order byte from the starting address
Parameter 4 [1st Device] Low-order byte from the data
Parameter 5 [1st Device] High-order byte from the data
Parameter 6 [2nd Device] ID
Parameter 7 [2nd Device] Low-order byte from the starting address
Parameter 8 [2nd Device] High-order byte from the starting address
Parameter 9 [2nd Device] Low-order byte from the data
Parameter 10 [2nd Device] High-order byte from the data

Note Status Packet is received from each Device.

Status Packet Description
Parameter 1 1st Byte
Parameter 2 2nd Byte
Parameter X X-th Byte

Example

Condition

Bulk Read Instruction Packet

H1 H2 H3 RSRV ID LEN1 LEN2 INST P1 P2 P3 P4 P5
0xFF 0xFF 0xFD 0x00 0xFE 0x0D 0x00 0x92 0x01 0x90 0x00 0x02 0x00
P6 P7 P8 P9 P10 CRC1 CRC2
0x02 0x92 0x00 0x01 0x00 0x1A 0x05

ID 1 Status Packet

H1 H2 H3 RSRV ID LEN1 LEN2 INST ERR PARAM1 PARAM2 CRC1 CRC2
0xFF 0xFF 0xFD 0x00 0x01 0x06 0x00 0x55 0x00 0x77 0x00 0xC3 0x69

ID 2 Status Packet

H1 H2 H3 RSRV ID LEN1 LEN2 INST ERR PARAM1 CRC1 CRC2
0xFF 0xFF 0xFD 0x00 0x02 0x05 0x00 0x55 0x00 0x24 0x8B 0x21

Bulk Write

Description

Parameters

Instruction Packet Description
Parameter 1 [1st Device] ID
Parameter 2 [1st Device] Low-order byte from the starting address
Parameter 3 [1st Device] High-order byte from the starting address
Parameter 4 [1st Device] Low-order byte from the data length(X)
Parameter 5 [1st Device] High-order byte from the data length(X)
Parameter 5+1 [1st Device] 1st Byte
Parameter 5+2 [1st Device] 2nd Byte
Parameter 5+X [1st Device] X-th Byte
Parameter 6+X [2nd Device] ID
Parameter 7+X [2nd Device] Low-order byte from the starting address
Parameter 8+X [2nd Device] High-order byte from the starting address
Parameter 9+X [2nd Device] Low-order byte from the data length(X)
Parameter 10+X [2nd Device] High-order byte from the data length(X)
Parameter 10+X+1 [2nd Device] 1st Byte
Parameter 10+X+2 [2nd Device] 2nd Byte
Parameter 10+X+Y [2nd Device] Y-th Byte

Example

Condition

Bulk Write Instruction Packet

H1 H2 H3 RSRV ID LEN1 LEN2 INST P1 P2 P3 P4 P5 P6 P7
0xFF 0xFF 0xFD 0x00 0xFE 0x10 0x00 0x93 0x01 0x20 0x00 0x02 0x00 0xA0 0x00
P8 P9 P10 P11 P12 P13 CRC1 CRC2
0x02 0x1F 0x00 0x01 0x00 0x50 0xB7 0x68