DVP-ES3 Series Programming Manual Symbol S 1 : Data source S 2 : Slope S 3 : Offset _6 D : Destination device Explanation 1. This instruction finds a scaled linear value for the number in S1 using the slope of the line in S 2 and the offset in S 3 to define the scaling factor, and stores the result in D . 2. The operation equation in the instruction is D =( S 1 Ч S 2 )ч1,000+ S 3 3. To get the values in S 2 and S 3 , use the slope equation and the offset equation below first, and then round off the results to the nearest whole digit. Enter the final 16-bit values 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 6-108 API Instruction code Operand Function 0216 SCAL P S1, S2, S3, D Finding a scaled value (point-slope) Device X Y M S T C HC D FR SM SR E K 16# “$” F S1 S2 S3 D BOOL WORD DWORD LWORD UINT INT DINT LINT REAL LREAL TMR CNT STRING Data type S1 S2 S3 D Pulse instruction 16-bit instruction 32-bit instruction ES3 ES3 ES3