DVP-ES2/SX2/SS2/SA2/SX2/SE Operation Manual – Programming
3-458
D
0
S=500
1
= 30
= 500
Source value
Destination value
Program Example 2:
1. Assume source value S
1
= 500, max. source value D0 = 3000, min. source value D1 = 200,
max. destination value D2 = 30, and min. destination value D3 = 500. When X0 = ON, SCLP
instruction executes and the result of proportional calculation will be stored in D10.
2. Equation: D10 = [(500 – 200) × (30 – 500)] ÷(3000 – 200) + 500 = 449.64. Rounding off the
result into an integer, D10 = 450.
X0
SCLP
K500
D0
D10
X0
MOV
MOV
MOV
MOV
K3000
K200
K30
K500
D0
D1
D2
D3
S
1=
500
D
0
= 30
= 500
Destination value
Source value