Yaskawa MP900 Series Ladder Programming Manual User Manual

Page 104

Advertising
background image

5.3 Numeric Operation Instructions

5.3.7 Divide (DIV (

÷))

5-35

Instructions

5

( 3 ) Programming Examples

In the following programming examples, input data A is divided by input data B and the result is stored in the output
data.

• Storing the Output Data in MW00000 When Input Data A Is 200 and Input Data B Is 100

200

÷ 100 → MW00000 = 2

• Storing the Output Data in ML00000 When Input Data A Is 200 and Input Data B Is 1,000

200

÷ 1,000 → ML00000 = 0

• Storing the Output Data in MF00000 When Input Data A Is 200 and Input Data B Is 1,000

200

÷ 1,000 → MF00000 = 0.2

When performing operations with different data types, the result of the operation will depend on the data type of the output reg-
ister.
Refer to 4.4.2 ( 3 ) Precautions When Using Local Registers within a User Function for details.
Normally, addition and subtraction instructions (+, –, ++, and – –) involving double-length integers are performed as 32-bit
operations.
However, these instructions are performed as 64-bit operations if they are used to correct the remainder produced by an immedi-
ately preceding MUL instruction (

×) and are immediately followed by a DIV instruction (÷).

INFO

Advertising
This manual is related to the following products: