Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
The actual PLC ladder logic programming code looks like a relay logic
electrical schematic drawing. There are various PLC programming languages
used in industrial automation, but the most popular is PLC ladder logic.
In it’s most basic form the rungs of code contain one or more logic conditions
and an output.
Multiple rungs of code end up looking like a ladder….. Hence the name
“Ladder Logic”.
Different industrial PLC manufacturers have many types of PLC and use
varying terminology for sizing of a PLC.
Nano PLC
Micro PLC
Mini PLC
Compact PLC
Small PLC
Brick PLC
Medium PLC
Large PLC
Modular PLC
Another factor to consider when determine the size of the PLC required is the
complexity of your application. Determining the exact requirements of your
application will put you in good stead for selecting the right PLC.
It’s always a good idea to size your PLC a little bigger than is actually required
on paper because the application requirement may change during the design
and commissioning phases and it will also allow for potential future upgrades
or expansion.
The old saying “You pay for what you get” applies here.
So, before you buy PLC be sure to get the right one for your applications
present and future requirements.
PLC Hardware
The internal structure of a PLC (Programmable Logic Controller) is based on
the same principles of that used in standard computer architecture.
There is a Central Processing Unit (CPU), memory, a program and real world
inputs and outputs.
The data flow is controlled by the CPU and organized using memory and
input/output addressing.
They also have the facility to input external signals from devices such as
switches and sensors and output to external devices such as motors and
valves.
In simple terms a PLC is split into 4 main areas shown in the diagram below….
Programmable Logic Controller Block Diagram
Inputs are field devices such as button, switches and instrumentation which
are used to decide when and how the machine will operate. Inputs are wired
directly into to the PLC or via option cards.
Outputs are field devices such as relays, motor contactors, solenoid
valves, lamps and sirens which cause the machine to operate and provide
feedback to the machine operator. Outputs are wired directly out of the PLC or
via option cards.
Data Memory is where inputs and outputs are declared and allocated to
memory locations.
Program Memory is where the ladder logic is stored and processed.
The PLC process, in very basic terms, has been specifically designed to perform
3 main tasks….
PLC Scan
In simple terms it means that the PLC monitors the status of the machine and
process. It then make decisions bases on the logical functions created by the
PLC ladder logic program that is stored in it’s memory. Lastly it initiate output
signals to control the behavior of the machine or process.
There are three essential elements and one optional element that must be
defined when declaring a variable….
Variable Name – The name must be unique and is used to make the
ladder logic easily readable by human beings, such as yourself. There
will be restrictions on the length and sometimes characters that can be
used.
Data Type – The data type used will depend on the symbol being used
and the programming operation required. Defining a variable as a BOOL
(boolean) means it has a binary value, an INT (integer) means it has a
whole number value and a REAL (floating point) means it has a number
value with a decimal point.
Address – the address can be either an Input, Output, Internal or
System memory address. The address nomenclature is dependent on
the PLC manufacturer.
Comment – Adding a comment is optional, but can assist in describing
the variable if the amount of characters in the variable name was
insufficient.
Allocating a variable name to each PLC ladder logic symbol allows the PLC
processor to identify each symbol as a unique individual with a name (variable
name), identity (data type) and place to live (memory address).
Defining variables is done by the PLC ladder logic programmer (that’s you).
Although some PLC programming software does address allocation
automatically.
The table below shows some standard data types, PLC memory allocation and
common uses for each data types….
Ladder Logic Data Types
Different PLC manufacturers use slightly different naming conventions for
variables and memory allocation. It’s just a matter of checking the PLC’s help
file to determine what to use.
Analogue inputs and outputs are signals that are proportional in nature. The
most common types are 0-10V and 4-20mA. They measure or output a signal
that has a range of values. Temperature sensors, pressure sensors, strain
gauges and flow meters are some examples of analogue inputs. Motor speed
control and proportional solenoid valves are examples of analogue outputs.
If we look at the human brain we realize it relies on our five senses of sight,
hearing, smell, taste and touch to understand what our environment is doing.
Also, the human brain controls movement in our body to create actions such
as walking, running and kicking a ball.
So let’s say we sense that our body is getting hot. Then we can roll our sleeves
up a little too cool down.
We can actually roll our sleeves up and down to regulate our body
temperature to what feels comfortable.
If we’ve rolled up our sleeves all the way and we are still too hot and we can’t
tolerate it any more then we can take our sweater off.
Brain Control System
So what would a PLC do?
Well, just like the human brain relies on information provided by our senses. A
PLC requires instrumentation to measure it’s surroundings.
And just like the human brain decides on what actions are required to be
taken and then controls movement in our body. A PLC uses the ladder logic
program stored in it’s microprocessor memory to decide what actions are
required to be taken and then controls movements in a machine by activating
electric, pneumatic and hydraulic devices.
We would connect these two pieces of equipment to the PLC . Then we would
write a PLC ladder logic program to activate the fan when the system
temperature exceeds a certain threshold. If the temperature measured
increases or decreases the PLC can adjust the speed of the fan to regulate the
temperature. When the temperature reduces below a certain threshold, for a
certain period of time, then the fan can be switched off.
PLC Control System
Now, the level of control provided is only as good as the PLC ladder logic
program contained in it’s memory. Therefore a good program with solid logic
expressions will ensure trouble free operation.
The number of machine and process control applications are endless, but here
are a few examples….
PLC’s have also been designed, unlike the home PC, to operate under harsh
industrial environments where electrical noise and Electro Magnetic
Interference (EMI) exist.
They generally, but not always, require a separate power supply and have
input and output terminal strips for connection of electrical devices.
Some have extendable and remote mounted input and output modules.
These days PLC based control systems have communication options such as
Ethernet/IP (Allen Bradley), Profinet (Siemens) and Modbus TCP/IP (Modicon).
Thus allowing networking with other PLC’s, remote input/output modules,
instrumentation, motors, actuators and Human Machine Interfaces (HMI) such
as touchscreens and SCADA systems.