How to use SCALE in PLC
2014.05.16

Q: How to use SCALE in PLC
A: Use command SCL, SCLP, DSCL, DSCLP

SCL  / DSCL           S   D   T   n

SCLP / DSCLP        S   D   T   n

S : Data value that you want to convert

D : Data value which will be converted and saved

T : The table that has Scale information

   (Scale information must be saved at the 4 Word/Double word memory as format)

n : Number of data that will be converted

[Example]

Converting 0~16000 value to -10~10

Scale Table

D0090    Minimum value (Example: 0)

D0091    Maximum value (Example: 16000)

D0092    Minimum scaled value (Example:-10)

D0093    Maximum scaled value (Example: 10)

 

As example, if D0020 is 8000, it will be converted to “0” as scale value and saved in D80.