AH500 Motion Control Module Manual S 1 : Augend; S 2 : Addend; D : Sum The binary value in S 2 is added to the binary value in S 1 , and the sum is Explanation stored in D . The highest bit in S 1 and the highest bit in S 2 are sign bits. If the sign bit in a register is 0, the value in the register is a positive value. If the sign bit in a register is 1, the value in the register is a negative value. SM1064 is the zero flag in an Ox motion subroutine, and SM968 is the zero flag in O100. SM1065 is the borrow flag in an Ox motion subroutine, and SM969 is the borrow flag in O100. SM1066 is the carry flag in an Ox motion subroutine, and SM970 is the carry flag in O100.
The flags related to 16-bit binary addition and 32-bit binary addition are listed below. 16-bit binary addition: 1. If the operation result gotten is 0, a zero flag will be ON. 2. If the operation result gotten is less than –32,768, a borrow flag will be ON. 3. If the operation result gotten is greater than 32,767, a carry flag will be ON. 32-bit binary addition: 1. If the operation result gotten is 0, a zero flag will be ON. 2. If the operation result gotten is less than –2,147,483,648, a borrow flag will be ON. 3. If the operation result gotten is greater than 2,147,483,647, a carry flag will be ON. 16-bit binary addition:
When X0.0 is ON, the addend in D10 is added to the augend in D0, and the sum is stored in D20. Example 1 X0.0 32-bit binary addition: When X0.1 is ON, the value in (D41, D40) is added to the augend in (D31, D30), and the sum is stored in (D51, D50). Example 2 X0.1 5-38 API Instruction code Operand Function 20 D ADD P S , S , D 1 2 Binary addition Device Xn.n Yn.n M S K 16# F KnM KnS D W T C V Z S 1 S 2 D Pulse instruction 16-bit instruction (7 steps ) 32-bit instruction (9 steps) .0 ADD D0 D10 D20 .1 DADD D30 D40 D50