DETI-Dynamixel Interface  1
dxProtocol.h File Reference

Defines with the instruction codes for the detiDx gateway. More...

Go to the source code of this file.

Macros

#define DX_RESET   0x00
 
#define DX_PING   0x01
 
#define DX_ACTION   0x02
 
#define DX_READ_BYTE   0x03
 
#define DX_WRITE_BYTE   0x04
 
#define DX_READ_WORD   0x05
 
#define DX_WRITE_WORD   0x06
 
#define DX_SYNC_WRITE_BYTE   0x07
 
#define DX_SYNC_WRITE_WORD   0x08
 
#define DX_REG_WRITE_BYTE   0x09
 
#define DX_REG_WRITE_WORD   0x0A
 
#define DX_GOTO_POSITION   0x10
 
#define DX_WRITE_POSITION   0x11
 
#define DX_READ_POSITION   0x12
 

Detailed Description

Defines with the instruction codes for the detiDx gateway.

General communication protocol with board Dynamixel-UA:
general packet: STX CC SS NN XX YY ZZ .. ED CS
Where:
CC - Command
SS - Device Series (0: AX, 1: RX, 2: MX)
NN - Number of bytes of data field
CS - Checksum
STX - Start of packet ''
ED - End of Data '&'

For the examples of each command below:
AA - Address
VV - Value
VH - Value High
VL - Value Low
PH - Position High
PL - Position Low
SH - Speed High
SL - Speed Low
BB - Byte returned from "Read byte" command
WH - High byte returned from "Read Word" command
WL - Low byte returned from "Read Word" command

ER - Error byte (generated by device). If bit7 is set, Timeout error (device did not respond)

Macro Definition Documentation

#define DX_ACTION   0x02

Command: STX 02 SS 00 ED CS
Answer: STX 02 SS 00 ED CS
(Devices do not answer to this command)

#define DX_GOTO_POSITION   0x10

Command: STX 10 SS 05 ID PL PH SL SH ED CS
Answer: STX 10 SS 01 ER ED CS
(if the ID of the destination device is "Broadcast", no answer will be provided by any device. In such case the answer is: STX 10 SS 00 ED CS)

#define DX_PING   0x01

Command: STX 01 SS 01 ID ED CS
Answer: STX 01 SS 01 ER ED CS

#define DX_READ_BYTE   0x03

Command: STX 03 SS 02 ID AA ED CS
Answer: STX 03 SS 02 ER BB ED CS

#define DX_READ_POSITION   0x12

Command: STX 12 SS 01 ID ED CS
Answer: STX 12 SS 03 ER PL PH ED CS

#define DX_READ_WORD   0x05

Command: STX 05 SS 02 ID AA ED CS
Answer: STX 05 SS 03 ER WL WH ED CS

#define DX_REG_WRITE_BYTE   0x09

Command: STX 09 SS 03 ID AA VV ED CS
Answer: STX 09 SS 01 ER ED CS
(if the ID of the destination device is "Broadcast", no answer will be provided by any device. In such case the answer is: STX 09 SS 00 ED CS)

#define DX_REG_WRITE_WORD   0x0A

Command: STX 0A SS 04 ID AA VL VH ED CS
Answer: STX 0A SS 01 ER ED CS
(if the ID of the destination device is "Broadcast", no answer will be provided by any device. In such case the answer is: STX 0A SS 00 ED CS)

#define DX_RESET   0x00

Command: STX 00 SS 01 ID ED CS
Answer: STX 00 SS 01 ER ED CS

#define DX_SYNC_WRITE_BYTE   0x07

Command: STX 07 SS NN AA ID1 VV1 ID2 VV2 ... ED CS
Answer: STX 07 SS 00 ED CS

#define DX_SYNC_WRITE_WORD   0x08

Command: STX 08 SS NN AA ID1 VL1 VH1 ID2 VL2 VH2 ... ED CS
Answer: STX 08 SS 00 ED CS

#define DX_WRITE_BYTE   0x04

Command: STX 04 SS 03 ID AA VV ED CS
Answer: STX 04 SS 01 ER ED CS
(if the ID of the destination device is "Broadcast", no answer will be provided by any device. In such case the answer is: STX 04 SS 00 ED CS)

#define DX_WRITE_POSITION   0x11

Command: STX 11 SS 05 ID PL PH SL SH ED CS
Answer: STX 11 SS 01 ER ED CS
(if the ID of the destination device is "Broadcast", no answer will be provided by any device. In such case the answer is: STX 11 SS 00 ED CS)

#define DX_WRITE_WORD   0x06

Command: STX 06 SS 04 ID AA VL VH ED CS
Answer: STX 06 SS 01 ER ED CS
(if the ID of the destination device is "Broadcast", no answer will be provided by any device. In such case the answer is: STX 06 SS 00 ED CS)