
176
6 BASIC INSTRUCTIONS
6.2 Arithmetic Operation Instructions
Precautions
■
When the DSUB instruction is used
When specifying word devices, a device is specified for the lower-order 16-bits first, and then a word device with the next
device number is set for the higher-order 16 bits. To prevent number overlap, it is recommended to always specify an even
number.
■
When specifying the same device in the source and destination
The same device number can be specified for both the source and the destination. In this case, note that the subtraction result
changes in every operation cycle if a continuous operation type SUB instruction is used.
■
Difference between DSUB(P) instruction, D-(P) instruction, and DDEC(P) instruction in a
program for subtracting "-1"
When DSUB(P) instruction is used to subtract 1 from the contents of D0 every time X1 turns from OFF to ON, SUB(P)
instruction is similar to D-(P) instruction and DDEC(P) instruction described later except for the contents shown in the table
below:
Operation error
There is no operation error.
DSUB(P) instruction
D-(P) instruction, DDEC(P) instruction
Flag (zero, borrow or carry)
Operates
Does not operate
Operation
result
(s)-1=(d)
-2147483648
0
-1
-2
…
-2147483648
+2147483647
+2147483646
…
DSUB
D0
K25
D0
X1
(D0)-25
→
(D0)
Summary of Contents for MELSEC iQ-F FX5 series
Page 1: ...MELSEC iQ F FX5 Series Programming Manual Instructions Standard Functions Function Blocks ...
Page 2: ......
Page 21: ...19 PART 1 PART 1 OVERVIEW Part 1 consists of the following chapter 1 OVERVIEW ...
Page 98: ...96 4 STANDARD FUNCTIONS FUNCTION BLOCKS 4 2 Standard Function Blocks MEMO ...
Page 840: ...838 23 TIME DATA FUNCTIONS 23 4 Division MEMO ...
Page 887: ......