Delta AS Series Programming Manual page 334

Hide thumbs Also See for AS Series:
Table of Contents

Advertisement

5.
Dividing 32-bit values:
S
+1
S
1
b15.....b0 b15.....b0
The operand D occupies two devices. The quotient is stored in (D+1, D), and the remainder is stored in (D+3,
D+2).
Example
When X0.0 is ON, the instruction divides the dividend in D0 by the divisor in D10, and stores the quotient in D20, and
stores the remainder in D21. Whether the result is a positive value or a negative value depends on the state of the
highest bit.
Additional remarks
1.
If the device exceeds the range, the instruction is not executed, SM0 is ON, and the error code in SR0 is 16#2003.
2.
If the divisor is 0, the instruction is not executed, SM0 is ON, and the error code in SR0 is 16#2012.
3.
If you declare the operand D used during the execution of the 16-bit instruction in ISPSoft, the data type is ARRAY
[2] of WORD/INT.
4.
If you declare the operand D used during the execution of the 32-bit instruction in ISPSoft, the data type is ARRAY
[2] of DWORD/DINT.
S
+1
S
1
2
2
b15.....b0 b15.....b0
/
Ch a pt er 6 A pp l i e d I n s tr uc t io ns
Quotient
D+1
D
b15.....b0 b15.....b0 b15.....b0 b15.....b0
=
Remainder
D+3
D+2
6 - 5 5
6_

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents