Scaling example – Rockwell Automation 1793-OE2S FLEX INTEGRA ANALOG MOD User Manual
Page 70
![background image](/manuals/579724/70/background.png)
Publication 1793-6.5.1 - April 1999
Data Table Formats
B-3
Scaling Example
To scale your data to a different range:
•
SLC 500 - use the scaling instruction.
•
PLC-5 - determine a constant (slope) by dividing the desired range by
the actual range. Multiply the result by your data, and add or subtract
any offset.
Example:
A 4-20mA input places data at N13:0 (Figure 3.4 on page 3-4), with a range of 0 to
30,840. (30,840 = 7878 hex - see data format on page C-2).
You want the 4-20mA (0 to 30,840) to be 32 to 1000 degrees in the PLC-5.
Use the following formula:
= {[(1000 - 32)/30,840] X N13:0} + 32
F8:0
Scaled Data (degrees) @ N30:0 = {[(Desired Range)/Actual Range] X Analog Input Data} + Offset
= F8:0 + 32
Scaled Data (degrees) @ N30:0
(See ladder logic below)
= F8:0 + 32
COMPUTE
DESTINATION:
F8:0
968.0001
EXPRESSION:
((1000.000 - 32.00000)
| 30840) * n13:0
This rung will scale FLEX I/O analog data to a different range. In this example, we want the 4-20mA input data to represent 32
to 1000 degrees in the PLC-5. For this example, N13:0 = 30,840 (7878 in hex). Two compute instructions are needed because
of the way the destination value will be rounded if we use an integer location instead of floating point in the first compute
instruction. The second compute instruction has a final destination of an integer location.
CPT
COMPUTE
DESTINATION:
N30:0
1000
EXPRESSION:
F8:0 + 32.00000
CPT
Scaled Data
Example using Compute Instructions