Subtraction - Mitsubishi Electric MELSEC-Q/L Programming Manual

Hide thumbs Also See for MELSEC-Q/L:
Table of Contents

Advertisement

Subtraction

SUB_E
High
Basic
Process
performance
Structured ladder/FBD
SUB_E
EN
ENO
s1
s2
The following function(s) can go in the dotted squares.
SUB_E
■Argument
Input/output
argument
Input argument
Output argument
Processing details
■Operation processing
• Performs subtraction ((s1) - (s2)) on word (signed), double word (signed), single-precision real or double-precision real type
data input to (s1) and (s2), and outputs the operation result from (d) in the same data type as that of (s1) and (s2).
Ex.
Word (signed) type data
s1
-
12345
Word (signed) type
• The values to be input to (s1) and (s2) are word (signed), double word (signed), single-precision real or double-precision
real type data.
• If an underflow/overflow occurs in the operation result, data is output from (d) as follows.
Word (signed) type data
No operation error occurs even if an underflow/overflow occurs.
In case of SUB_E, TRUE is output from ENO.
32767-
(-2)= -32767
(7FFFH) (FFFEH) (8001H)
-32768 -
2 = 32766
(8000H) (0002H) (7FFEH)
Double word (signed) type data
No operation error occurs even if an underflow/overflow occurs.
In case of SUB_E, TRUE is output from ENO.
2147483647 -
(-2) = -2147483647
(7FFFFFFFH) (FFFEH)
-2147483648 -
2 = 2147483646
(80000000H) (0002H) (7FFFFFFEH)
5 APPLICATION FUNCTIONS
130
5.3 Standard Arithmetic Functions
Redundant Universal
LCPU
ST
ENO:=
SUB_E
d
Name
Description
EN
Executing condition (TRUE: Execution, FALSE:
Stop)
s1(_IN1)
Input
s2(_IN2)
ENO
Execution result (TRUE: Normal, FALSE: Error)
d
Output
s2
6789
Word (signed) type
Since the highest-order bit is 1, the result value is negative.
Since the highest-order bit is 0, the result value is positive.
Since the highest-order bit is 1, the result value is negative.
(80000001H)
Since the highest-order bit is 0, the result value is positive.
(EN, s1, s2, d);
d
5556
Word (signed) type
Data type
Bit
ANY_NUM
Bit
ANY_NUM

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents