Mitsubishi Electric MELSEC iQ-R Series Reference page 37

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

Advertisement

FB details
Item
Relevant devices
Language to use
Number of steps
FB dependence
Functional description
FB compilation method
FB operation
Description
CPU module
Engineering tool
 (The internal program of this FB is not open to the public.)
3572 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.
No dependence
(1) As i_bEN (execution command) turns on, this FB performs the sort (ascending order).
■Example
When the FB is executed for the input array data in word [signed] (number of data points: 1000), the output result is as
follows.
ZR0
Stored value
0
Output result
ZR10000
Stored value
0
(2) The target input array data for operation is read from the file register (ZR), starting from the address specified by
i_udInAryAddr (input array data start address). This FB reads input array data for the number of points specified by
i_udSize (number of data points).
(3) At the start of sorting, the target input array data for processing is stored in the file register (ZR) for the number of points
specified by i_udSize (number of data points), starting from the address specified by i_udOutAryAddr (output array data
start address). The data stored in the output areas at the start of sorting is used for the sort processing.
(4) Set the following so that the input array data areas and the output array data areas are not overlapped.
 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 38 List of error codes)
(5) Specify Word [signed], Double Word [signed], Single-precision real number, Word [unsigned], or Double Word
[unsigned] as the data type of input array data and output array data in i_uDataType (data type selection).
(6) The sort results are determined in order from the maximum value. Thus, the data is stored in order from the end of the
output array data areas.
(7) Specify the number of data points for an array where the sort is performed in i_udSize (number of data points). When 1:
Double Word [signed], 2: Single-precision real number, or 4: Double Word [unsigned] is specified by i_uDataType (data
type selection), file register (ZR) areas twice as many as the setting value of i_udSize (number of data points) are
required.
(8) It takes multiple scans until the sort processing is completed. Thus, do not change the target input array data until the
processing is completed. The number of points with the sort completed is output to o_udOutAryNum (number of output
data points). When the sort processing is completed, o_bOK (normal completion) turns on.
(9) If a value out of the range is set in i_udSize (number of data points), o_bErr (error completion) turns on and the
processing of the FB is interrupted. In addition, 105H is stored in o_uErrId (error code). For the error code, refer to the
list of error codes. ( Page 38 List of error codes)
(10)If a value out of the range is set in i_uDataType (data type selection), o_bErr (error completion) turns on and the
processing of the FB is interrupted. In addition, 103H is stored in o_uErrId (error code). For the error code, refer to the
list of error codes. ( Page 38 List of error codes)
(11)When a single-precision real number is set in i_uDataType (data type selection) and the value stored in the file register
(ZR) is not a single-precision real number, o_bErr (error completion) turns on and the processing of the FB is
interrupted. In addition, 200H is stored in o_uErrId (error code). For the error code, refer to the list of error codes. (
Page 38 List of error codes)
The address of the file register (ZR) in which the value other than the single-precision real number is stored can be
checked with the stored value in o_udOutAryNum (number of output data points).
(12)If i_bEN (execution command) is turned off before o_bOK (normal completion) or o_bErr (error completion) turns on,
o_bErr (error completion) turns on in one scan. In addition, 205H is stored in o_uErrId (error code) in one scan. For the
error code, refer to the list of error codes. ( Page 38 List of error codes)
If i_bEN (execution command) is turned off during the sort processing, unsorted data and sorted data are mixed in the
file register (ZR). The number of data points with the sort completed is output to o_udOutAryNum (number of output
data points) during the sort processing.
Subroutine type
Pulse execution type (multiple scan execution type)
MELSEC iQ-R series
GX Works3 of version 1.015R or later
ZR1
999
ZR10001
1
2 DETAILS OF THE FB LIBRARY
ZR998
ZR999
998
1
ZR10998
ZR10999
998
999
2.6 M+ArrayHandling_Sort_R
2
35

Advertisement

Table of Contents
loading

Table of Contents