SOLO BETA User Manual
Convert Hex data read from SOLO to signed Int32:
– If the data read from SOLO is less than or equal to 0x7FFFFFFF(Hex) or 2147483647
(decimal), This means the data is positive
When the data is positive, we can treat it like a normal unsigned value, so you can just directly
convert the Hex value to decimal
– If the data read from SOLO is greater than 0x7FFFFFFF(Hex) or 2147483647(decimal), This
means the data is negative, so the conversion will be as :
1) Subtract the data from 0xFFFFFFFF and then add a 0x1 to it (add 1 to it)
2) Convert the result of step “1” into Decimal format
3) Multiply the result of step 3 to “-1”
Example 1_ positive Numbers:
Data read from SOLO is “0x0003F393”
- The data is smaller than 0x7FFFFFFF so it becomes : Dec (0x0003F393) = 258963
Example 2_ negative Numbers:
Data read from SOLO is “0xFFFCA8AD”
- The data is bigger than 0x7FFFFFFF so we will have:
1. (0xFFFFFFFF - 0xFFFCA8AD ) + 1 = 0x00035753
2. Dec(0x00035753) = 218963
3. 218963 * -1 = -218963
www.solomotorcontrollers.com
January 2021 - Revision V_1.0.5 Copyright © 2020, All right Reversed. SOLO motor controllers.
53