Mitsubishi Electric R16MTCPU Programming Manual page 165

Hide thumbs Also See for R16MTCPU:
Table of Contents

Advertisement

Program example
■Program which sets 4 points of scaling conversion data to D3000 to D3009 and substitutes the
output value, which is positively converted based on the input value "7500", to D3106
16-bit scaling
[F10]
//Scaling conversion data set
D3000=K4
//Number of point=4
D3001=K0
//Unusable area
//Set the point 0 to 3
D3002=K0
//Point 0
D3003=K1000
//(X0, Y0)=(0, 1000)
D3004=K2000
//Point 1
D3005=K3000
//(X1, Y1)=(2000, 3000)
D3006=K4000
//Point 2
D3007=K6000
//(X2, Y2)=(4000, 6000)
D3008=K10000
//Point 3
D3009=K7000
//(X3, Y3)=(10000, 7000)
[G10]
X0
//Standby until X0 turns ON
[F20]
//Positive conversion execution (Output value is
stored in D3106)
SCL K0,K7500,D3000,D3106
END
Y
8000
6583.333...
Point 2
4000
Point 1
Point 0
0
5000
The output value is calculated from the setting value
of Point 2 and 3 since the input value "7500" is
Point 3
between point 2 and 3.
Output value = 6000 +
D3106
X
10000
7500
7000 - 6000
×
(7500 - 4000)
10000 - 4000
= 6583.333...
A fractional portion is rounded down.
K6583
4 OPERATION CONTROL PROGRAMS
4
163
4.8 Data Control

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

R64mtcpuMelsec iq-r seriesR32mtcpu

Table of Contents