Mitsubishi Electric MELSEC iQ-R Series Reference page 13

Array handling function block library reference, programmable controller
Hide thumbs Also See for MELSEC iQ-R Series:
Table of Contents

Advertisement

FB details
Item
Description
Relevant devices
CPU module
Engineering tool
Language to use
 (The internal program of this FB is not open to the public.)
Number of steps
853 steps
The number of steps of the FB embedded in a program depends on the CPU module used, the input/output definitions, and
the options setting of GX Works3. For the options setting of GX Works3, refer to the GX Works3 Operating Manual.
FB dependence
No dependence
Functional description
(1) As i_bEN (execution command) turns on, this FB performs the subtraction between the input array data and the
■Example 1
When 1 is input as the subtraction value and this FB is executed for the input array data in word [signed], the output result is
as follows.
■Example 2
When 1 is input as the subtraction value and this FB is executed for the input array data in double word [signed], the output
result is as follows.
If an underflow or an overflow occurs during operation when word or double word is specified by i_uDataType (data type
selection), the operation result is as follows.
(2) The array data of the subtraction target values are read from the file register (ZR), starting from the address specified by
(3) The subtraction value is read from the file register (ZR) of the address specified by i_udInPointAddr (input value address).
(4) The operation results are stored in the file register (ZR) for the number of points specified by i_udSize (number of data
(5) Set the following so that the input array data areas and the output array data areas are not overlapped.
subtraction value.
ZR0
Stored value
0
Output result
ZR10000
Stored value
-1
ZR0
Stored value
0
Output result
ZR10000
Stored value
-1
Word [signed]
Overflow
Underflow
Double word [signed]
Overflow
Underflow
i_udInAryAddr (input array data start address). This FB reads array data for the number of points specified by i_udSize
(number of data points).
points), starting from the address specified by i_udOutAryAddr (output array data start address).
 i_udInAryAddr (input array data start address)
 i_udOutAryAddr (output array data start address)
 i_udSize (number of data points)
If some areas of input array data and output array data are overlapped, o_bErr (error completion) turns on and the
processing of the FB is interrupted. In addition, 209H is stored in o_uErrId (error code). For the error code, refer to the list
of error codes. ( Page 15 List of error codes)
However, if the same value is set for i_udInAryAddr (input array data start address) and i_udOutAryAddr (output array
data start address), the operation is processed normally. The operation results overwrite data in the file register (ZR),
starting from the area specified by i_udInAryAddr (input array data start address).
MELSEC iQ-R series
GX Works3 of version 1.015R or later
ZR1
1
ZR10001
0
ZR2
1
ZR10002
0
Effective data range: -32768 to 32767
7FFFH(32767) - FFFFH(-1)
= 8000H(-32768)
(Subtract FFFFH from 17FFFH.)
8000H(-32768) - 0001H(1)
= 7FFFH(32767)
Effective data range: -2147483648 to 2147483647
7FFFFFFFH(2147483647) - FFFFFFFFH(-1)
= 80000000H(-2147483648)
(Subtract FFFFFFFFH from 17FFFFFFFH.)
80000000H(-2147483648) - 00000001H(1)
= 7FFFFFFFH(2147483647)
ZR998
ZR999
32767
-32768
ZR10998
ZR10999
32766
32767
ZR1996
ZR1998
2147483647
-2147483648
ZR11996
ZR11998
2147483646
2147483647
2 DETAILS OF THE FB LIBRARY
2.2 M+ArrayHandling_PointSub_R
2
11

Advertisement

Table of Contents
loading

Table of Contents