Mitsubishi Electric MELSEC FX Series Structured Programming Manual page 139

Hide thumbs Also See for MELSEC FX Series:
Table of Contents

Advertisement

FXCPU Structured Programming Manual
(Application Functions)
Cautions
1) When handling 32-bit data in structured programs, you cannot specify 16-bit devices directly, different
from simple projects. Use labels when handling 32-bit data.
You can specify 32-bit counters directly, however, because they are 32-bit devices.
Use global labels when specifying labels.
2) Even if underflow or overflow occurs in the operation result, it is not regarded as an operation error.
"TRUE" is output from ENO.
However, note that the obtained operation result is not accurate in this case.
Either of the flags shown in the table below turns ON or OFF in accordance with the operation result.
Device
M8020
M8021
M8022
Zero flag
-2 , -1 , 0 ,
Borrow flag
Zero flag
-2 , -1 , 0 ,
Borrow flag
Program example
In this program, addition is performed using double word [signed] data stored in devices specified in
, and the operation result is output to a device specified in
s2
[Structured ladder]
g_bool1
g_dint1
g_dint2
[ST]
g_bool3:=ADD_E(g_bool1,g_dint1,g_dint2,g_dint3);
Name
ON : When the operation result is "0"
Zero
OFF: When the operation result is any other than "0"
ON : When the operation result is less than "-32,768" (16-bit operation) or less than "-
2,147,483,648" (32-bit operation)
Borrow
OFF: When the operation result is "-32,768" (16-bit operation) or more or "-2,147,483,648" (32-
bit operation) or more
ON : When the operation result exceeds "32,767" (16-bit operation) or "2,147,483,647" (32-bit
operation)
Carry
OFF: When the operation result is "32,767" (16-bit operation) or less or "2,147,483,647" (32-bit
operation) or less
-32,768
The most
significant bit
of data is "1".
-2,147,483,648
ADD_E
g_bool3
EN
ENO
_IN
g_dint3
_IN
Description
Zero flag
-1 , 0 , 1
The most
significant bit
of data is "0".
-1 , 0 , 1
2,147,483,647 ,
Zero flag
.
d
5.3 Standard Arithmetic Functions
Zero flag
32,767 ,
0 , 1 , 2
Carry flag
Zero flag
0 , 1 , 2
Carry flag
s1
137
1
2
3
4
5
6
and
A

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Fx-kp-ok-e09r927

Table of Contents