20 ARITHMETIC OPERATION FUNCTIONS
20.1 Addition
987
20
20
ARITHMETIC OPERATION FUNCTIONS
20.1
Addition
ADD(_E)
These functions output the sum of input values ((s1) + (s2) + ... + (s28)).
*1 The input variable "s" can be changed in the range of 2 to 28.
Setting data
■
Descriptions, types, and data types
Processing details
■
Operation processing
• These functions add the INT, DINT, or REAL type data ((s1) + (s2) + ... + (s28)) input to (s1) to (s28), and output from (d) in
the same data type as (s).
Ex.
Data type is the INT type
• A value input to (s1) to (s28) is the INT, DINT, or REAL type data value.
• If an underflow and an overflow occur in the operation result, the result will be output as follows from (d).
• When the operation result is 0, the zero flag (SM8020) turns on.
Ladder diagram, FBD/LD
Structured text
[Without EN/ENO]
[With EN/ENO]
[Without EN/ENO]
d:=ADD(s1,s2);
[With EN/ENO]
d:=ADD_E(EN,ENO,s1,s2);
Argument
Description
Type
Data type
EN
Execution condition (TRUE: Execution, FALSE: Stop)
Input variable
BOOL
s1(IN1) to s28(IN28)
Input
Input variable
ANY_NUM
ENO
Output status (TRUE: Normal, FALSE: Abnormal)
Output variable
BOOL
d(ADD(_E))
Output
Output variable
ANY_NUM
Data type is INT
Data type is DINT
Data type is REAL
• Even if underflow or overflow occurs in the
operation result, it is not regarded as an
operation error. "ADD_E" outputs "TRUE" from
ENO.
[Example 1]
32767+2=1
(7FFFH)+(0002H)=0001H
The most significant bit becomes 0, and the carry
flags (SM716 and SM8022) turn on.
[Example 2]
-32768+(-2)=-1
(8000H)+(FFFEH)=(FFFFH)
The most significant bit becomes 1, and the borrow
flag (SM8021) turns on.
• Even if underflow or overflow occurs in the
operation result, it is not regarded as an
operation error. "ADD_E" outputs "TRUE" from
ENO.
[Example 1]
2142=1
(7FF(0002H)=(00000001H)
The most significant bit becomes 1, and the carry
flags (SM716 and SM8022) turn on.
[Example 2]
-214(-2)=-1
(800(FFFEH)=(7FFFFFFFH)
The most significant bit becomes 1, and the borrow
flag (SM8021) turns on.
An operation error occurs and an undefined value
is output.
s1
d
s2
EN
ENO
d
s1
s2
INT
1234
INT
5678
INT
6912
(s1)
(s2)
(d)
Содержание MELSEC iQ-F FX5
Страница 1: ...MELSEC iQ F FX5 Programming Manual Instructions Standard Functions Function Blocks ...
Страница 2: ......
Страница 17: ...15 CONTENTS ...
Страница 24: ...22 MEMO ...
Страница 25: ...23 PART 1 PART 1 OVERVIEW Part 1 consists of the following chapter 1 OVERVIEW 2 PRECAUTIONS ON PROGRAMMING ...
Страница 126: ...124 6 SEQUENCE INSTRUCTIONS 6 3 Output Instructions Operation error There is no operation error ...
Страница 132: ...130 6 SEQUENCE INSTRUCTIONS 6 3 Output Instructions Operation error There is no operation error ...
Страница 140: ...138 6 SEQUENCE INSTRUCTIONS 6 3 Output Instructions Operation error There is no operation error ...
Страница 191: ...7 BASIC INSTRUCTIONS 7 2 Arithmetic Operation Instructions 189 7 Operation error There is no operation error ...
Страница 202: ...200 7 BASIC INSTRUCTIONS 7 2 Arithmetic Operation Instructions Operation error There is no operation error ...
Страница 278: ...276 7 BASIC INSTRUCTIONS 7 4 Bit Processing Instructions Operation error There is no operation error ...
Страница 280: ...278 7 BASIC INSTRUCTIONS 7 4 Bit Processing Instructions Operation error There is no operation error ...
Страница 915: ...18 TYPE CONVERSION FUNCTIONS 18 13 Converting DWORD to WORD 913 18 Operation error There is no operation error ...
Страница 917: ...18 TYPE CONVERSION FUNCTIONS 18 14 Converting DWORD to INT 915 18 Operation error There is no operation error ...
Страница 932: ...930 18 TYPE CONVERSION FUNCTIONS 18 26 Converting DINT to WORD Operation error There is no operation error ...
Страница 1050: ...1048 26 TIME DATA FUNCTIONS 26 4 Division MEMO ...
Страница 1068: ...1066 29 COUNTER FUNCTION BLOCKS 29 4 Counter Function Block Operation error There is no error ...
Страница 1107: ...I 1105 MEMO ...
Страница 1111: ......