Basic Programming Principles of PLCs
◾
323
PC
2
detects a defective cap, it causes the compressed air piston to extend and push the defective
cap into a bin of waste products, as shown in Figure 7.54b. This part of automation will not con-
cern us. What is desired is a counter to increase its content with pulses from PC
1
, and to decrease
it with pulses from PC
2
, so that the final content of the counter expresses the well produced caps.
Additionally, we want four indicator lights (h1, h2, h3, and h4) to be activated when the content
of the counter is C0 ≤ 200, C0 = 400, C0 ≥ 600, and 750 ≤ C0 ≤ 800, respectively. For the I/O
connections shown in Figure 7.54c, the required Boolean language program is the following:
A
I0.5
CU C0
A
I0.7
CD C0
A
I0.0
L
‘0’
S
C0
A
I0.3
R
C0
L
C0
L
‘200’
≤
=
Q2.0
L
C0
L
‘400’
=!
=
Q2.2
L
C0
L
‘600’
≥
=
Q2.4
L
C0
L
‘750’
≥
=
M30.0
L
C0
L
‘800’
≤
=
M30.1
A
M30.0
A
M30.1
=
Q2.6
BE
A
I0.5
CU C0
A
I0.7
CD C0
A
I0.0
L
‘0’
S
C0
A
I0.3
R
C0
L
C0
L
‘200’
≤
=
Q2.0
L
C0
L
‘400’
=!
=
Q2.2
L
C0
L
‘600’
≥
=
Q2.4
L
C0
L
‘750’
≥
=
M30.0
L
C0
L
‘800’
≤
=
M30.1
A
M30.0
A
M30.1
=
Q2.6
BE
With the set button, we set the counter to zero value or any other value is desired, and with the
reset button we can reset its content at any phase of operation.
Comparison of times. Let’s consider an example where a number of machines are desired to start
their operation with the instantaneous push of a common pushbutton with a time difference of 5 s
from each other. One solution would be to use an equal number of timers, each one programmed in
the corresponding ON-delay time. Instead of this solution, a single timer and comparison instruc-
tions will be utilized. In this implementation, the L Tx instruction is utilized, since it permits the
remaining time to be measured to load in the accumulator, thus Tx is going to measure from the
time instant that the instruction is executed. Figure 7.55a shows the connections of the I/O devices
for three machines (C
1
, C
2
, and C
3
); however, the program can be expanded for any number of
machines. The time diagram of starting up the three machines and the corresponding times to be
used in the programming are presented in Figure 7.55b, including the start of a fourth hypothetical
machine. One or more machines may be added in the same way with a corresponding increase of
the timer setting time. The required Boolean language program is the following:
A
I0.0
L
‘18 sec’
SE T3
L
T3
L
‘18’
≤
S
Q2.0
L
T3
L
‘13’
≤
S
Q2.3
L
T3
L
‘8’
≤
S
Q2.6
AN I0.3
R
Q2.0
R
Q2.3
R
Q2.6
BE
A
I0.0
L
‘18 sec’
SE T3
L
T3
L
‘18’
≤
S
Q2.0
L
T3
L
‘13’
≤
S
Q2.3
L
T3
L
‘8’
≤
S
Q2.6
AN I0.3
R
Q2.0
R
Q2.3
R
Q2.6
BE
A self-holding pulse timer is used because pressing the start button is momentary. With the
reset button, all the machines will stop at the same time.
Do'stlaringiz bilan baham: