6 BASIC INSTRUCTIONS
6.2 Arithmetic Operation Instructions
211
6
Incrementing 16-bit binary data
INC(P)(_U)
These instructions add +1 to the device (16-bit binary data) specified by (d).
■Descriptions, ranges, and data types
■Applicable devices
• These instructions add +1 to the device (16-bit binary data) specified by (d).
• If INC(P) instruction is executed when contents of device specified by (d) is 32767, -32768 is stored in the device specified
by (d). (If signed is specified)
• If INC(P)_U instruction is executed when contents of device specified by (d) is 65535, 0 is stored in the device specified by
(d). (If unsigned is specified)
• Flags (zero, carry and borrow) are not activated at this time.
Note that data is incremented in every operation cycle in a continuous operation type (INC) instruction.
There is no operation error.
Ladder diagram Structured text
ENO:=INC(EN,d);
ENO:=INCP(EN,d);
ENO:=INC_U(EN,d);
ENO:=INCP_U(EN,d);
Operand Description Range Data type Data type (label)
(d) INC(P) Device to be incremented by +1 -32768 to +32767 16-bit signed binary ANY16_S
INC(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)
5678 (BIN) 5679 (BIN)
+1
b15 b0
···
b15 b0
···