Mitsubishi Electric MELSEC iQ-R Series Programming Manual page 180

Motion module instructions, standard functions/ function blocks
Hide thumbs Also See for MELSEC iQ-R Series:
Table of Contents

Advertisement

• If an underflow or overflow occurs in the operation result, the output from (d) will be as follows.
Data type
INT
DINT
WORD
DWORD
REAL
LREAL
■Operation result
The operation processing is performed. The operation result is output from (d).
Operation error
• When (s1) to (s28) are of REAL data type
Error code
Description
3402H
The value input to (s1) to (s28) is -0, a subnormal number, NaN (not a number), or ±∞.
The value output from (d) is -0, a subnormal number, NaN (not a number), or ±∞.
3403H
The data output from (d) exceeds the following range. (An overflow has occurred.)
|(d)|<2
• When (s1) to (s28) are of LREAL data type
Error code
Description
3402H
The value input to (s1) to (s28) is -0, a subnormal number, NaN (not a number), or ±∞.
The value output from (d) is -0, a subnormal number, NaN (not a number), or ±∞.
3403H
The data output from (d) exceeds the following range. (An overflow has occurred.)
|(d)|<2
14 ARITHMETIC OPERATION FUNCTIONS
178
14.1 Addition
Description
Even if an underflow or overflow occurs, no operation error is issued.
[Example 1]
32767+2=-32767
(7FFFH)+(0002H)=(8001H)
A negative value results because the most significant bit is 1.
[Example 2]
-32767+(-2)=32766
(8000H)+(FFFEH)=(7FFEH)
A positive value results because the most significant bit is 0.
Even if an underflow or overflow occurs, no operation error is issued.
[Example 1]
2147483647+2=-2147483647
(7FFFFFFFH)+(00000002H)=(80000001H)
A negative value results because the most significant bit is 1.
[Example 2]
-2147483648+(-2)=2147483646
(80000000H)+(FFFEH)=(7FFFFFFEH)
A positive value results because the most significant bit is 0.
Even if an overflow occurs, no operation error is issued.
[Example]
65535 + 1 = 0
(FFFFH) + (0001H) = (0000H)
Even if an overflow occurs, no operation error is issued.
[Example]
4294967295 + 1 = 0
(FFFFFFFFH) + (00000001H) = (00000000H)
An operation error occurs and an undefined value is output.
128
1024

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents