Quick Start for Dynamixel Pro v1.00b
Page
121
/
139
// This step is essential. After Torque Enable is on RAM area addresses can be changed.
DXL.WriteByte
(
1, TORQUE_ENABLE, 1, 0
);
//
after enabling Torque Enable
//
sad main routine involving RAM address(es) here (i.e. Goal Position)
…
// the following lines verify that Dynamixel’s Torque Enable has been turned on
// by outputting a “1” onscreen
result = DXL.ReadByte(1, TORQUE_ENABLE, &On, &error);
if (
result == COMM_RXSUCCESS
)
printf( "%d\n", On);
// must close USB-to-Dynamixel before ending
DXL.Disconnect();
return
0;
}
1.4.3
Implementing read/write functions
i.
Write functions
-
Monitor for Dynamixel PRO in Linux emphasized that different size addresses
required different type of write commands. The same concept applies at the source
code level.
-
There are 4 types of write commands for Dynamixel PRO
-
Implement
WriteByte
for addresses with size of 1 byte
-
Implement
WriteWord
for addresses with size of 2 bytes
-
Implement
WriteDWord
for addresses with size of 4 bytes
-
Implement
SyncWrite
(explained later) for for multiple Dynamixel PROs at
once.
ii.
Read functions
-
Monitor for Dynamixel PRO in Linux emphasized that different size addresses
required different type of read commands. The same concept applies at the source
code level.
-
There are 4 types of write commands for Dynamixel PRO
-
Implement
ReadByte
for addresses with size of 1 byte
-
Implement
ReadWord
for addresses with size of 2 bytes
-
Implement
ReadDWord
for addresses with size of 4 bytes
-
Implement
BulkRead
(explained later) for multiple Dynamixel PROs at once.
The following example is a simple read/write sample code of Dynamixel PRO in Joint Mode (default)
/dxl_sdk-20/example/ReadWrite/main.cpp (partly shown)
// declare the following in preprocessor for illustrative purposes
#define P_TORQUE_ENABLE 562
#define P_GOAL_POSITION_LL 596
#define P_PRESENT_POSITION_LL 611
#define P_MOVING 610
Summary of Contents for Dynamixel Pro
Page 1: ...Quick Start for Dynamixel Pro ...
Page 8: ...Quick Start for Dynamixel Pro v1 00b Page 8 139 ...
Page 33: ...Quick Start for Dynamixel Pro v1 00b Page 33 139 Check Dynamixel PRO firmware update results ...
Page 37: ...Quick Start for Dynamixel Pro v1 00b Page 37 139 Dynamixel PRO firmware recovery is complete ...
Page 66: ...Quick Start for Dynamixel Pro v1 00b Page 66 139 The present temperature is constantly read ...
Page 133: ...Quick Start for Dynamixel Pro v1 00b Page 133 139 2 3 2 42 series H42 L42 ...
Page 136: ...Quick Start for Dynamixel Pro v1 00b Page 136 139 ...
Page 138: ...Quick Start for Dynamixel Pro v1 00b Page 138 139 iii L42 10 S300 R ...
Page 139: ...Quick Start for Dynamixel Pro v1 00b Page 139 139 2 5 Model notation ...