
212
6 BASIC INSTRUCTIONS
6.2 Arithmetic Operation Instructions
Decrementing 16-bit binary data
DEC(P)(_U)
These instructions subtract 1 from the device (16-bit binary data) specified by (d).
Setting data
■
Descriptions, ranges, and data types
■
Applicable devices
Processing details
• These instructions decrement device (16-bit binary data) specified by (d) by 1.
• If DEC(P) instruction is executed when contents of device specified by (d) is -32768, 32767 is stored in the device specified
by (d). (If signed is specified)
• If DEC(P)_U instruction is executed when contents of device specified by (d) is 0, 65535 is stored in the device specified by
(d). (If unsigned is specified)
• Flags (zero, carry and borrow) are not activated at this time.
Precautions
Note that data is decremented in every operation cycle in a continuous operation type (DEC) instruction.
Operation error
There is no operation error.
Ladder diagram
Structured text
ENO:=DEC(EN,d);
ENO:=DECP(EN,d);
ENO:=DEC_U(EN,d);
ENO:=DECP_U(EN,d);
Operand
Description
Range
Data type
Data type (label)
(d)
DEC(P)
Device to be decremented by -1
-32768 to +32767
16-bit signed binary
ANY16_S
DEC(P)_U
0 to 65535
16-bit unsigned binary
ANY16_U
Operand
Bit
Word
Double word
Indirect
specification
Constant
Others
X, Y, M, L,
SM, F, B, SB
U
\G
T, ST,
C, LC
T, ST, C, D,
W, SD, SW, R
U
\G
Z
LC
LZ
K, H
E
$
(d)
(d)
(d)
(d)
5678 (BIN)
5677 (BIN)
-1
b15
b0
···
b15
b0
···
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: ......