for example i set the torque:
- CODE: SELECT_ALL_CODE
word stat;
stat = servo1.SetTorqueLimit(512);
here, the stat is the variable that u get all the error and alarm.
the variable stat contains 16 bits of error status and alarm status as following:
Bit <Return Packet Error>
15 --
14 --
13 --
12 --
11 Checksum error
10 ID mismatch
9 Wrong header
8 Packet lost or receive time out
Bit <Servo Returned Error>
7 --
6 Instruction error
5 Overload error
4 Checksum error
3 Range error
2 Overheating error
1 Angle limit error
0 Input voltage error
the lower 8 bits are servo's alarm status. the higher 8 bits are return packet error.
so if u wan to know if overload occur, just check the bit 5 of stat:
byte overloaderr;
overloaderr=stat&0x0020;
if u wan to check any of error occur just read the stat value if it is more than 1 then means got error.
if (stat&0xFF00)
{
// return packet got error
}
if (stat&0x00FF)
{
//G15 alarmed for certain error
}