Download Print this page

Decrementing 16-Bit Binary Data - Mitsubishi Electric MELSEC iQ-F FX5 Programming Manual

Instructions, standard functions/function blocks
Hide thumbs Also See for MELSEC iQ-F FX5:

Advertisement

Decrementing 16-bit binary data

DEC(P)(_U)
These instructions subtract 1 from the device (16-bit binary data) specified by (d).
Ladder diagram
(d)
FBD/LD
EN
ENO
d
Setting data
■Descriptions, ranges, and data types
Operand
(d)
DEC(P)
DEC(P)_U
EN
ENO
■Applicable devices
Operand
Bit
X, Y, M, L, SM,
F, B, SB, S
(d)
Processing details
• These instructions decrement device (16-bit binary data) specified by (d) by 1.
(d)
b15
b0
···
5678 (BIN)
-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.
7 BASIC INSTRUCTIONS
246
7.2 Arithmetic Operation Instructions
Description
Device to be decremented by -1
Execution condition
Execution result
Word
T, ST, C, D, W,
U\G
SD, SW, R
(d)
b15
b0
···
5677 (BIN)
Structured text
ENO:=DEC(EN,d);
ENO:=DECP(EN,d);
Range
-32768 to +32767
0 to 65535
Double word Indirect
specification
Z
LC
LZ
ENO:=DEC_U(EN,d);
ENO:=DECP_U(EN,d);
Data type
Data type (label)
16-bit signed binary
ANY16_S
16-bit unsigned binary
ANY16_U
Bit
BOOL
Bit
BOOL
Constant
K, H
E
$
Others

Hide quick links:

Advertisement

loading