Calculating the shifted linear relationship -15, Calculating the shifted linear relationship – Rockwell Automation 1746-XXXX SLC 500 4-Channel Analog I/O Modules User Manual User Manual

Page 77

Advertising
background image

Publication 1746-UM005B-EN-P - June 2004

Programming Examples 6-15

The following graph shows the shifted linear relationship. Notice that
the resulting offset value is reduced.

Calculating the Shifted Linear Relationship

Use the following equations to recalculate the linear relationship:

Scaled value = ((input value - input min.) x slope)) + offset

Slope = (scaled max. - scaled min.) / (input max. - input min.)

(31,208 - 6,242) / (100-90) = 24,966/10

Offset = scaled min.

6,242

Scaled value = ((input value - 90) x (24,966/10)) + 6242

Since the slope is greater than 3.2767, only standard math can be used
for the ladder diagram with SLC 500 fixed, SLC 5/01, 5/02, 5/03
(OS300 and 301) and 5/04 (OS400). The following ladder diagram
prevents a processor fault by unlatching the mathematical overflow bit
S2:5/0 before the end of the scan. Refer to the example ladder
diagram on the next page. Following this example is another ladder
diagram performing the same function, but using the SCP (scale with
parameters) instruction available only in the SLC 5/03 (OS302), SLC
5/04 (OS401), and SLC 5/05.

Scaled

Value

Input Value

(input min.)

100%

(input max.)

90%

20 mA = 31208

(scaled max.)

4 mA = 6242
(scaled min.)

Advertising