Mitsubishi Electric R16MTCPU Programming Manual page 164

Hide thumbs Also See for R16MTCPU:
Table of Contents

Advertisement

• Conversion of the input value specified with (S2) is executed according to the search/conversion method specified with
(S1), using the scaling conversion data of device (S3) or later. The conversion result is stored in the device specified with
(D).
• In the scaling, point data used for output value calculation must be searched from the input value, and the search method is
specified with (S1). The search method is either sequential search or binary search, and the features are shown below.
Specify the search method according to the intended use.
Search
Search times
method
when the
number of
points is 4000
Sequential
1 to 4000 times
search
Binary
12 times
search
• The device No. specified with (S3) should be an even number. Set the point data in the specified device as follows.
Offset
Name
+0
The number of points (N)
+1
Unusable
+2
Point 0
+3
+4
Point 1
+5
+6
Point 2
+7
+(2N)
Point (N-1)
+(2N+1)
Set the point data corresponding to the input value in ascending order. (Positive conversion: X
X
, Inverse conversion: Y
N-1
• When the conversion result to be stored in the device specified with (D) is not an integer value, its fractional portion is
rounded down.
Operation error
An operation error will occur, and the conversion of input value will not be executed if:
• (S1) is set to other than 0 to 3.
• (S3) is not an even-numbered device.
• The number of points at the point table specified with (S3) is outside the range of 2 to 4000.
• Point table specified with (S3) is outside the device range.
• In sequential search ((S1) is 0 or 1.), the point corresponding to the input value (Positive conversion: X
conversion: Y
to Y
0
• The conversion result is outside the range of -32768 to 32767.
4 OPERATION CONTROL PROGRAMS
162
4.8 Data Control
Processing time
0.003 to 0.809 [ms]
Since the data is searched in order from the head in
sequential search, the maximum processing time increases
in proportion to the number of points.
0.006 [ms]
Binary search requires relatively short search time since
the processing time does not increase in proportion to the
number of points.
Description
Set the number of points for the scaling conversion data.
Set 0.
X
Set the point data of (X
0
Y
0
X
1
Y
1
X
2
Y
2
X
N-1
Y
N-1
< Y
0
) is not in ascending order.
N-1
, Y
) to (X
, Y
) so that the device No. is in consecutive order.
0
0
N-1
N-1
<.....< Y
)
1
N-1
Precaution
During search processing, whether the point data
corresponding to the input value is in ascending order can
be checked. If the input value is not in ascending order, an
operation error will occur.
During search processing, point data required for the binary
search are only referred to. If the data is not in ascending
order, the calculation result of output value could be
unexpected one since all of the point data corresponding to
the input value cannot be confirmed.
Range
2 to 4000
0
-32768 to 32767
< X
<.....<
0
1
to X
, Inverse
0
N-1

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

R64mtcpuMelsec iq-r seriesR32mtcpu

Table of Contents