3. Instruction Set

Program Example 1:

1.Assume S1 = 500, S2 = 168 and S3 = -4. When X0 = ON, SCAL instruction executes and the result of proportional calculation will be stored in D0.

2.Equation: D0 = (500 × 168 ) ÷ 1000 + (-4) = 80

X0

SCAL K500 K168 K-4

D0

Destination value

 

D

Slope=168

Offset=-4

 

 

 

 

 

Source value

0

1 = 500

 

 

 

 

 

Program Example 2:

1.Assume S1 = 500, S2 = -168 and S3 = 534. When X0 = ON, SCAL instruction executes and the result of proportional calculation will be stored in D10..

2.Equation: D10 = (500 × -168 ) ÷ 1000+ 534 = 450

X10

SCAL K500 K-168 K534 D10

Destination value

 

D

Slope = -168

 

 

Offset = 534

 

 

 

 

 

Source value

 

 

 

0

S1 = 500

 

 

 

 

Points to note:

1.This instruction is applicable for known slope and offset. If slope and offset are unknown, please use SCLP instruction for the calculation.

2.S2 has to be within the range -32,768 ~ 32,767. If S2 exceeds the applicable range, use SCLP instruction instead.

3.When adopting the slope equation, the max source value must be larger than min source value, but the max destination value does not need to be larger than min destination value.

4.If D > 32,767, D will be set as 32,767. If D < -32,768, D will be set as -32,768.

3 - 4 5 5

Page 571
Image 571
Delta DVP-ES2/EX2/SS2/SA2/SX2/SE manual Scal K500 K-168 K534 D10