User guide

Chapter 20
Math Instructions
2023
Math Register
Contents unchanged.
Typical Application Converting Degrees Celsius to Degrees Fahrenheit
Convert degrees Celsius to degrees Fahrenheit. The conversion equation is
F = (9/5)C + 32, or F = (1.8)C + 32.
Example: 25 degrees C = 77 degrees F.
F = (1.8)25 + 32 = 77. Graphically,
25 100
32
77
100
C
F
To implement the conversion equation
F = (1.8)25 + 32 = 77
in the SCL instruction:
1. Place the degrees C value (25 in this case) in the source parameter.
2. The multiplier is 1.8, so place a program constant value of 18000 in the
rate parameter.
3. 32 must be added. Place this program constant in the offset parameter.
When the SCL instruction goes true, the result will appear in the word
address entered in the destination parameter.
SCL
SCALE
Source N7:0
25
Rate [/10000] 18000
Offset 32
Dest N7:1
77
The source 25 is multiplied by
18000/10000 and added to 32. The
result 77 is placed in the destination.