Page 258 - Programmable Logic Controllers, Fifth Edition - Mobile version
P. 258
plied by the data in source B (accumulated value of
L1 Input SW Ladder logic program • The data in source A (constant 20) will be multi-
MUL counter C5:10).
SW MULTIPLY
Source A 20 • The resultant answer is placed in the destination N7:2.
• Similar to previous math instructions, source A and
Source B C5:10.ACC
B in multiplication instructions can be values (con-
Destination N7:2 stants) or addresses that contain values, but A and B
cannot both be constants.
Figure 11-9 SLC 500 MUL (multiply) instruction. The program of Figure 11-10 is an example of how
MUL instruction calculates the product of two sources. The
turned on and raw material is allowed to flow into operation of the program can be summarized as follows:
the vessel. • When input switch SW is closed the MUL instruc-
• The vessel has its weight monitored continuously by tion is executed.
the PLC program (rung 3) as it fills. • The value stored in source A, address N7:1 (123),
• When the weight reaches 500 lb, the fill solenoid is is then multiplied by the value stored in source B,
de-energized and the flow is cut off. address N7:2 (61).
• At the same time, the filling pilot light indicator is • The product (7503) is placed into destination word
turned off and the full pilot light indicator (rung 3) N7:3.
is turned on. • As a result, the equal instruction becomes true, turn-
• Should the fill solenoid leak 5 lb or more of raw ing output PL1 on.
material into the vessel, the alarm (rung 5) will en-
ergize and stay energized until the overflow level is The program of Figure 11-11 is an example of how the
reduced below the 5-lb overflow limit. MUL instruction is used as part of an oven temperature
control program. The operation of the program can be
summarized as follows:
11.4 Multiplication Instruction • The PLC calculates the upper and lower deadband,
The multiply (MUL) instruction is an output instruction or off/on limits, about the set-point.
that multiplies two values and stores the result in the des- • Upper and lower temperature limits are set automati-
tination address. Figure 11-9 shows the MUL instruction cally at ±1 percent regardless of the set-point value.
used with the SLC 500 controllers. The operation of the • Set-point temperature is adjusted by means of the
logic rung can be summarized as follows: thumbwheel switch.
• When input switch SW is closed the rung will be • The analog thermocouple interface module is used
true. to monitor the current temperature of the oven.
Input Ladder logic program Output
L1 L2
SW
SW MUL
MULTIPLY PL1
Source A N7:1
123
Source B N7:2
61
Destination N7:3
7503
PL1
EQU
EQUAL
Source A N7:3
7503
Source B 7503
Figure 11-10 MUL instruction used to calculate the product of two sources.
Math Instructions Chapter 11 239
pet73842_ch11_234-251.indd 239 03/11/15 4:07 PM