Chapter 5 Applied Instructions Suppose the value in S 1 is 500, the maximum source value in D0 is 3,000, the minimum source value in D1 is 200, the maximum destination value in D2 is 30, and the minimum destination value in D3 is 500. When X0.0 is ON, the instruction SCLP is executed, and a scale is stored in D10. Eequation: D10=[(500–200)Ч(30–500)]ч(3,000–200)+500=449.64 Example 2 449.64 is rounded to the nearest integer, and becomes 450. 450 is stored in D10.
Destination value Minimum destination value=500 D Maximum destination value=30 S 1= 500 0 Source value Maximum source value=3000 Minimum source value=200 Suppose S 1 is D100, the value in D100 is F500, the maximum source value in D0 is F3000, the minimum source value in D2 is F200, the maximum destination value in D4 is F500, and the minimum destination value in D6 is F30. When X0.0 is ON, M1162 is set to ON, the instruction DSCLP is executed, and a scale is stored in D10. Equation: D10=[(F500–F200)Ч(F500–F30)]ч(F3000–F200)+F30=F80.35 F80.35 is rounded to the nearest integer, and becomes F80. F80 is stored in D10.
X0.0 SET M1162 DMOVR DMOVR DMOVR DMOVR DMOVR X0.0 DSCLP 5-121 X0.0 MOV K3000 D0 MOV K200 D1 MOV K30 D2 MOV K500 D3 X0.0 SCLP K500 D0 D10 SCLP K500 D0 D10 MOV K3000 D0 MOV K200 D1 MOV K30 D2 MOV K500 D3 F500 D100 F3000 D0 F200 D2 F500 D4 F30 D6 D100 D0 D10