Chapter 6 Applied Instructions 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. 6-99 API Instruction code Operand Function 0216 SCAL P S , S , S , D 1 2 3 Scale value operation Device X Y M S T C HC D L SM SR E PR K 16# “$” DF S 1 S 2 S 3 D Pulse instruction 16-bit instruction (9 steps) 32-bit instruction AH500 AH500 -