SetPTPcmd converting from float to byte


#1

I am struggling on the parameters of PTP command (ID 84)

From my understand a message such as this one:
AA AA 13 54 03 01 00 00 0A 43 00 00 00 00 00 00 00 00 00 00 00 00 5B
Header: AA AA
Len:13
ID:54
Ctrl: 03
PTP Mode: 01
X: 00 00 0A 43
Y: 00 00 00 00
Z: 00 00 00 00
R: 00 00 00 00
Checksum: 5B

Is my understanding correct?

I am struggling with the X, Y and Z values. Is the right most value the smallest? I’ve tried converting the floating point number from the X,Y Z position derived from Dobot studio (the 4 decimal position). However, when I entered the converted value into the command, the robot would either not move or move to a incorrect position. I know I am doing something wrong in the conversion process. Can someone provide me with some guidance converting from float to bytes?


#2

It can get confusing. I suggest you use Dobot Studio to verify the X,Y, Z, R values also.

I believe 00 00 0A 43 means 2627mm on X (beyond the range of the Dobot)

Using Windows 10 Calculator (Programmer mode)

Converter1: http://www.scadacore.com/field-tools/programming-calculators/online-hex-converter/

Converter2: https://www.easycalculation.com/hex-converter.php