Yaskawa MP900 Series Ladder Programming Manual User Manual

Page 96

Advertising
background image

5.3 Numeric Operation Instructions

5.3.3 Extended Add (ADDX (++))

5-27

Instructions

5

( 3 ) Programming Examples

In the following programming examples, input data A and input data B are extended-added and the result is stored in
the output data.

• Storing the Output Data in MW00000 When Input Data A Is 32,760 and Input Data B Is 10

32,760 ++ 10

→ MW00000 = -32,766

• Storing the Output Data in ML00000 When Input Data A in MW00002 Is 20,000 and Input Data B in MW00003

is 30,000
20,000 ++ 30,000

→ ML00000 = -15,536*

∗ In the example given above, ML00000 does not equal 50,000 because both input data A and B are integers,

which limits the result to a number within the range for integers.

• Storing the Output Data in ML00000 When Input Data A Is 2,147,483,647 and Input Data B Is 2

2,147,483,647 ++ 2

→ ML00000 = -241,783,647

• Storing the Output Data in MW00000 When Input Data A Is -32,768 and Input Data B Is -1

-32,768 ++ -1

→ MW00000 = 32,767

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: