C PacketHandler
-
Description : Base functions for packet construction.
-
Members : None
-
Methods
Methods | Description |
---|---|
packetHandler | Initializes members of packet data pointer struct |
printTxRxResult | Shows communication result (Deprecated Methods. Please check *getTxRxResult) |
printRxPacketError | Shows hardware error (Deprecated Methods. Please check *getRxPacketError) |
getLastTxRxResult | Gets last communication result |
getLastRxPacketError | Gets last hardware error |
setDataWrite | Gets last communication result |
getDataRead | Gets last hardware error |
txPacket | Transmits the packet |
rxPacket | Receives the packet |
fastReadRxPacket | Receives the packet quickly |
txRxPacket | Transmits and receives the packet |
ping | ping DYNAMIXEL |
pingGetModelNum | Ping DYNAMIXEL and get its model number |
broadcastPing | ping all connected DYNAMIXEL’s |
getBroadcastPingResult | Get IDs of DYNAMIXEL’s responded by BroadcastPing2 |
action | Commands ‘Run’ the Regwritten |
regWrite | Writes the packets and wait for the ‘Action’ command |
reboot | Reboots DYNAMIXEL |
clearMultiTurn | Reset the Present Position |
factoryReset | Resets all DYNAMIXEL settings |
readTx | Transmits N byte read instruction packet |
readRx | Receives N byte read status packet |
fastSyncReadRx | Receives N byte read status packet quickly |
readTxRx | Transmits and receives N byte packet |
read1ByteTx | Transmits 1 byte read instruction packet |
read1ByteRx | Receives 1 byte read status packet |
read1ByteTxRx | Transmits and receives 1 byte packet |
read2ByteTx | Transmits 2 byte read instruction packet |
read2ByteRx | Receives 2 byte read status packet |
read2ByteTxRx | Transmits and receives 2 byte packet |
read4ByteTx | Transmits 4 byte read instruction packet |
read4ByteRx | Receives 4 byte read status packet |
read4ByteTxRx | Transmits and receives 4 byte packet |
writeTxOnly | Transmits N byte write instruction packet |
writeTxRx | Transmits and receives N byte packet |
write1ByteTxOnly | Transmits 1 byte write instruction packet |
write1ByteTxRx | Transmits and receives 1 byte packet |
write2ByteTxOnly | Transmits 2 byte write instruction packet |
write2ByteTxRx | Transmits and receives 2 byte packet |
write4ByteTxOnly | Transmits 4 byte write instruction packet |
write4ByteTxRx | Transmits and receives 4 byte packet |
regWriteTxOnly | Transmits register write instruction packet |
regWriteTxRx | Transmits and receives register write packet |
syncReadTx | Transmits N byte sync read Instruction packet |
fastSyncReadTx | Transmits N byte sync read Instruction packet quickly |
syncWriteTxOnly | Transmits N byte sync write Instruction packet |
bulkReadTx | Transmits N byte bulk read Instruction packet |
bulkWriteTxOnly | Transmits N byte bulk write Instruction packet |
- Enumerator
Enumerator | Description |
---|---|
DXL_MAKEWORD(a, b) | makes value from a and b to word type |
DXL_MAKEDWORD(a, b) | makes value from a and b to dword type |
DXL_LOWORD(l) | gets lower word type value from l |
DXL_HIWORD(l) | gets higher word type value from l |
DXL_LOBYTE(w) | gets lower byte type value from w |
DXL_HIBYTE(w) | gets higher byte type value from w |
BROADCAST_ID | := 0xFE Broadcast ID |
MAX_ID | := 0xFC Maximum ID value |
INST_PING | := 1 Instruction value of ping |
INST_READ | := 2 Instruction value of Read |
INST_WRITE | := 3 Instruction value of Write |
INST_REG_WRITE | := 4 Instruction value of Register Write |
INST_ACTION | := 5 Instruction value of Action |
INST_FACTORY_RESET | := 6 Instruction value of Factory Reset |
INST_SYNC_WRITE | := 131 Instruction value of Sync Write |
INST_BULK_READ | := 146 Instruction value of Bulk Read |
INST_REBOOT | := 8 Instruction value of Reboot |
INST_CLEAR | := 16 Instruction value of Clear |
INST_STATUS | := 85 Instruction value of Status |
INST_SYNC_READ | := 130 Instruction value of Sync Read |
INST_FAST_SYNC_READ | := 138 Instruction value of Fast Sync Read |
INST_BULK_WRITE | := 147 Instruction value of Bulk Write |
COMM_SUCCESS | := 0 Status of Communication Success |
COMM_PORT_BUSY | := -1000 Status of Port in use |
COMM_TX_FAIL | := -1001 Status of Transmit packet failed |
COMM_RX_FAIL | := -1002 Status of Receive packet failed |
COMM_TX_ERROR | := -2000 Status of Transmit packet error |
COMM_RX_WAITING | := -3000 Status of Receive packet waiting |
COMM_RX_TIMEOUT | := -3001 Status of Receive packet timeout |
COMM_RX_CORRUPT | := -3002 Status of Receive packet corrupt |
COMM_NOT_AVAILABLE | := -9000 Status of Unavailable in protocol 1.0 |
Method References
packetHandler
- Syntax
void packetHandler()
-
Parameters
None
-
Detailed Description
This function initializes the parameters for packet construction. The function resizes
packetData
struct and initialzes struct members.
printTxRxResult
- Syntax
const char *getTxRxResult(int protocol_version, int result)
- Parameters
Parameters | Description |
---|---|
protocol_version | Protocol version |
result | Communication result |
-
Detailed Description
printTxRxResult is Deprecated. Please use the getTxRxResult instead of printTxRxResult.
This function calls either
getTxRxResult1
orgetTxRxResult2
function depending on theprotocol_version
.
printRxPacketError
- Syntax
const char *getRxPacketError(int protocol_version, uint8_t error)
- Parameters
Parameters | Description |
---|---|
protocol_version | Protocol version |
error | Hardware error |
-
Detailed Description
printRxPacketError is Deprecated. Please use the getRxPacketError instead of printRxPacketError.
This function calls either
getRxPacketError1
orgetRxPacketError2
function depending on theprotocol_version
.
getLastTxRxResult
- Syntax
int getLastTxRxResult(int port_num, int protocol_version)
- Parameters
Parameters | Description |
---|---|
port_num | Port number |
protocol_version | Protocol version |
-
Detailed Description
This function calls either
getLastTxRxResult1
orgetLastTxRxResult2
function depending on theprotocol_version
.
getLastRxPacketError
- Syntax
uint8_t getLastRxPacketError(int port_num, int protocol_version)
- Parameters
Parameters | Description |
---|---|
port_num | Port number |
protocol_version | Protocol version |
-
Detailed Description
This function calls either
getLastRxPacketError1
orgetLastRxPacketError2
function depending on theprotocol_version
.
setDataWrite
- Syntax
void setDataWrite(int port_num, int protocol_version, uint16_t data_length, uint16_t data_pos, uint32_t data)
- Parameters
Parameters | Description |
---|---|
port_num | Port number |
protocol_version | Protocol version |
data_length | Data length |
data_pos | Targeted position of array element |
data | Data |
-
Detailed Description
This function calls either
setDataWrite1
orsetDataWrite2
function depending on theprotocol_version
.
getDataRead
- Syntax
uint32_t getDataRead(int port_num, int protocol_version, uint16_t data_length, uint16_t data_pos)
- Parameters
Parameters | Description |
---|---|
port_num | Port number |
protocol_version | Protocol version |
data_length | Data length |
data_pos | Targeted position of array element |
-
Detailed Description
This function calls either
getDataRead1
orgetDataRead2
function depending on theprotocol_version
.
txPacket
- Syntax
void txPacket(int port_num, int protocol_version)
- Parameters
Parameters | Description |
---|---|
port_num | Port_num |
protocol_version | Protocol version |
-
Detailed Description
This function calls either
txPacket1
ortxPacket2
function depending on theprotocol_version
.
rxPacket
- Syntax
void rxPacket(int port_num, int protocol_version)
- Parameters
Parameters | Description |
---|---|
port_num | Port number |
protocol_version | Protocol version |
-
Detailed Description
This function calls either
rxPacket1
orrxPacket2
function depending on theprotocol_version
.
fastReadRxPacket
- Syntax
void fastReadRxPacket(int port_num, int protocol_version)
- Parameters
Parameters | Description |
---|---|
port_num | Port number |
protocol_version | Protocol version |
-
Detailed Description
This function calls either
rxPacket1
orfastRxPacket2
function depending on theprotocol_version
.
txRxPacket
- Syntax
void txRxPacket(int port_num, int protocol_version)
- Parameters
Parameters | Description |
---|---|
port_num | Port number |
protocol_version | Protocol version |
-
Detailed Description
This function calls either
txRxPacket1
ortxRxPacket2
function depending on theprotocol_version
.
ping
- Syntax
void ping (int port_num, int protocol_version, uint8_t id)
- Parameters
Parameters | Description |
---|---|
port_num | Port number |
protocol_version | Protocol version |
id | DYNAMIXEL ID |
-
Detailed Description
This function calls either
ping1
orping2
function depending on theprotocol_version
.
pingGetModelNum
- Syntax
uint16_t pingGetModelNum (int port_num, int protocol_version, int id)
- Parameters
Parameters | Description |
---|---|
port_num | Port number |
protocol_version | Protocol version |
id | DYNAMIXEL ID |
-
Detailed Description
This function calls either
pingGetModelNum1
orpingGetModelNum2
function depending on theprotocol_version
.
broadcastPing
- Syntax
void broadcastPing(int port_num, int protocol_version)
- Parameters
Parameters | Description |
---|---|
port_num | Port number |
protocol_version | Protocol version |
-
Detailed Description
This function calls either
broadcastPing1
orbroadcastPing2
function depending on theprotocol_version
.
getBroadcastPingResult
- Syntax
uint8_t getBroadcastPingResult(int port_num, int protocol_version, int id)
- Parameters
Parameters | Description |
---|---|
port_num | Port number |
protocol_version | Protocol version |
id | DYNAMIXEL ID |
-
Detailed Description
This function calls either
getBroadcastPingResult1
orgetBroadcastPingResult2
function depending on theprotocol_version
.
action
- Syntax
void action(int port_num, int protocol_version, int id)
- Parameters
Parameters | Description |
---|---|
port_num | Port number |
protocol_version | Protocol version |
id | DYNAMIXEL ID |
-
Detailed Description
This function calls either
action1
oraction2
function depending on theprotocol_version
.
reboot
- Syntax
void reboot(int port_num, int protocol_version, uint8_t id)
- Parameters
Parameters | Description |
---|---|
port_num | Port number |
protocol_version | Protocol version |
id | DYNAMIXEL ID |
-
Detailed Description
This function calls either
reboot1
orreboot2
function depending on theprotocol_version
.
clearMultiTurn
- Syntax
void clearMultiTurn(int port_num, int protocol_version, uint8_t id)
- Parameters
Parameters | Description |
---|---|
port_num | Port number |
protocol_version | Protocol version |
id | DYNAMIXEL ID |
-
Detailed Description
This function calls either
clearMultiTurn1
orclearMultiTurn2
function depending on theprotocol_version
.
factoryReset
- Syntax
void factoryReset(int port_num, int protocol_version, uint8_t id, uint8_t option)
- Parameters
Parameters | Description |
---|---|
port_num | Port number |
protocol_version | Protocol version |
id | DYNAMIXEL ID |
option | Reset option |
-
Detailed Description
This function calls either
factoryReset1
orfactoryReset2
function depending on theprotocol_version
.
readTx
- Syntax
void readTx(int port_num, int protocol_version, uint8_t id, uint16_t address, uint16_t length)
- Parameters
Parameters | Description |
---|---|
port_num | Port number |
protocol_version | Protocol version |
id | DYNAMIXEL ID |
address | Address on the control table of DYNAMIXEL |
length | Packet length |
-
Detailed Description
This function calls either
readTx1
orreadTx2
function depending on theprotocol_version
.
readRx
- Syntax
void readRx(int port_num, int protocol_version, uint16_t length)
- Parameters
Parameters | Description |
---|---|
port_num | Port number |
protocol_version | Protocol version |
length | Packet length |
-
Detailed Description
This function calls either
readRx1
orreadRx2
function depending on theprotocol_version
.
fastSyncReadRx
- Syntax
void fastSyncReadRx(int port_num, int protocol_version, uint16_t length)
- Parameters
Parameters | Description |
---|---|
port_num | Port number |
protocol_version | Protocol version |
length | Packet length |
-
Detailed Description
This function calls either
fastReadRx2
function depending on theprotocol_version
.
readTxRx
- Syntax
void readTxRx(int port_num, int protocol_version, uint8_t id, uint16_t address, uint16_t length)
- Parameters
Parameters | Description |
---|---|
port_num | Port number |
protocol_version | Protocol version |
id | DYNAMIXEL ID |
address | Address on the control table of DYNAMIXEL |
length | Packet length |
-
Detailed Description
This function calls either
readTxRx1
orreadTxRx2
function depending on theprotocol_version
.
read1ByteTx
- Syntax
void read1ByteTx(int port_num, int protocol_version, uint8_t id, uint16_t address)
- Parameters
Parameters | Description |
---|---|
port_num | Port number |
protocol_version | Protocol version |
id | DYNAMIXEL ID |
address | Address on the control table of DYNAMIXEL |
-
Detailed Description
This function calls either
read1ByteTx1
orread1ByteTx2
function depending on theprotocol_version
.
read1ByteRx
- Syntax
uint8_t read1ByteRx(int port_num, int protocol_version)
- Parameters
Parameters | Description |
---|---|
port_num | Port number |
protocol_version | Protocol version |
-
Detailed Description
This function calls either
read1ByteRx1
orread1ByteRx2
function depending on theprotocol_version
.
read1ByteTxRx
- Syntax
uint8_t read1ByteTxRx(int port_num, int protocol_version, uint8_t id, uint16_t address)
- Parameters
Parameters | Description |
---|---|
port_num | Port number |
protocol_version | Protocol version |
id | DYNAMIXEL ID |
address | Address on the control table of DYNAMIXEL |
-
Detailed Description
This function calls either
read1ByteTxRx1
orread1ByteTxRx2
function depending on theprotocol_version
.
read2ByteTx
- Syntax
void read2ByteTx(int port_num, int protocol_version, uint8_t id, uint16_t address)
- Parameters
Parameters | Description |
---|---|
port_num | Port number |
protocol_version | Protocol version |
id | DYNAMIXEL ID |
address | Address on the control table of DYNAMIXEL |
-
Detailed Description
This function calls either
read2ByteTx1
orread2ByteTx2
function depending on theprotocol_version
.
read2ByteRx
- Syntax
uint16_t read2ByteRx(int port_num, int protocol_version)
- Parameters
Parameters | Description |
---|---|
port_num | Port number |
protocol_version | Protocol version |
-
Detailed Description
This function calls either
read2ByteRx1
orread2ByteRx2
function depending on theprotocol_version
.
read2ByteTxRx
- Syntax
uint16_t read2ByteTxRx(int port_num, int protocol_version, uint8_t id,uint16_t address)
- Parameters
Parameters | Description |
---|---|
port_num | Port number |
protocol_version | Protocol version |
id | DYNAMIXEL ID |
address | Address on the control table of DYNAMIXEL |
-
Detailed Description
This function calls either
read2ByteTxRx1
orread2ByteTxRx2
function depending on theprotocol_version
.
read4ByteTx
- Syntax
void read4ByteTx(int port_num, int protocol_version, uint8_t id, uint16_t address)
- Parameters
Parameters | Description |
---|---|
port_num | Port number |
protocol_version | Protocol version |
id | DYNAMIXEL ID |
address | Address on the control table of DYNAMIXEL |
-
Detailed Description
This function calls either
read4ByteTx1
orread4ByteTx2
function depending on theprotocol_version
.
read4ByteRx
- Syntax
uint32_t read4ByteRx(int port_num, int protocol_version)
- Parameters
Parameters | Description |
---|---|
port_num | Port number |
protocol_version | Protocol version |
-
Detailed Description
This function calls either
read4ByteRx1
orread4ByteRx2
function depending on theprotocol_version
.
read4ByteTxRx
- Syntax
uint32_t read4ByteTxRx(int port_num, int protocol_version, UIN8_T id, uint16_t address)
- Parameters
Parameters | Description |
---|---|
port_num | Port number |
protocol_version | Protocol version |
id | DYNAMIXEL ID |
address | Address on the control table of DYNAMIXEL |
-
Detailed Description
This function calls either
read4ByteTxRx1
orread4ByteTxRx2
function depending on theprotocol_version
.
writeTxOnly
- Syntax
void writeTxOnly(int port_num, int protocol_version, uint8_t id, uint16_t address, uint16_t length)
- Parameters
Parameters | Description |
---|---|
port_num | Port number |
protocol_version | Protocol version |
id | DYNAMIXEL ID |
address | Address on the control table of DYNAMIXEL |
length | Packet length |
-
Detailed Description
This function calls either
writeTxOnly1
orwriteTxOnly2
function depending on theprotocol_version
.
writeTxRx
- Syntax
void writeTxRx(int port_num, int protocol_version, uint8_t id, uint16_t address, uint16_t length)
- Parameters
Parameters | Description |
---|---|
port_num | Port number |
protocol_version | Protocol version |
id | DYNAMIXEL ID |
address | Address on the control table of DYNAMIXEL |
length | Packet length |
-
Detailed Description
This function calls either
writeTxRx1
orwriteTxRx2
function depending on theprotocol_version
.
write1ByteTxOnly
- Syntax
void write1ByteTxOnly(int port_num, int protocol_version, uint8_t id, uint16_t address, uint8_t data)
- Parameters
Parameters | Description |
---|---|
port_num | Port number |
protocol_version | Protocol version |
id | DYNAMIXEL ID |
address | Address on the control table of DYNAMIXEL |
data | Data for write |
-
Detailed Description
This function calls either
write1ByteTxOnly1
orwrite1ByteTxOnly2
function depending on theprotocol_version
.
write1ByteTxRx
- Syntax
void write1ByteTxRx(int port_num, int protocol_version, uint8_t id, uint16_t address, uint8_t data)
- Parameters
Parameters | Description |
---|---|
port_num | Port number |
protocol_version | Protocol version |
id | DYNAMIXEL ID |
address | Address on the control table of DYNAMIXEL |
data | Data for write |
-
Detailed Description
This function calls either
write1ByteTxRx1
orwrite1ByteTxRx2
function depending on theprotocol_version
.
write2ByteTxOnly
- Syntax
void write2ByteTxOnly(int port_num, int protocol_version, uint8_t id, uint16_t address, uint16_t data)
- Parameters
Parameters | Description |
---|---|
port_num | Port number |
protocol_version | Protocol version |
id | DYNAMIXEL ID |
address | Address on the control table of DYNAMIXEL |
data | Data for write |
-
Detailed Description
This function calls either
write2ByteTxOnly1
orwrite2ByteTxOnly2
function depending on theprotocol_version
.
write2ByteTxRx
- Syntax
void write2ByteTxRx(int port_num, int protocol_version, uint8_t id, uint16_t address, uint16_t data)
- Parameters
Parameters | Description |
---|---|
port_num | Port number |
protocol_version | Protocol version |
id | DYNAMIXEL ID |
address | Address on the control table of DYNAMIXEL |
data | Data for write |
-
Detailed Description
This function calls either
write2ByteTxRx1
orwrite2ByteTxRx2
function depending on theprotocol_version
.
write4ByteTxOnly
- Syntax
void write4ByteTxOnly(int port_num, int protocol_version, uint8_t id, uint16_t address, uint32_t data)
- Parameters
Parameters | Description |
---|---|
port_num | Port number |
protocol_version | Protocol version |
id | DYNAMIXEL ID |
address | Address on the control table of DYNAMIXEL |
data | Data for write |
-
Detailed Description
This function calls either
write4ByteTxOnly1
orwrite4ByteTxOnly2
function depending on theprotocol_version
.
write4ByteTxRx
- Syntax
void write4ByteTxRx(int port_num, int protocol_version, uint8_t id, uint16_t address)
- Parameters
Parameters | Description |
---|---|
port_num | Port number |
protocol_version | Protocol version |
id | DYNAMIXEL ID |
address | Address on the control table of DYNAMIXEL |
-
Detailed Description
This function calls either
write4ByteTxRx1
orwrite4ByteTxRx2
function depending on theprotocol_version
.
regWriteTxOnly
- Syntax
void regWriteTxOnly(int port_num, int protocol_version, uint8_t id, uint16_t address, uint16_t length)
- Parameters
Parameters | Description |
---|---|
port_num | Port number |
protocol_version | Protocol version |
id | DYNAMIXEL ID |
address | Address on the control table of DYNAMIXEL |
length | Packet length |
-
Detailed Description
This function calls either
RegWriteTxOnly1
orRegWriteTxOnly2
function depending on theprotocol_version
.
regWriteTxRx
- Syntax
void regWriteTxRx(int port_num, int protocol_version, uint8_t id, uint16_t address, uint16_t length)
- Parameters
Parameters | Description |
---|---|
port_num | Port number |
protocol_version | Protocol version |
id | DYNAMIXEL ID |
address | Address on the control table of DYNAMIXEL |
length | Packet length |
-
Detailed Description
This function calls either
regWriteTxRx1
orregWriteTxRx2
function depending on theprotocol_version
.
syncReadTx
- Syntax
void syncReadTx(int port_num, int protocol_version, uint16_t start_address, uint16_t data_length, uint16_t param_length)
- Parameters
Parameters | Description |
---|---|
port_num | Port number |
protocol_version | Protocol version |
address | Start address on the control table of DYNAMIXEL |
data_length | Data length |
param_length | Parameter length |
-
Detailed Description
This function calls either
syncReadTx1
orsyncReadTx2
function depending on theprotocol_version
.
fastSyncReadTx
- Syntax
void fastSyncReadTx(iint port_num, int protocol_version, uint16_t start_address, uint16_t data_length, uint16_t param_length)
- Parameters
Parameters | Description |
---|---|
port_num | Port number |
protocol_version | Protocol version |
start_address | Start address on the control table of DYNAMIXEL |
data_length | Data length |
param_length | Parameter length |
-
Detailed Description
This function calls either
fastSyncReadTx2
function depending on theprotocol_version
.
syncWriteTxOnly
- Syntax
void syncWriteTxOnly(int port_num, int protocol_version, uint16_t start_address, uint16_t data_length, uint16_t param_length)
- Parameters
Parameters | Description |
---|---|
port_num | Port number |
protocol_version | Protocol version |
start_address | Start address on the control table of DYNAMIXEL |
data_length | Data length |
param_length | Parameter length |
-
Detailed Description
This function calls either
syncWriteTxOnly1
orsyncWriteTxOnly2
function depending on theprotocol_version
.
bulkReadTx
- Syntax
void bulkReadTx(int port_num, int protocol_version, uint16_t param_length)
- Parameters
Parameters | Description |
---|---|
port_num | Port number |
protocol_version | Protocol version |
param_length | Parameter length |
-
Detailed Description
This function calls either
bulkReadTx1
orbulkReadTx2
function depending on theprotocol_version
.
bulkWriteTxOnly
- Syntax
void bulkWriteTxOnly(int port_num, int protocol_version, uint16_t param_length)
- Parameters
Parameters | Description |
---|---|
port_num | Port number |
protocol_version | Protocol version |
param_length | Parameter length |
-
Detailed Description
This function calls either
bulkWriteTxOnly1
orbulkWriteTxOnly2
function depending on theprotocol_version
.
C Protocol1PacketHandler
- Description
PacketHandler dependent functions for packet construction using Protocol 1.0.
- Members
None
- Methods
Methods | Description |
---|---|
printTxRxResult1 | Shows communication result (Deprecated Methods. Please check *getTxRxResult1) |
printRxPacketError1 | Shows hardware error (Deprecated Methods. Please check *getRxPacketError1) |
getLastTxRxResult1 | Gets last communication result |
getLastRxPacketError1 | Gets last hardware error |
setDataWrite1 | Gets last communication result |
getDataRead1 | Gets last hardware error |
txPacket1 | Transmits the packet |
rxPacket1 | Receives the packet |
txRxPacket1 | Transmits and receives the packet |
ping1 | Ping DYNAMIXEL |
pingGetModelNum1 | Ping DYNAMIXEL and get its model number |
broadcastPing1 | Not available in Protocol 1.0 |
getBroadcastPingResult1 | Not available in Protocol 1.0 |
action1 | Commands ‘Run’ the Regwritten |
RegWrite1 | Writes the packets and wait for the ‘Action’ command |
reboot1 | Not available in Protocol 1.0 |
clearMultiTurn1 | Reset the Present Position |
factoryReset1 | Resets all DYNAMIXEL settings |
readTx1 | Transmits N byte read instruction packet |
readRx1 | Receives N byte read status packet |
readTxRx1 | Transmits and receives N byte packet |
read1ByteTx1 | Transmits 1 byte read instruction packet |
read1ByteRx1 | Receives 1 byte read status packet |
read1ByteTxRx1 | Transmits and receives 1 byte packet |
read2ByteTx1 | Transmits 2 byte read instruction packet |
read2ByteRx1 | Receives 2 byte read status packet |
read2ByteTxRx1 | Transmits and receives 2 byte packet |
read4ByteTx1 | Not available in Protocol 1.0 |
read4ByteRx1 | Not available in Protocol 1.0 |
read4ByteTxRx1 | Not available in Protocol 1.0 |
writeTxOnly1 | Transmits N byte write instruction packet |
writeTxRx1 | Transmits and receives N byte packet |
write1ByteTxOnly1 | Transmits 1 byte write instruction packet |
write1ByteTxRx1 | Transmits and receives 1 byte packet |
write2ByteTxOnly1 | Transmits 2 byte write instruction packet |
write2ByteTxRx1 | Transmits and receives 2 byte packet |
write4ByteTxOnly1 | Not available in Protocol 1.0 |
write4ByteTxRx1 | Not available in Protocol 1.0 |
regWriteTxOnly1 | Transmits register write instruction packet |
regWriteTxRx1 | Transmits and receives register write packet |
syncReadTx1 | Not available in Protocol 1.0 |
syncWriteTxOnly1 | Transmits N byte sync write Instruction packet |
bulkReadTx1 | Transmits N byte bulk read Instruction packet |
bulkWriteTxOnly1 | Not available in Protocol 1.0 |
- Enumerator
None
Method References
printTxRxResult1
- Syntax
const char *getTxRxResult1(int result)
- Parameters
Parameters | Description |
---|---|
result | Communication result |
-
Detailed Description
printTxRxResult1 is Deprecated. Please use the getTxRxResult1 instead of printTxRxResult1.
This function prints out on the console window what communication
result
value means.
printRxPacketError1
- Syntax
const char *getRxPacketError1(uint8_t error)
- Parameters
Parameters | Description |
---|---|
error | Hardware error |
-
Detailed Description
printRxPacketError1 is Deprecated. Please use the getRxPacketError1 instead of printRxPacketError1.
This function prints out on the console window what hardware
error
value means.
getLastTxRxResult1
- Syntax
int getLastTxRxResult1(int port_num)
- Parameters
Parameters | Description |
---|---|
port_num | Port number |
-
Detailed Description
This function returns the communication result of #
port_num
port.
getLastRxPacketError1
- Syntax
uint8_t getLastRxPacketError1(int port_num)
- Parameters
Parameters | Description |
---|---|
port_num | Port number |
-
Detailed Description
This function returns the hardware error of #
port_num
port.
setDataWrite1
- Syntax
void setDataWrite1(int port_num, uint16_t data_length, uint16_t data_pos, uint32_t data)
- Parameters
Parameters | Description |
---|---|
port_num | Port number |
data_length | Data length |
data_pos | Targeted position of array element |
data | Data |
-
Detailed Description
This function puts
Data length
bytes ofData
intodata_pos
element of array for writing data at #port_num
port tx buffer.
getDataRead1
- Syntax
uint32_t getDataRead1(int port_num, uint16_t data_length, uint16_t data_pos)
- Parameters
Parameters | Description |
---|---|
port_num | Port number |
data_length | Data length |
data_pos | Targeted position of array element |
-
Detailed Description
This function gets
data_length
bytes of the data located indata_pos
position of read data array that from #port_num
port rx buffer.
txPacket1
- Syntax
void txPacket1(int port_num)
- Parameters
Parameters | Description |
---|---|
port_num | Port_num |
-
Detailed Description
This function transmits the packet. The function clears the port by
ClearPort
function at first, and stores data in the txpacket storage of #port_num
port. The communication result and the hardware error are available when the function is terminated.
rxPacket1
- Syntax
void rxPacket1(int port_num)
- Parameters
Parameters | Description |
---|---|
port_num | Port number |
-
Detailed Description
This function repeatedly tries to receive packets from #
port_num
port rx buffer until whole packets that it waits to get have arrived, or the packet wait time limit is over, while it filters garbage signals and verify correctness of received signal. The communication result and the hardware error are available when the function is terminated.
txRxPacket1
- Syntax
void txRxPacket1(int port_num)
- Parameters
Parameters | Description |
---|---|
port_num | Port number |
-
Detailed Description
This function stores data for being written into the array for packet transmission and gets data read from rx buffer of #
port_num
port bytxPacket1
andrxPacket1
functions. WhentxPacket1
function succeeds to communicate, it will continue toRxPacket2
and finishes the process if the packet succeeds to be received. In particular, the group handler functions for write, such as SyncWrite, don’t useRxPacket
so the function finishes its operation immediately after thetxPacket1
. Before therxPacket1
, it sets packet timeout if the instruction of received packet is for read. The communication result and the hardware error are available when the function is terminated.
ping1
- Syntax
void ping1 (int port_num, uint8_t id)
- Parameters
Parameters | Description |
---|---|
port_num | Port number |
id | DYNAMIXEL ID |
-
Detailed Description
This function uses
pingGetModelNum1
without requesting DYNAMIXEL to send its the model number. The communication result and the hardware error are available when the function is terminated.
pingGetModelNum1
- Syntax
uint16_t pingGetModelNum1 (int port_num, int id)
- Parameters
Parameters | Description |
---|---|
port_num | Port number |
id | DYNAMIXEL ID |
-
Detailed Description
This function constructs the transmission packet for ping, and stats
txRxPacket1
. Then, the function tries to get the model number of the DYNAMIXEL byreadTxRx1
function. When it succeeds to receive the packet, it returns the model number. The communication result and the hardware error are available when the function is terminated.
broadcastPing1
- Syntax
void broadcastPing1(int port_num)
- Parameters
Parameters | Description |
---|---|
port_num | Port number |
-
Detailed Description
This function is not available with the DYNAMIXEL Protocol 1.0.
getBroadcastPingResult1
- Syntax
uint8_t getBroadcastPingResult1(int port_num, int id)
- Parameters
Parameters | Description |
---|---|
port_num | Port number |
id | DYNAMIXEL ID |
-
Detailed Description
This function is not available with the DYNAMIXEL Protocol 1.0. The function returns false.
action1
- Syntax
void action1(int port_num, int id)
- Parameters
Parameters | Description |
---|---|
port_num | Port number |
id | DYNAMIXEL ID |
-
Detailed Description
This function pulls the trigger of sending txpacket previously set by
regWriteTxOnly1
orregWriteTxRx1
function, usingtxRxPacket1
function. The communication result and the hardware error are available when the function is terminated.
reboot1
- Syntax
void reboot1(int port_num, uint8_t id)
- Parameters
Parameters | Description |
---|---|
port_num | Port number |
id | DYNAMIXEL ID |
-
Detailed Description
This function is not available with the DYNAMIXEL Protocol 1.0.
clearMultiTurn1
- Syntax
void clearMultiTurn1(int port_num, uint8_t id)
- Parameters
Parameters | Description |
---|---|
port_num | Port number |
id | DYNAMIXEL ID |
-
Detailed Description
This function is not available with the DYNAMIXEL Protocol 1.0.
factoryReset1
- Syntax
void factoryReset1(int port_num, uint8_t id, uint8_t option)
- Parameters
Parameters | Description |
---|---|
port_num | Port number |
id | DYNAMIXEL ID |
option | Reset option |
-
Detailed Description
This function constructs the transmission packet for reset DYNAMIXEL, and starts
txRxPacket1
. This resets targeted DYNAMIXEL’s settings to the factory default settings. Theoption
is not available in DYNAMIXEL Protocol 1.0. The communication result and the hardware error are available when the function is terminated.
readTx1
- Syntax
void readTx1(int port_num, uint8_t id, uint16_t address, uint16_t length)
- Parameters
Parameters | Description |
---|---|
port_num | Port number |
id | DYNAMIXEL ID |
address | Address on the control table of DYNAMIXEL |
length | Packet length |
-
Detailed Description
This function constructs the transmission packet with read instruction, and starts
txPacket1
. Then the function callsSetPacketTimeout
function when packet transmission succeeds. This function can’t control more than one DYNAMIXEL at once. The communication result and the hardware error are available when the function is terminated.
readRx1
- Syntax
void readRx1(int port_num, uint16_t length)
- Parameters
Parameters | Description |
---|---|
port_num | Port number |
length | Packet length |
-
Detailed Description
This function calls
rxPacket1
function and gets the packet from read data storage if the communication succeeds. The communication result and the hardware error are available when the function is terminated.
readTxRx1
- Syntax
void readTxRx1(int port_num, uint8_t id, uint16_t address, uint16_t length)
- Parameters
Parameters | Description |
---|---|
port_num | Port number |
id | DYNAMIXEL ID |
address | Address on the control table of DYNAMIXEL |
length | Packet length |
-
Detailed Description
This function calls
readTx1
function andreadRx1
function.readRx1
function will be called whenreadTx1
succeeds. The communication result and the hardware error are available when the function is terminated.
read1ByteTx1
- Syntax
void read1ByteTx1(int port_num, uint8_t id, uint16_t address)
- Parameters
Parameters | Description |
---|---|
port_num | Port number |
id | DYNAMIXEL ID |
address | Address on the control table of DYNAMIXEL |
-
Detailed Description
This function calls
readTx1
function to send 1 Byte read intended packet transmission. The communication result and the hardware error are available when the function is terminated.
read1ByteRx1
- Syntax
uint8_t read1ByteRx1(int port_num)
- Parameters
Parameters | Description |
---|---|
port_num | Port number |
-
Detailed Description
This function calls
readRx1
function to receive response packet of 1 Byte read intended packet transmission. The communication result and the hardware error are available when the function is terminated.
read1ByteTxRx1
- Syntax
uint8_t read1ByteTxRx1(int port_num, uint8_t id, uint16_t address)
- Parameters
Parameters | Description |
---|---|
port_num | Port number |
id | DYNAMIXEL ID |
address | Address on the control table of DYNAMIXEL |
-
Detailed Description
This function calls
readTxRx1
function to read 1 Byte data from DYNAMIXEL. The communication result and the hardware error are available when the function is terminated.
read2ByteTx1
- Syntax
void read2ByteTx1(int port_num, uint8_t id, uint16_t address)
- Parameters
Parameters | Description |
---|---|
port_num | Port number |
id | DYNAMIXEL ID |
address | Address on the control table of DYNAMIXEL |
-
Detailed Description
This function calls
readTx1
function to send 2 Byte read intended packet transmission. The communication result and the hardware error are available when the function is terminated.
read2ByteRx1
- Syntax
uint16_t read2ByteRx1(int port_num)
- Parameters
Parameters | Description |
---|---|
port_num | Port number |
-
Detailed Description
This function calls
readRx1
function to receive response packet of 2 Byte read intended packet transmission. The communication result and the hardware error are available when the function is terminated.
read2ByteTxRx1
- Syntax
uint16_t read2ByteTxRx1(int port_num, uint8_t id,uint16_t address)
- Parameters
Parameters | Description |
---|---|
port_num | Port number |
id | DYNAMIXEL ID |
address | Address on the control table of DYNAMIXEL |
-
Detailed Description
This function calls
readTxRx1
function to read 2 Byte data from DYNAMIXEL. The communication result and the hardware error are available when the function is terminated.
read4ByteTx1
- Syntax
void read4ByteTx1(int port_num, uint8_t id, uint16_t address)
- Parameters
Parameters | Description |
---|---|
port_num | Port number |
id | DYNAMIXEL ID |
address | Address on the control table of DYNAMIXEL |
-
Detailed Description
This function is not available with the DYNAMIXEL Protocol 1.0.
read4ByteRx1
- Syntax
uint32_t read4ByteRx1(int port_num)
- Parameters
Parameters | Description |
---|---|
port_num | Port number |
-
Detailed Description
This function is not available with the DYNAMIXEL Protocol 1.0.
read4ByteTxRx1
- Syntax
uint32_t read4ByteTxRx1(int port_num, UIN8_T id, uint16_t address)
- Parameters
Parameters | Description |
---|---|
port_num | Port number |
id | DYNAMIXEL ID |
address | Address on the control table of DYNAMIXEL |
-
Detailed Description
This function is not available with the DYNAMIXEL Protocol 1.0.
writeTxOnly1
- Syntax
void writeTxOnly1(int port_num, uint8_t id, uint16_t address, uint16_t length)
- Parameters
Parameters | Description |
---|---|
port_num | Port number |
id | DYNAMIXEL ID |
address | Address on the control table of DYNAMIXEL |
length | Packet length |
-
Detailed Description
This function constructs the transmission packet with write instruction, and starts
txPacket1
. The communication result and the hardware error are available when the function is terminated.
writeTxRx1
- Syntax
void writeTxRx1(int port_num, uint8_t id, uint16_t address, uint16_t length)
- Parameters
Parameters | Description |
---|---|
port_num | Port number |
id | DYNAMIXEL ID |
address | Address on the control table of DYNAMIXEL |
length | Packet length |
-
Detailed Description
This function constructs the transmission packet with write instruction, and starts
txRxPacket1
. The communication result and the hardware error are available when the function is terminated.
write1ByteTxOnly1
- Syntax
void write1ByteTxOnly1(int port_num, uint8_t id, uint16_t address, uint8_t data)
- Parameters
Parameters | Description |
---|---|
port_num | Port number |
id | DYNAMIXEL ID |
address | Address on the control table of DYNAMIXEL |
data | Data for write |
-
Detailed Description
This function calls
writeTxOnly1
function to send 1 Byte write intended packet transmission. The communication result and the hardware error are available when the function is terminated.
write1ByteTxRx1
- Syntax
void write1ByteTxRx1(int port_num, uint8_t id, uint16_t address, uint8_t data)
- Parameters
Parameters | Description |
---|---|
port_num | Port number |
id | DYNAMIXEL ID |
address | Address on the control table of DYNAMIXEL |
data | Data for write |
-
Detailed Description
This function calls
writeTxRx1
function to send 1 Byte write intended packet transmission (and reception). The communication result and the hardware error are available when the function is terminated.
write2ByteTxOnly1
- Syntax
void write2ByteTxOnly1(int port_num, uint8_t id, uint16_t address, uint16_t data)
- Parameters
Parameters | Description |
---|---|
port_num | Port number |
id | DYNAMIXEL ID |
address | Address on the control table of DYNAMIXEL |
data | Data for write |
-
Detailed Description
This function calls
writeTxOnly1
function to send 2 Byte write intended packet transmission. The communication result and the hardware error are available when the function is terminated.
write2ByteTxRx1
- Syntax
void write2ByteTxRx1(int port_num, uint8_t id, uint16_t address, uint16_t data)
- Parameters
Parameters | Description |
---|---|
port_num | Port number |
id | DYNAMIXEL ID |
address | Address on the control table of DYNAMIXEL |
data | Data for write |
-
Detailed Description
This function calls
writeTxRx1
function to send 2 Byte write intended packet transmission (and reception). The communication result and the hardware error are available when the function is terminated.
write4ByteTxOnly1
- Syntax
void write4ByteTxOnly1(int port_num, uint8_t id, uint16_t address, uint32_t data)
- Parameters
Parameters | Description |
---|---|
port_num | Port number |
id | DYNAMIXEL ID |
address | Address on the control table of DYNAMIXEL |
data | Data for write |
-
Detailed Description
This function is not available with the DYNAMIXEL Protocol 1.0.
write4ByteTxRx1
- Syntax
void write4ByteTxRx1(int port_num, uint8_t id, uint16_t address, uint32_t data)
- Parameters
Parameters | Description |
---|---|
port_num | Port number |
id | DYNAMIXEL ID |
address | Address on the control table of DYNAMIXEL |
data | Data for write |
-
Detailed Description
This function is not available with the DYNAMIXEL Protocol 1.0.
regWriteTxOnly1
- Syntax
void regWriteTxOnly1(int port_num, uint8_t id, uint16_t address, uint16_t length)
- Parameters
Parameters | Description |
---|---|
port_num | Port number |
id | DYNAMIXEL ID |
address | Address on the control table of DYNAMIXEL |
length | Packet length |
-
Detailed Description
This function intends simultaneous control of more than one DYNAMIXEL. The function writes the data without requesting an action of DYNAMIXEL. The DYNAMIXEL works when the trigger
action1
function is executed. The function needs previous setting of the data to write on the DYNAMIXEL. The communication result and the hardware error are available when the function is terminated.
regWriteTxRx1
- Syntax
void regWriteTxRx1(int port_num, uint8_t id, uint16_t address, uint16_t length)
- Parameters
Parameters | Description |
---|---|
port_num | Port number |
id | DYNAMIXEL ID |
address | Address on the control table of DYNAMIXEL |
length | Packet length |
-
Detailed Description
This function intends simultaneous multiple DYNAMIXEL’s control. The function writes the data without requesting an action of DYNAMIXEL. The DYNAMIXEL works when the trigger
action1
function is executed. The function needs previous setting of the data to write on the DYNAMIXEL. The communication result and the hardware error are available when the function is terminated.
syncReadTx1
- Syntax
void syncReadTx1(int port_num, uint16_t start_address, uint16_t data_length, uint16_t param_length)
- Parameters
Parameters | Description |
---|---|
port_num | Port number |
start_address | Address on the control table of DYNAMIXEL |
data_length | Data length |
param_length | Parameter length |
-
Detailed Description
This function is not available with the DYNAMIXEL Protocol 1.0.
syncWriteTxOnly1
- Syntax
void syncWriteTxOnly1(int port_num, uint16_t start_address, uint16_t data_length, uint16_t param_length)
- Parameters
Parameters | Description |
---|---|
port_num | Port number |
start_address | Address on the control table of DYNAMIXEL |
data_length | Data length |
param_length | Parameter length |
-
Detailed Description
This function intends simultaneous multiple DYNAMIXEL’s control by writing same length of data to the same address on the DYNAMIXEL control table. The function constructs the transmission packet with sync write instruction, and starts
txRxPacket1
. The communication result and the hardware error are available when the function is terminated.
bulkReadTx1
- Syntax
void bulkReadTx1(int port_num, uint16_t param_length)
- Parameters
Parameters | Description |
---|---|
port_num | Port number |
param_length | Parameter length |
-
Detailed Description
This function intends simultaneous multiple DYNAMIXEL’s control by reading different length of data to the different address on the DYNAMIXEL control table. The function constructs the transmission packet with bulk read instruction, and starts
txPacket1
. Then the function callsSetPacketTimeout
function whentxPacket1
succeeds. The communication result and the hardware error are available when the function is terminated.
bulkWriteTxOnly1
- Syntax
void bulkWriteTxOnly1(int port_num, uint16_t param_length)
- Parameters
Parameters | Description |
---|---|
port_num | Port number |
param_length | Parameter length |
-
Detailed Description
This function is not available with the DYNAMIXEL Protocol 1.0.
C Protocol2PacketHandler
-
Description
PacketHandler dependent functions for packet construction using Protocol 2.0.
-
Members
None
-
Methods
Methods | Description |
---|---|
printTxRxResult2 | Shows communication result (Deprecated Methods. Please check *getTxRxResult2) |
printRxPacketError2 | Shows hardware error (Deprecated Methods. Please check *getRxPacketError2) |
getLastTxRxResult2 | Gets last communication result |
getLastRxPacketError2 | Gets last hardware error |
setDataWrite2 | Gets last communication result |
getDataRead2 | Gets last hardware error |
updateCRC | Data transfer check method |
addStuffing | Appends the packet value |
removeStuffing | Removes the packet value |
txPacket2 | Transmits the packet |
rxPacket2 | Receives the packet |
fastRxPacket2 | Receives the packet quickly |
txRxPacket2 | Transmits and receives the packet |
ping2 | Ping DYNAMIXEL |
pingGetModelNum2 | Ping DYNAMIXEL and get its model number |
broadcastPing2 | Ping all connected DYNAMIXEL’s |
getBroadcastPingResult2 | Get IDs of DYNAMIXEL’s responded by broadcastPing2 |
action2 | Commands ‘Run’ the Regwritten |
regWrite2 | Writes the packets and wait for the ‘Action’ command |
reboot2 | Reboots DYNAMIXEL |
clearMultiTurn2 | Clear instruction packet |
factoryReset2 | Resets all DYNAMIXEL settings |
readTx2 | Transmits N byte read instruction packet |
readRx2 | Receives N byte read status packet |
fastReadRx2 | Receives N byte read status packet quickly |
readTxRx2 | Transmits and receives N byte packet |
read1ByteTx2 | Transmits 1 byte read instruction packet |
read1ByteRx2 | Receives 1 byte read status packet |
read1ByteTxRx2 | Transmits and receives 1 byte packet |
read2ByteTx2 | Transmits 2 byte read instruction packet |
read2ByteRx2 | Receives 2 byte read status packet |
read2ByteTxRx2 | Transmits and receives 2 byte packet |
read4ByteTx2 | Transmits 4 byte read instruction packet |
read4ByteRx2 | Receives 4 byte read status packet |
read4ByteTxRx2 | Transmits and receives 4 byte packet |
writeTxOnly2 | Transmits N byte write instruction packet |
writeTxRx2 | Transmits and receives N byte packet |
write1ByteTxOnly2 | Transmits 1 byte write instruction packet |
write1ByteTxRx2 | Transmits and receives 1 byte packet |
write2ByteTxOnly2 | Transmits 2 byte write instruction packet |
write2ByteTxRx2 | Transmits and receives 2 byte packet |
write4ByteTxOnly2 | Transmits 4 byte write instruction packet |
write4ByteTxRx2 | Transmits and receives 4 byte packet |
regWriteTxOnly2 | Transmits register write instruction packet |
regWriteTxRx2 | Transmits and receives register write packet |
syncReadTx2 | Transmits N byte sync read Instruction packet |
fastSyncReadTx2 | Transmits N byte sync read Instruction packet quickly |
syncWriteTxOnly2 | Transmits N byte sync write Instruction packet |
bulkReadTx2 | Transmits N byte bulk read Instruction packet |
bulkWriteTxOnly2 | Transmits N byte bulk write Instruction packet |
-
Enumerator
None
Method References
printTxRxResult2
- Syntax
const char *getTxRxResult2(int result)
- Parameters
Parameters | Description |
---|---|
result | Communication result |
-
Detailed Description
printTxRxResult2 is Deprecated. Please use the getTxRxResult2 instead of printTxRxResult2.
This function prints out on the console window what communication
result
value means.
printRxPacketError2
- Syntax
const char *getRxPacketError2(uint8_t error)
- Parameters
Parameters | Description |
---|---|
error | Hardware error |
-
Detailed Description
printRxPacketError2 is Deprecated. Please use the getRxPacketError2 instead of printRxPacketError2.
This function prints out on the console window what hardware
error
value means.
getLastTxRxResult2
- Syntax
int getLastTxRxResult2(int port_num)
- Parameters
Parameters | Description |
---|---|
port_num | Port number |
-
Detailed Description
This function returns the communication result of #
port_num
port.
getLastRxPacketError2
- Syntax
uint8_t getLastRxPacketError2(int port_num)
- Parameters
Parameters | Description |
---|---|
port_num | Port number |
-
Detailed Description
This function returns the hardware error of #
port_num
port.
setDataWrite2
- Syntax
void setDataWrite2(int port_num, uint16_t data_length, uint16_t data_pos, uint32_t data)
- Parameters
Parameters | Description |
---|---|
port_num | Port number |
data_length | Data length |
data_pos | Targeted position of array element |
data | Data |
-
Detailed Description
This function puts
Data length
bytes ofData
intodata_pos
element of array for writing data at #port_num
port tx buffer.
getDataRead2
- Syntax
uint32_t getDataRead2(int port_num, uint16_t data_length, uint16_t data_pos)
- Parameters
Parameters | Description |
---|---|
port_num | Port number |
data_length | Data length |
data_pos | Targeted position of array element |
-
Detailed Description
This function gets
data_length
bytes of the data located indata_pos
position of read data array that from #port_num
port rx buffer.
updateCRC
- Syntax
uint16_t updateCRC(uint16_t crc_accum, uint8_t *data_blk_ptr, uint16_t data_blk_size)
- Parameters
Parameters | Description |
---|---|
crc_accum | set to ‘0’ |
data_blk_ptr | Packet array pointer |
data_blk_size | Number of bytes in packet excluding CRC |
-
Detailed Description
This function is a data transfer check method.
addStuffing
- Syntax
void addStuffing(uint8_t *packet)
- Parameters
Parameters | Description |
---|---|
packet | packet |
-
Detailed Description
This function appends the packet value.
removeStuffing
- Syntax
void removeStuffing(uint8_t *packet)
- Parameters
Parameters | Description |
---|---|
packet | packet |
-
Detailed Description
This function removes the packet value.
txPacket2
- Syntax
void txPacket2(int port_num)
- Parameters
Parameters | Description |
---|---|
port_num | Port_num |
-
Detailed Description
This function transmits the packet. The function clears the port by
ClearPort
function at first, and stores data in the txpacket storage of #port_num
port. The communication result and the hardware error are available when the function is terminated.
rxPacket2
- Syntax
void rxPacket2(int port_num)
- Parameters
Parameters | Description |
---|---|
port_num | Port number |
-
Detailed Description
This function repeatedly tries to receive packets from #
port_num
port rx buffer until whole packets that it waits to get have arrived, or the packet wait time limit is over, while it filters garbage signals and verify correctness of received signal. The communication result and the hardware error are available when the function is terminated.
fastRxPacket2
- Syntax
void fastRxPacket2(int port_num)
- Parameters
Parameters | Description |
---|---|
port_num | Port number |
-
Detailed Description
This function repeatedly tries to receive packets from #
port_num
port rx buffer until whole packets that it waits to get have arrived, or the packet wait time limit is over, while it filters garbage signals and verify correctness of received signal. And this function do not use Byte Stuffing. The communication result and the hardware error are available when the function is terminated.
txRxPacket2
- Syntax
void txRxPacket2(int port_num)
- Parameters
Parameters | Description |
---|---|
port_num | Port number |
-
Detailed Description
This function stores data for being written into the array for packet transmission and gets data read from rx buffer of #
port_num
port bytxPacket2
andrxPacket2
functions. WhentxPacket2
function succeeds to communicate, it will continue torxPacket2
and finishes the process if the packet succeeds to be received. In particular, the group handler functions for write, such as SyncWrite, and BulkWrite, don’t userxPacket2
so the function finishes its operation immediately after the ‘txPacket2’. Before therxPacket2
, it sets packet timeout if the instruction of received packet is for read. The communication result and the hardware error are available when the function is terminated.
ping2
- Syntax
void ping2 (int port_num, uint8_t id)
- Parameters
Parameters | Description |
---|---|
port_num | Port number |
id | DYNAMIXEL ID |
-
Detailed Description
This function uses
pingGetModelNum2
without requesting DYNAMIXEL to send its the model number. The communication result and the hardware error are available when the function is terminated.
pingGetModelNum2
- Syntax
uint16_t pingGetModelNum2 (int port_num, int id)
- Parameters
Parameters | Description |
---|---|
port_num | Port number |
id | DYNAMIXEL ID |
-
Detailed Description
This function constructs the transmission packet for ping, and stats
txRxPacket2
. Then, the function tries to get the model number of the DYNAMIXEL byreadTxRx2
function. When it succeeds to receive the packet, it returns the model number. The communication result and the hardware error are available when the function is terminated.
broadcastPing2
- Syntax
void broadcastPing2(int port_num)
- Parameters
Parameters | Description |
---|---|
port_num | Port number |
-
Detailed Description
This function finds all connected dynamixels and store their id in the list.
getBroadcastPingResult2
- Syntax
uint8_t getBroadcastPingResult2(int port_num, int id)
- Parameters
Parameters | Description |
---|---|
port_num | Port number |
id | DYNAMIXEL ID |
-
Detailed Description
This function returns whether #
id
DYNAMIXEL responded bybroadcastPing2
function.
action2
- Syntax
void action2(int port_num, int id)
- Parameters
Parameters | Description |
---|---|
port_num | Port number |
id | DYNAMIXEL ID |
-
Detailed Description
This function pulls the trigger of sending txpacket previously set by
regWriteTxOnly2
orregWriteTxRx2
function, usingtxRxPacket2
function. The communication result and the hardware error are available when the function is terminated.
reboot2
- Syntax
void reboot2(int port_num, uint8_t id)
- Parameters
Parameters | Description |
---|---|
port_num | Port number |
id | DYNAMIXEL ID |
-
Detailed Description
This function constructs the transmission packet with reboot instruction, and starts
txRxPacket2
. The function may perform its role when the DYNAMIXEL stops working caused by hardware error. The communication result and the hardware error are available when the function is terminated.
clearMultiTurn2
- Syntax
void clearMultiTurn2(int port_num, uint8_t id)
- Parameters
Parameters | Description |
---|---|
port_num | Port number |
id | DYNAMIXEL ID |
-
Detailed Description
Reset the Present Position value to an absolute value within one rotation (0-4095). The Clear instruction can only be applied when DYNAMIXEL is stopped. Note that if DYNAMIXEL is in motion and the Clear Instruction packet is sent, Result Fail (0x01) will be sent via the Error field of the Status Packet.
factoryReset2
- Syntax
void factoryReset2(int port_num, uint8_t id, uint8_t option)
- Parameters
Parameters | Description |
---|---|
port_num | Port number |
id | DYNAMIXEL ID |
option | Reset option |
-
Detailed Description
This function constructs the transmission packet for reset DYNAMIXEL, and starts
txRxPacket2
. This resets targeted DYNAMIXEL’s settings to the factory default settings. Theoption
indicates the range of which items on the control table should be reset:0xFF
for resetting all values,0x01
for resetting all values except ID,0x02
for resetting all values except ID and Baudrate. The communication result and the hardware error are available when the function is terminated.
readTx2
- Syntax
void readTx2(int port_num, uint8_t id, uint16_t address, uint16_t length)
- Parameters
Parameters | Description |
---|---|
port_num | Port number |
id | DYNAMIXEL ID |
address | Address on the control table of DYNAMIXEL |
length | Packet length |
-
Detailed Description
This function constructs the transmission packet with read instruction, and starts
txPacket2
. Then the function callssetPacketTimeout
function when packet transmission succeeds. This function can’t control more than one DYNAMIXEL at once. The communication result and the hardware error are available when the function is terminated.
readRx2
- Syntax
void readRx2(int port_num, uint16_t length)
- Parameters
Parameters | Description |
---|---|
port_num | Port number |
length | Packet length |
-
Detailed Description
This function calls
rxPacket2
function and gets the packet from read data storage if the communication succeeds. The communication result and the hardware error are available when the function is terminated.
fastReadRx2
- Syntax
void fastReadRx2 (int port_num, uint16_t length)
- Parameters
Parameters | Description |
---|---|
port_num | Port number |
length | Packet length |
-
Detailed Description
This function calls
fastReadRx2
function and gets the packet quickly from read data storage if the communication succeeds. The communication result and the hardware error are available when the function is terminated.
readTxRx2
- Syntax
void readTxRx2(int port_num, uint8_t id, uint16_t address, uint16_t length)
- Parameters
Parameters | Description |
---|---|
port_num | Port number |
id | DYNAMIXEL ID |
address | Address on the control table of DYNAMIXEL |
length | Packet length |
-
Detailed Description
This function calls
readTx2
function andreadRx2
function.readRx2
function will be called whenreadTx2
succeeds. The communication result and the hardware error are available when the function is terminated.
read1ByteTx2
- Syntax
void read1ByteTx2(int port_num, uint8_t id, uint16_t address)
- Parameters
Parameters | Description |
---|---|
port_num | Port number |
id | DYNAMIXEL ID |
address | Address on the control table of DYNAMIXEL |
-
Detailed Description
This function calls
readTx2
function to send 1 Byte read intended packet transmission. The communication result and the hardware error are available when the function is terminated.
read1ByteRx2
- Syntax
uint8_t read1ByteRx2(int port_num)
- Parameters
Parameters | Description |
---|---|
port_num | Port number |
-
Detailed Description
This function calls
readRx2
function to receive response packet of 1 Byte read intended packet transmission. The communication result and the hardware error are available when the function is terminated.
read1ByteTxRx2
- Syntax
uint8_t read1ByteTxRx2(int port_num, uint8_t id, uint16_t address)
- Parameters
Parameters | Description |
---|---|
port_num | Port number |
id | DYNAMIXEL ID |
address | Address on the control table of DYNAMIXEL |
-
Detailed Description
This function calls
readTxRx2
function to read 1 Byte data from DYNAMIXEL. The communication result and the hardware error are available when the function is terminated.
read2ByteTx2
- Syntax
void read2ByteTx2(int port_num, uint8_t id, uint16_t address)
- Parameters
Parameters | Description |
---|---|
port_num | Port number |
id | DYNAMIXEL ID |
address | Address on the control table of DYNAMIXEL |
-
Detailed Description
This function calls
readTx2
function to send 2 Byte read intended packet transmission. The communication result and the hardware error are available when the function is terminated.
read2ByteRx2
- Syntax
uint16_t read2ByteRx2(int port_num)
- Parameters
Parameters | Description |
---|---|
port_num | Port number |
-
Detailed Description
This function calls
readRx2
function to receive response packet of 2 Byte read intended packet transmission. The communication result and the hardware error are available when the function is terminated.
read2ByteTxRx2
- Syntax
uint16_t read2ByteTxRx2(int port_num, uint8_t id,uint16_t address)
- Parameters
Parameters | Description |
---|---|
port_num | Port number |
id | DYNAMIXEL ID |
address | Address on the control table of DYNAMIXEL |
-
Detailed Description
This function calls
readTxRx2
function to read 2 Byte data from DYNAMIXEL. The communication result and the hardware error are available when the function is terminated.
read4ByteTx2
- Syntax
void read4ByteTx2(int port_num, uint8_t id, uint16_t address)
- Parameters
Parameters | Description |
---|---|
port_num | Port number |
id | DYNAMIXEL ID |
address | Address on the control table of DYNAMIXEL |
-
Detailed Description
This function calls
readTx2
function to send 4 Byte read intended packet transmission. The communication result and the hardware error are available when the function is terminated.
read4ByteRx2
- Syntax
uint32_t read4ByteRx2(int port_num)
- Parameters
Parameters | Description |
---|---|
port_num | Port number |
-
Detailed Description
This function calls
readRx2
function to receive response packet of 4 Byte read intended packet transmission. The communication result and the hardware error are available when the function is terminated.
read4ByteTxRx2
- Syntax
uint32_t read4ByteTxRx2(int port_num, UIN8_T id, uint16_t address)
- Parameters
Parameters | Description |
---|---|
port_num | Port number |
id | DYNAMIXEL ID |
address | Address on the control table of DYNAMIXEL |
-
Detailed Description
This function calls
readTxRx2
function to read 4 Byte data from DYNAMIXEL. The communication result and the hardware error are available when the function is terminated.
writeTxOnly2
- Syntax
void writeTxOnly2(int port_num, uint8_t id, uint16_t address, uint16_t length)
- Parameters
Parameters | Description |
---|---|
port_num | Port number |
id | DYNAMIXEL ID |
address | Address on the control table of DYNAMIXEL |
length | Packet length |
-
Detailed Description
This function constructs the transmission packet with write instruction, and starts
txPacket2
. The communication result and the hardware error are available when the function is terminated.
writeTxRx2
- Syntax
void writeTxRx2(int port_num, uint8_t id, uint16_t address, uint16_t length)
- Parameters
Parameters | Description |
---|---|
port_num | Port number |
id | DYNAMIXEL ID |
address | Address on the control table of DYNAMIXEL |
length | Packet length |
-
Detailed Description
This function constructs the transmission packet with write instruction, and starts
txRxPacket2
. The communication result and the hardware error are available when the function is terminated.
write1ByteTxOnly2
- Syntax
void write1ByteTxOnly2(int port_num, uint8_t id, uint16_t address, uint8_t data)
- Parameters
Parameters | Description |
---|---|
port_num | Port number |
id | DYNAMIXEL ID |
address | Address on the control table of DYNAMIXEL |
data | Data for write |
-
Detailed Description
This function calls
writeTxOnly2
function to send 1 Byte write intended packet transmission. The communication result and the hardware error are available when the function is terminated.
write1ByteTxRx2
- Syntax
void write1ByteTxRx2(int port_num, uint8_t id, uint16_t address, uint8_t data)
- Parameters
Parameters | Description |
---|---|
port_num | Port number |
id | DYNAMIXEL ID |
address | Address on the control table of DYNAMIXEL |
data | Data for write |
-
Detailed Description
This function calls
writeTxRx2
function to send 1 Byte write intended packet transmission (and reception). The communication result and the hardware error are available when the function is terminated.
write2ByteTxOnly2
- Syntax
void write2ByteTxOnly2(int port_num, uint8_t id, uint16_t address, uint16_t data)
- Parameters
Parameters | Description |
---|---|
port_num | Port number |
id | DYNAMIXEL ID |
address | Address on the control table of DYNAMIXEL |
data | Data for write |
-
Detailed Description
This function calls
writeTxOnly2
function to send 2 Byte write intended packet transmission. The communication result and the hardware error are available when the function is terminated.
write2ByteTxRx2
- Syntax
void write2ByteTxRx2(int port_num, uint8_t id, uint16_t address, uint16_t data)
- Parameters
Parameters | Description |
---|---|
port_num | Port number |
id | DYNAMIXEL ID |
address | Address on the control table of DYNAMIXEL |
data | Data for write |
-
Detailed Description
This function calls
writeTxRx2
function to send 2 Byte write intended packet transmission (and reception). The communication result and the hardware error are available when the function is terminated.
write4ByteTxOnly2
- Syntax
void write4ByteTxOnly2(int port_num, uint8_t id, uint16_t address, uint32_t data)
- Parameters
Parameters | Description |
---|---|
port_num | Port number |
id | DYNAMIXEL ID |
address | Address on the control table of DYNAMIXEL |
data | Data for write |
-
Detailed Description
This function calls
writeTxOnly2
function to send 4 Byte write intended packet transmission. The communication result and the hardware error are available when the function is terminated.
write4ByteTxRx2
- Syntax
void write4ByteTxRx2(int port_num, uint8_t id, uint16_t address, uint32_t data)
- Parameters
Parameters | Description |
---|---|
port_num | Port number |
id | DYNAMIXEL ID |
address | Address on the control table of DYNAMIXEL |
data | Data for write |
-
Detailed Description
This function calls
writeTxRx2
function to send 4 Byte write intended packet transmission (and reception). The communication result and the hardware error are available when the function is terminated.
regWriteTxOnly2
- Syntax
void regWriteTxOnly2(int port_num, uint8_t id, uint16_t address, uint16_t length)
- Parameters
Parameters | Description |
---|---|
port_num | Port number |
id | DYNAMIXEL ID |
address | Address on the control table of DYNAMIXEL |
length | Packet length |
-
Detailed Description
This function intends simultaneous control of more than one DYNAMIXEL. The function writes the data without requesting an action of DYNAMIXEL. The DYNAMIXEL works when the trigger
action2
function is executed. The function needs previous setting of the data to write on the DYNAMIXEL. The communication result and the hardware error are available when the function is terminated.
regWriteTxRx2
- Syntax
void regWriteTxRx2(int port_num, uint8_t id, uint16_t address, uint16_t length)
- Parameters
Parameters | Description |
---|---|
port_num | Port number |
id | DYNAMIXEL ID |
address | Address on the control table of DYNAMIXEL |
length | Packet length |
-
Detailed Description
This function intends simultaneous multiple DYNAMIXEL’s control. The function writes the data without requesting an action of DYNAMIXEL. The DYNAMIXEL works when the trigger
action2
function is executed. The function needs previous setting of the data to write on the DYNAMIXEL. The communication result and the hardware error are available when the function is terminated.
syncReadTx2
- Syntax
void syncReadTx2(int port_num, uint16_t start_address, uint16_t data_length, uint16_t param_length)
- Parameters
Parameters | Description |
---|---|
port_num | Port number |
start_address | Start address on the control table of DYNAMIXEL |
data_length | Data length |
param_length | Parameter length |
-
Detailed Description
This function intends simultanoues multiple DYNAMIXEL’s control by reading same length of data from the same address on the DYNAMIXEL control table. The function constructs the transmission packet with sync read instruction, and starts ‘txPacket2’. Then the function calls
setPacketTimeout
function whentxPacket2
succeeds. The communication result and the hardware error are available when the function is terminated.
fastSyncReadTx2
- Syntax
void fastSyncReadTx2(int port_num, uint16_t start_address, uint16_t data_length, uint16_t param_length)
- Parameters
Parameters | Description |
---|---|
port_num | Port number |
start_address | Start address on the control table of DYNAMIXEL |
data_length | Data length |
param_length | Parameter length |
-
Detailed Description
This function intends simultanoues multiple DYNAMIXEL’s control by reading same length of data from the same address on the DYNAMIXEL control table. The function constructs the transmission packet with sync read instruction, and starts ‘txPacket2’. Then the function calls
setPacketTimeout
function whentxPacket2
succeeds. The communication result and the hardware error are available when the function is terminated.
syncWriteTxOnly2
- Syntax
void syncWriteTxOnly2(int port_num, uint16_t start_address, uint16_t data_length, uint16_t param_length)
- Parameters
Parameters | Description |
---|---|
port_num | Port number |
start_address | Start address on the control table of DYNAMIXEL |
data_length | Data length |
param_length | Parameter length |
-
Detailed Description
This function intends simultaneous multiple DYNAMIXEL’s control by writing same length of data to the same address on the DYNAMIXEL control table. The function constructs the transmission packet with sync write instruction, and starts
txRxPacket2
. The communication result and the hardware error are available when the function is terminated.
bulkReadTx2
- Syntax
void bulkReadTx2(int port_num, uint16_t param_length)
- Parameters
Parameters | Description |
---|---|
port_num | Port number |
param_length | Parameter length |
-
Detailed Description
This function intends simultaneous multiple DYNAMIXEL’s control by writing different length of data to the different address on the DYNAMIXEL control table. The function constructs the transmission packet with bulk read instruction, and starts
txPacket2
. Then the function callssetPacketTimeout
function whentxPacket2
succeeds. The communication result and the hardware error are available when the function is terminated.
bulkWriteTxOnly2
- Syntax
void bulkWriteTxOnly2(int port_num, uint16_t param_length)
- Parameters
Parameters | Description |
---|---|
port_num | Port number |
param_length | Parameter length |
-
Detailed Description
This function intends simultaneous multiple DYNAMIXEL’s control by writing different length of data from the different address on the DYNAMIXEL control table. The function constructs the transmission packet with bulk write instruction, and starts
TxRxPacket
. The communication result and the hardware error are available when the function is terminated.