Scaling example – Rockwell Automation 1794-IE4XOE2,1794-IE8,1794-OE4,D17946.5.2 FLEX I/O ANALOG MODULE User Manual
Page 66
Data Table Formats C–3
Publication 1794Ć6.5.2 - May 1996
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:
EXPRESSION:
F8:0
968.0001
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
((1000.000 - 32.00000)
| 30840) * N13:0
COMPUTE
DESTINATION:
EXPRESSION:
N30:0
1000
CPT
F8:0 + 32.00000
Scaled Data
Example using Compute Instructions