Math Instructions Chapter 11 235
data in le address N7:25 to the data stored in le
address N7:50 and store the result in le address
N7:100.
• The rate per scan is set at All, so the instruction
goes to completion in one scan.
The program of Figure11-21 is an example of the le
subtract function of the FAL instruction. The operation of
the logic rung can be summarized as follows:
• When input switch SW is closed the rung goes true
and the processor subtracts a program constant
(255) from each word of le address N10:0 and
The scale data (SCL) instruction is used to allow very
large or very small numbers to be enlarged or reduced by
the rate value. When rung conditions are true, this instruc-
tion multiplies the source by a speci ed rate. The rounded
result is then added to an offset value and placed in the
destination. The program of Figure11-19 is an example
of the SCL instruction. The operation of the logic rung
can be summarized as follows:
• When input switch SW is closed the SCL instruc-
tion is executed.
• The number 100 stored at the source address, N7:0,
is multiplied by 25,000, divided by 10,000, and
added to 127.
• The result, 377, is placed in the destination address,
N7:1.
You can use SCL instruction to scale data from your
analog module and bring it into the limits prescribed by the
process variable or another analog module. For instance,
you can use the SCL instruction to convert a 4–20 mA
input signal to a PID process variable, or to scale an ana-
log input to control an analog output.
11.7 File Arithmetic Operations
File arithmetic functions include le add, le subtract,
le multiply, le divide, le square root, le convert from
BCD, and le convert to BCD. The le arithmetic and
logic (FAL) instruction can combine an arithmetic opera-
tion with le transfer. The arithmetic operations that can
be implemented with the FAL are ADD, SUB, MULT,
DIV, and SQR.
The le add function of the FAL instruction can be
used to perform addition operations on multiple words.
The program of Figure11-20 is an example of the le add
function of the FAL instruction. The operation of the logic
rung can be summarized as follows:
• When input switch SW is closed the rung goes true
and the expression tells the processor to add the
Figure 11-19 SLC 500 SCL (scale) instruction.
Ladder logic program Input
L1
SW
SW
SCL
SCALE
Source
Rate (/10000)
Offset
Destination
N7:0
100
25000
127
N7:1
377
Ladder logic program Input
L1
SW
SW
FAL
FILE ARITH/LOGICAL
Control
Length
Position
Mode
Destination
Expression
#N7:25 + #N7:50
R6:1
4
0
All
#N7:100
25
234
1256
77
N7:25
N7:28
= N7:100
= N7:103
+ N7:50
+
+
+ N7:53
50
22
456
100
75
256
1712
177
#N7:25 #N7:50 #N7:100
EN
DN
ER
Figure 11-20 SLC 500 fi le add function of the FAL
instruction.
Figure 11-21 SLC 500 fi le subtract function of the FAL
instruction.
680
950
20
100
N10:0
N10:3
= N7:255
= N7:258
– 255 425
695
–235
–155
#N10:0 #N7:255
Ladder logic program Input
L1
SW
SW
FAL
FILE ARITH/LOGICAL
Control
Length
Position
Mode
Destination
Expression
#N10:0 – 255
R6:5
4
0
2
#N7:255
EN
DN
ER
pet10882_ch11_226-241.indd 235pet10882_ch11_226-241.indd 235 7/27/10 4:10 PM7/27/10 4:10 PM