PLC Programming For Industrial Automation: Kevin Collins
PLC Programming For Industrial Automation: Kevin Collins
Industrial Automation
Kevin Collins
Contents
Introduction
PLC Basics
Function of a PLC
Network Protocols
Questions
Ladder Programming
Conditional Logic
Ladder Diagrams
Internal relays
Timers
Counters
Sequential Programming
Introduction
Parallel Branching
I have been teaching PLC programming for fifteen years and the question that
I hear most often from students is “Can you recommend a book on this?” In response
I have trotted out the titles of various standard text books but I have never come
across a book that really develops the skill of PLC programming instead of telling the
reader what PLCs are all about. I have finally decided to fill this gap in the market
myself.
“What sort of PLCs do you use?” is another popular question. It implies that
familiarity with one make and model of PLC will leave the programmer struggling
when asked to use a different type. I deliberately teach a generic style of
programming that allows the learner to switch between types of PLC as easily as
between different makes of electronic calculator. Every skill needs practice however
and my thanks are due to TriLogi for permission to use their excellent PLC simulator
software throughout this book. The students can load the software onto a computer
and practice the examples and exercises provided.
The third problem that authors have failed to address is the variety of
programming languages available. Ladder logic is by far the most popular
programming language in use because of its resemblance to hard-wire control
diagrams. On its own, however it is unsuitable for complex programs. As the
automation task grows so the ladder program expands organically, until only the
original programmer can find his way through the tangle of inputs and outputs, relays
and function blocks.
This problem has been solved by the use of Sequential Function Chart
(GRAFCET) methods but the obvious popularity of ladder logic persists. The solution
is to plan the program using a sequential function chart and then to enter it into the
PLC using ladder logic. In this way program is highly structured, standardised and
easy to debug and modify, while the familiarity of ladder logic is preserved.
The first two chapters of the book are used for programming basics. The
remainder concentrates on the control of automation sequences commonly found in
industry.
The examples used in the book have all been thoroughly tested and their
suitability for use in the classroom and in industry established.
Chapter 1
PLC Basics
The PLC performs the logic functions of relays, timers, counters and
sequencers. It has the following advantages:
Low cost
Reliability
Reprogramability
Program
Inputs Outputs
PLC
The PLC inputs give it information about the machine or process that it is
controlling. These are typically switches and sensors. The switches are connected to
an input module that provides the interface between the switches or sensors and the
PLC.
LED Photo
transistor
Relay (volt-free): The signal from the PLC operates a relay within the output
module connecting the control voltage to the output port and hence to the actuator.
Internal relay
contact
Common Output
port Port
Control
Voltage (+) Solenoid
Triac: This solid state device is used for switching alternating current
devices. It requires some form of over current protection.
1.3 PLC Architecture and Wiring Diagrams
S1 S2 S3
X1 X2 X3 X4
Y1 Y2 Y3
Fig 1.4 shows a pictorial view of the PLC with its connections. In practice we work
with a simplified diagram as shown in Fig 1.5.
1.4 Network Protocols
The wiring diagram in Fig 1.5 shows the inputs and outputs connected directly
(hard wired) to the PLC. The devices shown are on/off or digital in nature but the
signal to the PLC is analog. Many commonly used devices conform to a 4-20 mA
standard whereby signals of 4mA and 20mA form respectively the minimum and
maximum values of an analog signal.
With analog devices, a separate cable needs to be run between the end device
and the control system because only a single analog signal can be represented on the
circuit. The 4-20 mA standard is slowly being replaced by network or fieldbus
communications. Fieldbus is a multi-drop digital two-way communication link
between intelligent devices. Fieldbus allows the connection of a number of sensors all
located in the same area to the same cable. Fieldbus comes in many varieties
depending on the manufacturer and application. Examples include ASibus, Profibus,
Devicenet and Modbus.
A more recent trend is the development of Industrial Ethernet which has the
capacity to transport large quantities of data not only for process control but also to
integrate the process with management information systems.
This book concentrates on PLC programming and while the sample wiring
diagrams are of the type shown in Fig 1.5 the programs are designed to receive data
from inputs and to send data to outputs regardless of the network system being used.
Questions
1.
Switches, proximity devices and sensors are generally used in what way in a plc
application?
Answer: a. Relays
b. Software elements
c. Inputs
d. Outputs
2.
Fig 1.6
3.
Which option below
best describes the Answer: a. It breaks the contact when there is excess current.
action of an opto-
coupler? b. It breaks the contact when there is excess voltage.
c. It transmits the input signal using fibre optics.
d. It isolates the plc from the input voltage
4.
Fig 1.7
Study the diagram Fig 1.7 and pick the correct statement about it.
Answer: a. When the power is switched on to the plc all the n/o relay contacts
shown close.
b. The 24 V supply shown is used to power the plc itself.
c. The plc energises an output by closing the relevant relay contact.
d. When the plc outputs are energised they are all latched on by the relay
contacts shown
5.
"This type of plc output is solid-state and is used for switching alternating current."