How to Troubleshoot Apps for the Modern Connected Worker
PLC Programming Fundamentals: Understanding Ladder Logic and Basic Instructions
1. Technology Training that Workswww.idc-online.com/slideshare Technology Training that Workswww.idc-online.com/slideshare
Writing Simple PLC
Ladderlogic Programs
2. Technology Training that Workswww.idc-online.com/slideshare Technology Training that Workswww.idc-online.com/slideshare
Presented by
Doctor Steve Mackay
Dean of Engineering
of the
Engineering Institute of
Technology
3. Technology Training that Workswww.idc-online.com/slideshare Technology Training that Workswww.idc-online.com/slideshare
What you will gain from this
presentation
• An understanding of the key elements of
ladderlogic programs
• Look at simple programs
• Examine design and troubleshooting of a PLC
program
4. Technology Training that Workswww.idc-online.com/slideshare Technology Training that Workswww.idc-online.com/slideshare
Objectives
In this chapter, the following will be covered:
• Introduction to PLC programming
• Types of programming languages
• Basic programming instructions
• Advanced programming instructions
5. Technology Training that Workswww.idc-online.com/slideshare Technology Training that Workswww.idc-online.com/slideshare
Introduction
Whilst on the subject of PLC programming, an
immediate question that comes to mind, is
what components would be need to program a PLC?
The following components would be required:
• Computer with accessories
• Programming software
Just as tools cannot work alone, the same applies to
PLC applications. Hence, a good knowledge of ‘PLC
programming (languages)’ is very necessary.
6. Technology Training that Workswww.idc-online.com/slideshare Technology Training that Workswww.idc-online.com/slideshare
Computer with accessories
As the programming unit is usually taken near a
PLC panel, it is better to choose the PC
configuration of industrial type so that it
withstands the industrial environment easily.
Laptops are also a good option and handy
option! A PG-PLC communication cable (along
with PG unit) is essential for establishing a
physical link between the PG and the PLC.
7. Technology Training that Workswww.idc-online.com/slideshare Technology Training that Workswww.idc-online.com/slideshare
PLC programming setup
8. Technology Training that Workswww.idc-online.com/slideshare Technology Training that Workswww.idc-online.com/slideshare
Programming software
The programming software allows the programmer / user to perform
the following functions:
• Develop PLC program in selected programming languages.
• Check the PLC program for correctness.
• Simulate the PLC program.
• Download or transfer the PLC program from the programming unit to
the PLC.
• Check status of an Online PLC program, running in PLC CPU.
• Modify or change the parameters of a PLC program online.
• Check status of a PLC and related I/O modules.
• Take backups of the PLC program by transferring program from PLC
to PG unit.
9. Technology Training that Workswww.idc-online.com/slideshare Technology Training that Workswww.idc-online.com/slideshare
PLC programming steps
To develop a PLC program for any process or system,
simply follow the steps given below:
• Understanding the process and define the control
philosophy
• Ensure the preparation of a control strategy
• Create a flowchart
• Implement the flowchart, using selected
programming languages
10. Technology Training that Workswww.idc-online.com/slideshare Technology Training that Workswww.idc-online.com/slideshare
Understanding process and defining
control philosophy
1. Before developing a PLC program for a particular process, it is very
important to first understand the process. Right from program
development to commissioning, you will need the knowledge of the
process you are dealing with.
2. After doing that, develop a ‘Control Philosophy,’ which defines what
needs to be done for achieving process control under process limits
and serves as a platform for control program.
3. Since each process has different aspects of engineering, such as
operation, electrical, instrumentation, mechanical, chemical, etc., it
is important to formulate the ‘Control Philosophy’ jointly with
people who know and understand these various aspects.
11. Technology Training that Workswww.idc-online.com/slideshare Technology Training that Workswww.idc-online.com/slideshare
Preparation of control strategy
(algorithm)
Once the ‘Control Philosophy’ is formalized, the programmer can
start applying his mind at to how to accomplish the tasks
mentioned, in the most optimized manner.
1. Firstly, the ‘Control Philosophy’ task is divided into different
groups, by studying the sequence of events that take place /
happen in a process.
2. Next, the individual group tasks are further sub-divided into
parts and a solution (output results) is sought for all the
sections. This is referred to as the process of building an
‘Algorithm’ or control strategy.
3. After building the control strategy for the first time,
alternative approaches (to obtain similar output results),
should also be considered.
12. Technology Training that Workswww.idc-online.com/slideshare Technology Training that Workswww.idc-online.com/slideshare
Creating a flowchart
13. Technology Training that Workswww.idc-online.com/slideshare Technology Training that Workswww.idc-online.com/slideshare
Programming languages
The following languages are available for the
programming of an application:
1) Ladder diagram
2) Function block diagram
3) Instruction list
4) Sequential function chart
5) Structured text
14. Technology Training that Workswww.idc-online.com/slideshare Technology Training that Workswww.idc-online.com/slideshare
Ladder diagram
15. Technology Training that Workswww.idc-online.com/slideshare Technology Training that Workswww.idc-online.com/slideshare
Ladder program execution
16. Technology Training that Workswww.idc-online.com/slideshare Technology Training that Workswww.idc-online.com/slideshare
Basic logic instructions
These instructions are basically representative of the ON/Off
status of the inputs and also for changing the output
status. They are also referred as ‘Bit’ type instructions and
can be written as follows:
1. XIC (Examine if Close)
2. XIO (Examine if Open)
3. OTE (Turn a bit to ‘True’/’False’)
4. OTL (Latch a bit to ‘True’ state)
5. OTU (Latch a bit to ‘False’ state)
6. OSR (One Shot Rising)
17. Technology Training that Workswww.idc-online.com/slideshare Technology Training that Workswww.idc-online.com/slideshare
XIC (Examine if Close)
18. Technology Training that Workswww.idc-online.com/slideshare Technology Training that Workswww.idc-online.com/slideshare
XIO (Examine if Open)
19. Technology Training that Workswww.idc-online.com/slideshare Technology Training that Workswww.idc-online.com/slideshare
OTE (Turn a bit to ‘True’/’False’)
20. Technology Training that Workswww.idc-online.com/slideshare Technology Training that Workswww.idc-online.com/slideshare
OTL (Latch a bit to ‘True’ state)
21. Technology Training that Workswww.idc-online.com/slideshare Technology Training that Workswww.idc-online.com/slideshare
OTU (Latch a bit to ‘False’ state)
22. Technology Training that Workswww.idc-online.com/slideshare Technology Training that Workswww.idc-online.com/slideshare
OSR (One Shot Rising)
23. Technology Training that Workswww.idc-online.com/slideshare Technology Training that Workswww.idc-online.com/slideshare
Timers
Timers and counters are some of the most
frequently used instructions in a program.
Unfortunately, very few people know about
the different type of timers that are available
and how these variations actually work.
Once fully understood, they definitely play a
vital role in effective programming
24. Technology Training that Workswww.idc-online.com/slideshare Technology Training that Workswww.idc-online.com/slideshare
Timer related general terms
• Timer Address: Each timer is given a unique address in the software.
Timers have an area reserved for them in the memory of your CPU.
Generally, PLCs have 128 or 256, or more number of timers available,
depending on the PLC’s make.
• Enable: This is a timer input signal that enables the timer. Generally,
it is given through an input signal or a bit.
• Preset Time Value: This is the target time by which the event
‘On/Off’ has to be delayed.
• Accumulated Time Value: This shows the current timer value once
timer is started.
• Timer Base: This is the value of time (usually indicated in milli-
seconds or seconds) by which the timer increments during running.
25. Technology Training that Workswww.idc-online.com/slideshare Technology Training that Workswww.idc-online.com/slideshare
TON (On Delay Timer)
26. Technology Training that Workswww.idc-online.com/slideshare Technology Training that Workswww.idc-online.com/slideshare
TOF (Off Delay Timer)
27. Technology Training that Workswww.idc-online.com/slideshare Technology Training that Workswww.idc-online.com/slideshare
RTO (Retentive Timer)
28. Technology Training that Workswww.idc-online.com/slideshare Technology Training that Workswww.idc-online.com/slideshare
Counter
The Counter is an instruction, which performs the ‘counting pulses of
inputs in a program’.
It functions very similarly to hardware timers, from an operation point
of view. It measures the pulses of an input signal and, according to its
type of action, is classified as:
• Up Counter (Increments the count on receiving pulse input).
• Down Counter (Decrements the count on receiving pulse input).
• Up-Down Counter (Increments as well as Decrements the count on
receiving pulse input).
29. Technology Training that Workswww.idc-online.com/slideshare Technology Training that Workswww.idc-online.com/slideshare
Counter related general terms
Counter Address: Each counter is given a unique address in the software. Counters have an area reserved
for them in the memory of the CPU. Generally, PLCs have 128 or 256 or more counters, depending on
the PLC manufacturer.
Counter Value: A 16-bit word is reserved for each counter in the system data memory. This is used for
storing the counter value (for the counter numbered from 0 to 999) in binary code.
Preset Value: The preset value (0...999) is specified in BCD at the "PV" input, as a constant (C#...)
• in BCD format via a data interface.
Count Up: When the RLO (result of logic operation) at the "CU" input changes from "0" to "1", the current
counter reading is incremented by 1 (upper limit = 999).
Count Down: When the RLO at the "CD" input changes from "0" to "1", the current counter reading is
decremented by 1 (lower limit = 0).
Set Counter: When the RLO at the "S" input changes from "0" to "1", the counter is set to the value
at the "CV" input.
Reset Counter: When RLO equals “1” at the ‘Reset Counter’ input, the counter is set to zero. If the Reset
condition is still fulfilled, the counter cannot be set and counting is not possible.
30. Technology Training that Workswww.idc-online.com/slideshare Technology Training that Workswww.idc-online.com/slideshare
C-UP (Up Counter)
31. Technology Training that Workswww.idc-online.com/slideshare Technology Training that Workswww.idc-online.com/slideshare
C-DN (Down Counter)
32. Technology Training that Workswww.idc-online.com/slideshare Technology Training that Workswww.idc-online.com/slideshare
C-UD (Up-Down Counter)
33. Technology Training that Workswww.idc-online.com/slideshare Technology Training that Workswww.idc-online.com/slideshare
Program flow control instructions
The further we delve into a program segment, the more likely it is that
we may need to execute an instruction (or a group of instructions)
based on certain condition.
That purpose is solved by ‘Program Flow Control’ instructions.
These instructions can be classified broadly as per the following
function:
• To control execution of sub-routines within the main program.
• To control execution of instructions within sub-routines.
34. Technology Training that Workswww.idc-online.com/slideshare Technology Training that Workswww.idc-online.com/slideshare
JU (Jump Unconditional)
35. Technology Training that Workswww.idc-online.com/slideshare Technology Training that Workswww.idc-online.com/slideshare
JC (Jump if "RLO" bit =1)
If an un-conditional ‘Jump’ instruction is used,
the called set of instructions will execute each
time. However, it may not always be
necessary to execute the set of instructions
each time. To avoid doing this, conditions are
formulated for the execution of instructions,
and those conditions are grouped together to
generate a ‘RLO’ (Result of Logic Operation).
36. Technology Training that Workswww.idc-online.com/slideshare Technology Training that Workswww.idc-online.com/slideshare
JCN (Jump if "RLO" bit =0)
This is very similar to the conditional jump instruction ‘JC’. The only
difference is that it executes the related block, but only when ‘RLO’ is
zero.
If the instruction ‘JCN’ is used in the main program of the example
shown in Fig. 8.9, then block (subroutine) PB10 will be executed only
when the ‘RLO’ before the ‘JC’ instruction is at logic ‘0’.
If the ‘RLO’ is not at logic ‘0’; then block (subroutine) PB10 will not be
processed or executed in that program cycle. The program execution
in OB1 (main block) will continue further.
Once again, it must be stressed that ‘RLO’ is the result of logic
operations that happened just before ‘JCN’ instruction.
37. Technology Training that Workswww.idc-online.com/slideshare Technology Training that Workswww.idc-online.com/slideshare
Master Control (MC)
38. Technology Training that Workswww.idc-online.com/slideshare Technology Training that Workswww.idc-online.com/slideshare
Data load and transfer instructions
39. Technology Training that Workswww.idc-online.com/slideshare Technology Training that Workswww.idc-online.com/slideshare
LOAD (LD)
This is a very commonly used instruction for ‘getting’
the data in an accumulator or a temporary storage
area.
It is basically used for ‘collecting’ the data from an
Input image table (PII), accumulator and data
registers. This instruction is used along with the
reference of the location from where the data has
to be collected.
40. Technology Training that Workswww.idc-online.com/slideshare Technology Training that Workswww.idc-online.com/slideshare
TRANSFER (T)
This instruction is used, in conjunction with the ‘LOAD’
instruction, to transfer data collected to another
place. It is basically used for ‘transferring’ the data in
between the accumulator, data registers and the
output image table (PIQ).
Similarly to the ‘LOAD’ instruction, it is also used
along with a reference of the location to where the
data has to be transferred.
41. Technology Training that Workswww.idc-online.com/slideshare Technology Training that Workswww.idc-online.com/slideshare
MOVE (MOV)
42. Technology Training that Workswww.idc-online.com/slideshare Technology Training that Workswww.idc-online.com/slideshare
Arithmetic or math instructions
In general, it will be found that all PLCs makes always include the
following math functions:
• Addition - The capability to add one data register to another. It is
commonly called the ‘ADD’ instruction.
• Subtraction - The capability to subtract one data register from
another. It is commonly called the ‘SUB’ instruction.
• Multiplication - The capability to multiply one data register with
another. It is commonly called the ‘MUL’ instruction.
• Division - The capability to divide one data register into another. It is
commonly called the ‘DIV’ instruction.
43. Technology Training that Workswww.idc-online.com/slideshare Technology Training that Workswww.idc-online.com/slideshare
ADDITION (ADD)
44. Technology Training that Workswww.idc-online.com/slideshare Technology Training that Workswww.idc-online.com/slideshare
SUBTRACTION (SUB)
45. Technology Training that Workswww.idc-online.com/slideshare Technology Training that Workswww.idc-online.com/slideshare
MULTIPLICATION (MUL)
46. Technology Training that Workswww.idc-online.com/slideshare Technology Training that Workswww.idc-online.com/slideshare
DIVISION (DIV)
47. Technology Training that Workswww.idc-online.com/slideshare Technology Training that Workswww.idc-online.com/slideshare
System Programming
and Implementation
48. Technology Training that Workswww.idc-online.com/slideshare Technology Training that Workswww.idc-online.com/slideshare
Objectives
In this chapter, the following topics will be dealt
with:
• Introduction to system programming
• Formulating I/O list
• Developing program
• Program testing and simulation
49. Technology Training that Workswww.idc-online.com/slideshare Technology Training that Workswww.idc-online.com/slideshare
Introduction
PLC programming has been dealt with, in detail, in the previous chapter. Attention will
now be focussed on how to perform a PLC project’s system programming, and
implement it successfully. To do this in a systematic manner, one needs to
understand the following strategies.
• Taking process inputs
• Creating I/O list
• Deciding hardware configuration of the PLC system
• I/O address assignment
• Developing program structure
• Tips for developing a PLC program
• Program verification and simulation
• Creating documentation
50. Technology Training that Workswww.idc-online.com/slideshare Technology Training that Workswww.idc-online.com/slideshare
Taking process inputs
While taking process input’s (information), we should get information
about following:
• The battery limits of process we are supposed to control.
• Control philosophy and other process related documentation.
• Total electrical equipment list with detail specifications.
• Total instrument list with detail specifications.
• Abnormal conditions for process and individual equipment.
• Different operating modes for process and equipment and their
significance.
• Physical layout of PLC, operator stations and process.
• Specific requirement about voltage levels for field devices.
• Elements to be hardwired.
• Operator station requirements.
51. Technology Training that Workswww.idc-online.com/slideshare Technology Training that Workswww.idc-online.com/slideshare
Creating I/O list
52. Technology Training that Workswww.idc-online.com/slideshare Technology Training that Workswww.idc-online.com/slideshare
Deciding hardware configuration of PLC
system
• The following deciding factors should also be taken into consideration while going
for PLC configuration:
• Physical layout of process equipment (decides whether to go for local I/Os or
remote I/Os).
• Specifications of instruments and other devices.
• Nature and volume of process (decides type of CPU and I/Os to be used).
• Voltage standards (decides type of modules and PLC interrogation voltages).
• Communication requirement of PLC (decides CPU, communication modules,
communication medium).
• Future expansion in process (CPU and interface cards should accommodate further
expansion).
• Compatibility with operator stations.
• Technical competitiveness.
• Readily available spares.
• After sales technical support.
53. Technology Training that Workswww.idc-online.com/slideshare Technology Training that Workswww.idc-online.com/slideshare
Typical PLC Hardware configuration
54. Technology Training that Workswww.idc-online.com/slideshare Technology Training that Workswww.idc-online.com/slideshare
I/O addressing
55. Technology Training that Workswww.idc-online.com/slideshare Technology Training that Workswww.idc-online.com/slideshare
Developing program structure
Try to focus on individual pieces one by one. Ask the following
questions to yourself:
• What is the physical division of piece of process?
• What are the inputs for this piece of process?
• What are the outputs for this piece of process?
• What other information required?
• What is the sequence of operation?
When you start thinking about these questions, keep the piece of
process at the centre, and you are gradually moving towards the
solution.
56. Technology Training that Workswww.idc-online.com/slideshare Technology Training that Workswww.idc-online.com/slideshare
Hot slab rolling process
57. Technology Training that Workswww.idc-online.com/slideshare
Thank You For Your Interest
If you are interested in further training, please visit:
IDC Technologies Short Courses:
Two-day practical courses available to the public:
http://www.idc-online.com/slideshare
Notes de l'éditeur
Introduction
Reviews current and emerging trends in the engineering employment market – with a focus on WA.
My intention is to put things into perspective in the background of WA’s persistent skills shortage.
So you can go away with a better idea of what employers are looking for and what qualification, skills and experience are “in-demand”
Catch phrase has an underlying message. – particularly for prospective job applicants
– more on that later.