6 remainder (mod) – Yaskawa MP900 Series Motion Programming Manual User Manual
Page 143

Sequence Commands
4.2.6 REMAINDER (MOD)
4 -10
4.2.6 REMAINDER (MOD)
J
Overview
When specified in the next block after DIVIDE, MOD stores the remainder of the division in
the specified variable. The remainder is stored as the data type on the left side, even when there
are mixed integers and real numbers in the DIVIDE command block.
J
Description
Designation Method
MW00001=1000 / 999;
MW00002=MOD;
→
MW0002 = 1
Data Types
Bit (B)
Integer (W)
Double Integer (L)
Real Number (F)
No
Yes
Yes
No
J
Programming Examples
Type
Motion Program
Ladder Logic Program
B
−
−
W
MW00101 = MW00100 / 3;
MW00102 = MOD;
MW00100
/ 3
⇒ MW00101
MOD
⇒ MW00102
L
ML00106 = ML00102 / ML00104;
ML00108 = MOD;
MW00102 / ML00104 ⇒ MW00106
MOD
⇒ MW00108
F
−
−
Example: Double Integers
ML00106=ML00100 ∗ ML00102 / ML00104;
(173575) (100000)
(60000)
(34567)
ML00108 = MOD;
(32975)
The MOD command must be specified in the next block after DIVIDE . If it is not executed in the next block
after DIVIDE, the operation result cannot be guaranteed.
4
A
EXAMPLE
"
IMPORTANT