Mitsubishi Electric MELSEC FX3U Programming Manual page 290

Melsec fx series programmable logic controllers
Table of Contents

Advertisement

FX
/FX
/FX
Series Programmable Controllers
3G
3U
3UC
Programming Manual - Basic & Applied Instruction Edition
Program example
1. Difference between SUB instruction and DEC instruction caused by a program for
subtracting "1"
"1" is subtracted from the contents of D0 every time X001 turns ON from OFF.
SUB[P] instruction is similar to DECP instruction described later except the contents shown in the table
below:
Flag (zero, borrow or carry)
16-bit
operation
32-bit
operation
X001
FNC 21
SUBP
X001
FNC 25
DECP
288
[D] SUB [P] instruction
←−2←−1←0←−32768
−(+1)=
S
D
+32767→0→+1→+2→
−(−1)=
S
D
←−2←−1←0←−2,147,483,648
−(+1)=
S
D
+2,147,483,647→0→+1→+2→
−(−1)=
S
D
S
S
D
1
2
D 0
K 1
D 0
D 0
10 Arithmetic and Logical Operation (+, −, ×, ÷) – FNC 20 to FNC 29
Operates
−2,147,483,648→+2,147,483,647→+2,147,483,646
(D 0) − 1→(D 0)
(D 0) − 1→(D 0)
10.2 FNC 21 – SUB / Subtraction
[D] DEC [P] instruction
Does not operate
−32,768→+32,767→+32,766

Advertisement

Table of Contents
loading

This manual is also suitable for:

Melsec fx3ucMelsec fx3g

Table of Contents