Moog Animatics SmartMotor™ Developer's Guide,Rev. L
Page 862 of 909
If all their values are added together the result is 255. By leaving particular bits out, any sum
between zero and 255 can be created. Look at the following example bytes and their decimal
values:
Byte Value
0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 1 1
0 0 0 0 0 0 1 0 2
0 0 0 0 0 0 1 1 3
0 0 0 1 0 0 0 0 16
0 0 0 1 1 1 1 0 30
0 0 1 1 1 1 0 0 60
1 0 0 0 0 0 0 0 128
1 0 0 1 1 1 0 1 157
1 1 1 1 1 1 1 1 255
To make use of the limited memory available with micro controllers that can fit into a
SmartMotor, there are occasions where every bit is used. One example is Status Word 0. A
single value can be uploaded from a SmartMotor and be binary coded with eight, sixteen or
thirty-two independent bits of information. The following is the Status Word 0 and its 16 bits of
coded information:
Name Description Bit Value
Drive ready 0 1
Bo Motor OFF 1 2
Bt Trajectory in progress 2 4
Bus voltage fault 3 8
Ba Over current 4 16
Bh Excessive temperature fault 5 32
Be Excessive position error fault 6 64
Bv Velocity limit fault 7 128
Real-time temperature limit 8 256
Derivative of position error limit 9 512
Hardware right (+) limit enabled 10 1024
Hardware left (-) limit enabled 11 2048
Br Historical right (+) limit fault 12 4096
Bl Historical left (-) limit fault 13 8192
Bp Real time right (+) limit 14 16384
Bm Real time left (-) limit 15 32768
There are three useful mathematical operators that work on binary data:
l
& (bit-wise and) compares the two operands (bytes, words or longs) and looks for what
they have in common. The resulting data has ones only where there were ones in both
operands.
l
| (bit-wise or) results in a one for each bit corresponding to a one in either operand.
l
!| (bit-wise exclusive or) results in a one for each bit corresponding to a one in either
operand. It produces a one for each bit when the corresponding bits in the two operands
are different and a zero when they are the same.
Appendix: Binary Data