306
◾
Introduction to Industrial Automation
In the classic automation circuit shown in Figure 7.33, the relay C
1
is activated when the contact
S
1
closes and the contact S
2
is closed, while the relay C
2
is activated when either the contact S
1
closes or the contact S
2
closes, or both contacts close. In the same figure, the I/O connections are
also presented, as well as the corresponding program in Boolean language. The followed table,
in the same figure, depicts the generation and evolution of the primary and secondary RLOs for
all instances of the input state combinations. The result of the activation instructions obviously
depends on the last (before executing the activation instruction) P.RLO, and is marked as logical
“0” or “1” alongside the instruction (gray area).
Programming in three basic languages. Subsequently, simple examples of programmable auto-
mations will be presented in all three basic programming languages, namely Boolean (or IL),
LAD, and FBD. In Figures 7.34 through 7.38, the classic automation circuit is presented with
the corresponding program in three programming languages, while the corresponding electrical
A
I1.0
AN I1.4
=
Q0.0
-------------
O
I0.0
O
I1.4
=
Q0.2
BE
PROGRAM
A
I1.0
AN I1.4
=
Q0.0
-------------
O
I0.0
O
I1.4
=
Q0.2
BE
PROGRAM
Input signal
S. RLO
P. RLO
Input signal
S. RLO
P. RLO
Input signal
S. RLO
P. RLO
Input signal
S. RLO
P. RLO
A I1.0
A I1.4
= Q0.0
NEW RLO CREATION
0
0
0
0
00
00
1
1
1
1
1
11
11
0
1
1
1
1
0
0
0
1
1
1
1
1
1
st
case
S
1
= ΝΟ S
2
= ΝΟ
2
nd
case
S
1
= ΝΟ S
2
= ΝC
3
rd
case
S
1
= ΝC S
2
= ΝO
4
th
case
S
1
= ΝC S
2
= ΝC
Program
PLC
INPUTS
OUTPUTS
0 V
+24 V DC
0 V
+24 V DC
Q 0.0
I 1.0
I 1.4
Q 0.2
Implementation with PLC
0 V
+24 V DC
Conventional automation circuit
A
I1.0
AN I1.4
=
Q0.0
O
I0.0
O
I1.4
=
Q0.2
BE
Program
AΝ
New RLO creation
O I1.0
O I1.4
= Q0.2
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
1
0
0
1
0
0
0
1
1
1
1
0
1
1
1
1
1
1
0
0
1
0
1
1
1
1
BE
PLC
Inputs
Outputs
Q0.0
I1.0
I1.4
Q0.2
S
1
S
2
C
1
C
2
C
1
C
2
S
1
S
2
S
1
S
2
0
Figure 7.33 Creation of S.RLO and P.RLO in a Boolean program for all possible combinations
of input statuses.
Basic Programming Principles of PLCs
◾
307
scheme showing the connections of the I/O devices to the PLC has been omitted. Furthermore,
it should be clarified that in all these examples, the input switching contacts, connected to the
PLC, have the same state as the one displayed in the classical automation circuit. In addition, in
every conventional automation circuit, the corresponding addresses of the switching contacts and
relays in the PLC are depicted for economy of notation. Figure 7.34 presents the AND logic of
three switching sensor contacts, where their simultaneous activation energizes the relay.
In Figure 7.35, the OR logic of three switching sensor contacts is presented, as in a previous example.
In Figure 7.36, a combination of the AND logic before the OR logic of four switching contacts
from an equal number of sensors is presented, with the expected goal of the activation of the relay Q3.1.
The Boolean program uses the OR instruction without any reference to a variable. Obviously, there
is another way of programming for achieving the same goal without using the previous instruction.
In Figure 7.37, a composite mixed circuit of four switching contacts from the same number of
sensors is presented with the aim to activate the relay with any possible combination of states of
the switching contacts.
+24 V DC
BOOLE
A I1.1
A I1.3
A I1.7
= Q3.5
BE
LAD
I 1.1
I 1.3
Q
I 1.7
Q 3.5
I1.1
I1.3
I1.7
AND
FBD
0 V
Q3.5
Ι1.1
Ι1.3
Ι1.7
BOOLE
A I1.1
A I1.3
A I1.7
= Q3.5
BE
LAD
I1.1
I1.3
Q3.5
I1.7
Q3.5
I1.1
I1.3
I1.7
AND
FBD
Figure 7.34 The AND logic in three basic languages.
O I1.2
O I1.7
O I1.5
= Q3.2
BE
I1.2
I1.7
Q3.2
I1.5
Q3.2
I1.2
I1.7
I1.5
OR
FBD
BOOLE
O I1.2
O I1.7
O I1.5
= Q3.2
BE
LAD
OR
0 V
Q3.2
+24 V DC
Ι1.2
Ι1.7
Ι1.5
Figure 7.35 The OR logic in three basic languages.
AND
AND
OR
AND
AND
OR
LAD
I1.5
I1.6
Q3.1
I1.4
I1.3
0 V
Q3.1
+24 V DC
Ι1.6
Ι1.4
Ι1.5
Ι1.3
BOOLE
A I1.5
A I1.6
O
A I1.4
A I1.3
= Q3.1
BE
Q3.1
I1.5
I1.6
FBD
I1.4
I1.3
AND
AND
OR
Figure 7.36 The AND logic in combination with OR logic in three basic languages.
308
◾
Introduction to Industrial Automation
Figure 7.38 shows a combination of an OR logic before an AND logic of four switching con-
tacts from the same number of sensors. In this case, it is also desired to activate the relay with any
possible combination of switching contact states.
In all of the above programs written in Boolean or IL language, the “BE” instruction that is not
included in Table 2.1 has been inserted. This is a simple instruction to declare the end of the program.
Logic coils. It is recalled that with the term “logic coils” we have named the digital implementa-
tion or replacement of the auxiliary relays in classic automation. A logic coil is nothing more than a
1 bit memory location that can be set to “0” or “1” depending on whether the logic coil is switched
off or activated respectively. Consider the classic automation circuit of Figure 7.39a, where two
sensors S
1
and S
2
control the activation of the auxiliary relay d
0
, and then d
0
in conjunction with a
third sensor S
3
to control the operation of the power relay C
1
. For the obvious purpose of operating
the relay C
1
and connecting the I/O devices to the PLC, as shown in Figure 7.39b, the required
program in Boolean language, under a direct representation of the classic circuit logic, is as follows:
A I1.0
A I1.2
= M7.0
A M7.0
A I1.4
= Q0.2
BE
BOOLE
0 V
Q2.1
I6.1
AND
OR
OR
OR
I6.0
AND
OR
OR
O I6.0
O(
A I6.1
A(
O I6.2
O I6.3
)
)
= Q2.1
BE
+24 V DC
Ι6.0
Ι6.2
Ι6.1
Q2.1
Ι6.3
FBD
I6.2
I6.3
AND
OR
OR
LAD
I6.0
Q2.1
I6.2
I6.1
I6.3
Do'stlaringiz bilan baham: