Rockwell Automation 1746-FIO4V SLC 500 Fast Analog I/O/ User Manual User Manual

Page 46

Advertising
background image

Publication 1746-UM009B-EN-P - September 2007

46 Write Ladder Logic

Standard Math Example

Example Program Using the Scaling Instruction (SCL)

GREATER THAN
Source A
Source B

I:3.1
2750

Rung 2:0
Check for below range

Rung 2:1
Check for above range

Rung 2:2
Scale the analog input

Rung 2:3

Multiply by the
scaled range

Clear fault bit
from overflow

Divide result
by input range

Add offset

Below-range
flag

Above-range
flag

B3/0
(L)

B3/1
(L)

S2:5/0

(U)

LES

GRT

MUL

DDV

ADD

N7:0 contains
process pressure

END

LESS THAN
Source A
Source B

I:3.1
1750

MULTIPLY
Source A
Source
Dest

I:3.1
400
N7:0

DOUBLE DIVIDE
Source A
Dest

4095
N7:0

ADD
Source A
Source B
Dest

N7:0
100
N7:0

GREATER THAN
Source A
Source B

I:3.1
2750

Rung 2:0
Check for below range

Rung 2:1
Check for above range

Rung 2:2
Scale the analog input

Rung 2:3

N7:0 contains
process
temperature

Below-range
flag

Above-range
flag

B3/0
(L)

B3/1
(L)

LES

GRT

SCL

END

LESS THAN
Source A
Source B

I:3.1
1750

SCALE
Source
Rate (/10000)
Offset
Dest

I:3.1
977
100
N7:0

Advertising
This manual is related to the following products: