EasyManua.ls Logo

Mitsubishi Electric MELSEC FX Series - Page 207

Mitsubishi Electric MELSEC FX Series
838 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
7 Applied Instructions
7.3 Arithmetic and Logical Operation
205
FXCPU Structured Programming Manual
(Basic & Applied Instruction)
1
Outline
2
Instruction List
3
Configuration of
Instruction
4
How to Read
Explanation of
Instructions
5
Basic Instruction
6
Step Ladder
Instructions
7
Applied
Instructions
8
Interrupt Function
and Pulse Catch
Function
A
Relationships
between devices
and addresses
Program examples
The program examples below are provided to obtain the absolute value of a negative binary value.
1. Obtaining the absolute value of a negative value using NEG instruction
2. Obtaining the absolute value by SUB (subtraction) instruction
Even if NEG instruction (complement operation) is not used, D30 always stores the absolute value of the
difference.
In BON (ON bit check) instruction, M0
turns ON when the bit 15 (b15 among
b0 to b15) of D10 is "1".
NEGP instruction is executed for D10
only when M0 turns ON.
M0
D10
BON
EN
s
n
ENO
d
M8000
D10
K15
M0
RUN
monitor
D10 D10
[Structured ladder]
[ ST ]
BON(M8000, D0, K15, M0);
NEGP(M0, D10);
NEGP
EN ENO
d
X000
CMP
EN
s1
s2
ENO
d
D10
D20
M10
M10
M11
M12
SUB
EN
s1
s2
ENO
d
D10
D20
D30
SUB
EN
s1
s2
ENO
d
D20
D10
D30
[Structured ladder]
[ ST ]
CMP(D10, D20, M10);
SUB(X000 AND (M10 OR M11), D10, D20, D30);
SUB(X000 AND M12, D20, D10, D30);
(D 10) > (D 20) (D10) = (D 20) (D 10) < (D 20)
M 10=ON M 11=ON M 12=ON
In the case of "D10 D20",
D10 - D20 D30
In the case of "D10 < D20",
D20 - D10 D30

Table of Contents

Other manuals for Mitsubishi Electric MELSEC FX Series

Related product manuals