Mitsubishi Electric MELSEC iQ-R Series Reference page 33

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

Advertisement

Item
Description
Functional description
(1) As i_bEN (execution command) turns on, this FB calculates the absolute values.
■Example 1
When the FB is executed for the input array data in word [signed], the output result is as follows.
■Example 2
When the FB is executed for the input array data in double word [signed], the output result is as follows.
(2) The target input array data for operation is read from the file register (ZR), starting from the address specified by
(3) The operation results are stored in the file register (ZR) for the number of points specified by i_udSize (number of data
(4) Set the following so that the input array data areas and the output array data areas are not overlapped.
(5) When the input array data is -32768 and Word is specified as the data type, the output result is -32768. When the input
(6) Specify Word [signed], Double Word [signed], or Single-precision real number as the data type of input array data and
(7) Specify the number of data points for an array where the absolute values are calculated in i_udSize (number of data
(8) It takes multiple scans until the absolute value calculations are completed. When the input array data before the
(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
(10)If a value out of the range is set in i_uDataType (data type selection), o_bErr (error completion) turns on and the
(11)When a single-precision real number is set in i_uDataType (data type selection) and the value stored in the file register
(12)If i_bEN (execution command) is turned off before o_bOK (normal completion) or o_bErr (error completion) turns on,
FB compilation method
Subroutine type
FB operation
Pulse execution type (multiple scan execution type)
ZR0
Stored value
0
Output result
ZR10000
Stored value
0
ZR0
Stored value
0
Output result
ZR10000
Stored value
0
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).
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 33 List of error codes)
array data is -2147483648 and Double Word is specified as the data type, the output result is -2147483648.
output array data in i_uDataType (data type selection).
points). When 1: Double Word [signed] or 2: Single-precision real number 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.
operation is changed during the operation processing, the operation processing is executed with the changed data. The
number of points with the operation completed is output to o_udOutAryNum (number of output data points). When the
absolute value calculations are completed, o_bOK (normal completion) turns on.
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 33 List of error codes)
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 33 List of error codes)
(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 33 List of error codes)
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 33 List of error codes)
The operation results of the absolute value calculations that have been completed before i_bEN (execution command)
is turned off remain stored in the file register (ZR).
ZR1
ZR997
-1
-32766
ZR10001
ZR10997
1
32766
ZR2
ZR1994
-1
-2147483646
ZR10002
ZR11994
1
2147483646
ZR998
ZR999
32767
-32768
ZR10998
ZR10999
32767
-32768
ZR1996
ZR1998
2147483647
-2147483648
ZR11996
ZR11998
2147483647
-2147483648
2 DETAILS OF THE FB LIBRARY
2.5 M+ArrayHandling_Abs_R
2
31

Advertisement

Table of Contents
loading

Table of Contents