User guide
Page 147
Chapter 4. Programming
DIV (Division)
MOD (Remainder)
Expansion
condition
(AND · OR)
Input
condition
(I/O · Flag)
Command
Post
(Output port · Flag)
Command Operand 1 Operand 2
Optional Optional MOD Variable no. Data·Variable no. Optional
[Function] Divides the content of the variable in Operand 1 by the data in Operand 2, and stores the remainder in the
variable in Operand 1. Divides the contents of the variable in Operand 1 by the contents of the variable in
Operand 2 and stores the remainder in the variable in Operand 1. If there is a post instruction (flag, output port),
it turns ON when the computation result (remainder) is zero.
* This command is executed with respect to integers.
[Example] MOD 1 3
If the content of variable 1 in Operand 1 is 10, then 10 (content of variable 1 in Operand 1) ÷ 3 (data in
Operand 2) = 3 with a remainder of 1, and after the command is executed, the content of variable 1
becomes 1.
MOD 1 *2
If the content of variable 1 in Operand 1 is 10 and the content of variable *2 in Operand 2 is 3, then 10
(content of variable 1 in Operand 1) ÷ 3 (contents of variable *2 in Operand 2) = 3 with a remainder of
1, and after the command is executed, the content of variable 1 becomes 1.
Expansion
condition
(AND · OR)
Input
condition
(I/O · Flag)
Command
Post
(Output port · Flag)
Command Operand 1 Operand 2
Optional Optional DIV Variable no. Data·Variable no. Optional
[Function] Divides the content of the variable in Operand 1 by the data in Operand 2, then stores this in the variable in
Operand 1. Divides the content of the variable in Operand 1 by the contents of the variable in Operand 2 and
stores this in the variable in Operand 1. If there is a post instruction (flag, output port), it turns ON when the
computation result is zero.
[Example] DIV 1 5
If the content of variable 1 in Operand 1 is 10, then 10 (content of variable 1 in Operand 1) ÷ 5 (data in
Operand 2) = 2, and after the command is executed, the content of variable 1 becomes 2.
DIV 1 *2
If the content of variable 1 in Operand 1 is 10 and the content of variable *2 in Operand 2 is 5, then 10
(content of variable 1 in Operand 1) ÷ 5 (contents of variable *2 in Operand 2) = 2, and after the
command is executed, the content of variable 1 becomes 2.