Delta Electronics — 5.6 Application Instructions

5 Categories and Use of Basic Application Instructions 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. Destination value = 500 D = 30 S 1= 500 Source value 0 Program Example 3: 1. Assume the source value S 1 , D100 = F500, max. source value D0 = F3000, min. source value D2 = F200, max. destination value D4 = F500, and min.

destination value D6 = F30. When X0 = ON, M1162 is set up to adopt floating point operation. DSCLP instruction executes and the result of proportional calculation will be stored in D10. 2. Equation: D10 = [(F500 – F200) Ч (F500 – F30)] ч (F3000 – F200) + F30 = F80.35. Round off the result into an integer, D10 = F80. DVP-PM Operation Instruction 5-138 X0 MOV K3000 D0 MOV K200 D1 MOV K30 D2 MOV K500 D3 X0 SCLP K500 D0 D10 LP K500 D0 D10 V K3000 D0 V K200 D1 V K30 D2 V K500 D3