AH500 Programming Manual 
6-98 
API 
Instruction code
Operand  Function 
0216    SCAL  P 
S
1
, S
2
, S
3
, D 
Scale value operation 
Device
X  Y  M  S  T  C  HC  D  L  SM  SR  E  PR  K  16#  “$”  DF 
16-bit instruction (9 steps) 
  AH500  AH500 
Symbol: 
S
1
 
:
Data source  Word 
S
2
 
:
Slope  Word 
S
3
 
:
Offset  Word 
D 
:
Destination device  Word 
Explanation: 
1.  The operation equation in the instruction: D=(S
1
×S
2
)÷1,000+S
3
 
2.  To obtain the values in S
2
 and S
3
, users have to use the slope equation and the offset equation 
below first, and then round off the results to the nearest whole digit. The final 16-bit values are 
entered into S
2
 and S
3
. 
The slope equation: S
2
=[(Maximum destination value–Minimum destination value)÷(Maximum 
source value–Minimum source value)]×1,000 
The offset equation: S
3
=Minimum destination value–Minimum source value×S
2
÷1,000 
The output curve is as shown below: 
 
Example 1: 
1.  Suppose the values in S
1
, S
2
, and S
3
 are 500, 168, and -4 respectively. When X0.0 is ON, the 
instruction SCAL is executed, and the scale value is stored in D0.