0% found this document useful (0 votes)
13 views21 pages

PLC Architecture and Operation Explained

This document describes the main components of a programmable logic controller (PLC), including the input and output sections, the central processing unit (CPU), and the memory units. It explains the functions of the CPU and its internal circuits, as well as the different types of memory used in a PLC. It also describes the input and output interfaces and the different types of signals they can handle.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views21 pages

PLC Architecture and Operation Explained

This document describes the main components of a programmable logic controller (PLC), including the input and output sections, the central processing unit (CPU), and the memory units. It explains the functions of the CPU and its internal circuits, as well as the different types of memory used in a PLC. It also describes the input and output interfaces and the different types of signals they can handle.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

UNIT II

Architecture of programmable logic controllers and their cycle


operation.

2.1 Essential blocks of a programmable logic controller.


The PLC consists essentially of three blocks:
The ticket section,
The central processing unit - CPU -
The output section.
The entry section. Through the interface, adapts and encodes - in a way
understandable by the CPU–, the signals from the input devices
the sensors - that is, push buttons, limit switches, sensors, etc. It also has
a mission to protect the internal electronic circuits of the PLC, carrying out
an electrical separation between these and the collectors.

The central processing unit - CPU, Central Processing Unit - is, so to speak
thus, the intelligence of the system since, through the interpretation of the
user program instructions - and, based on the values of the
inputs–, activate the desired outputs.

The output section. Through the interface, it works in the opposite way to that of
inputs; that is, it decodes the signals coming from the CPU, amplifies them and
send with them the output devices or actuators – lamps, relays,
contactors, starters, solenoid valves, etc. –. There are also interfaces here
for adaptation to outputs and for protection of internal circuits.

With the described parts, we already have a PLC. But for it to be


operational, other elements such as the power supply unit are necessary, and
the programming unit or console–if it is not programmed from the PC–.
Visible Parts of the PLC

PLC Simatic S7-200


2.2 The CPU.

The processor is mounted on a printed circuit board; on it – and alongside the


chips - all those integrated circuits that compose it are situated,
mainly system ROM memories or firmware.
In some types of PLCs, the communication chips are also located here.
peripherals or interconnection with the input-output system.
It is composed of the microprocessor, the pulse wave generator
square or clock, and some auxiliary chip.

Microprocessors are large-scale integrated circuits (chips).


(LSI) that performs a large number of operations, which we can group into:
Logical operations.
Arithmetic type operations.
Control operations of information transfer within the PLC.

Associated auxiliary circuits:

Internal circuits can be of three types:


Arithmetic and Logic Unit circuits - ALU -. It is the part of
microprocessor where calculations and logical decisions are made for
control the PLC.
Control unit circuits - UC -. Organizes all tasks of the
microprocessor. For example, when a program instruction
encoded in machine code (zeros and ones) reaches the microprocessor, the CU knows,
through a small ROM memory that includes, what sequence of signals
It must issue in order for the instruction to be executed.
•Registers. The registers of the microprocessor are memories in which
they temporarily store data, instructions, or addresses, while needed
to be used by the microprocessor. The most important registers of a
microprocessor includes instructions, data, addresses, accumulator,
program counter, work counter, and the flag or status counter.
Buses are not circuits themselves, but conducting zones in parallel that
they transmit data, addresses, instructions, and control signals between the
different parts of the microprocessor or microcontroller. A can be made a
difference between internal and external buses:
The internals connect the different parts of the microprocessor to each other;
External ones are printed circuit tracks that connect independent chips.
The internal and external buses are continuations of each other.
The CPU will communicate with the card whose address matches the
bus combination.

What are the functions of the CPU?


In the system's ROM, the manufacturer has recorded a series of programs.
fixed executives, system software. It is to these programs that the
microprocessor to perform the corresponding executive functions, in
function of the time I worked.
The system software of any PLC consists of a series of basic functions.
what is done at certain times of each cycle: at the beginning or connection,
during the program's cycle or execution, and during disconnection.
This software or system program is slightly variable for each PLC;
but, in general, it contains the following functions:
• Supervision and control of cycle time – watchdog –, data table,
food, battery, etc.
Autotest during connection and while executing the program.
•Inicio del ciclo de exploración de programa y de la configuración del conjunto.
Generation of the base time cycle.
Communication with peripherals and programming unit.
Etc.
Internal components of the PLC

2.3 Memories of the Controller.

In our case, we will refer to the memories that use as support


semiconductor elements. Not all memories are the same; they are distinguished
two fundamental types of memories made with semiconductors:

RAM - Random Access Memory - Random Access Memory


read-write memory. In this type of memory, the ...
reading and writing processes by electric procedure; but, its information
disappears when the tension is lacking.
•ROM memory – Read Only Memory –. Read-only memory. This memory
it allows reading its content but not writing to it. The data and instructions are
recorded by the manufacturer; the user cannot alter its content. Here the
information is maintained in the absence of tension.
These are not all the available memories. There are other types whose differences
they are marked by their programming systems, their deletion, and their volatility or
persistence of information:

EPROM Memories – Erasable Programmable Read Only Memory – and EEPROM


–Electrical Erasable Programmable Read Only Memory–. Regardless of
other applications – some already mentioned in the previous paragraphs – these
Types of memory have great application as copy memories for recording.
and user program file.

User memory. Normally, the user program is recorded in


RAM memory, since it not only needs to be read by the microprocessor, but also has to
to be varied whenever the user wishes, using the unit of
programming. In some PLCs, the RAM memory is assisted by a memory
shadow of the EEPROM type. Disconnecting the power supply or a failure would erase
this memory, since RAM is a volatile memory, needs to be
constantly powered and that is why the PLCs that use it carry
incorporated a buffer battery that prevents its erasure.

Data memory. The memory in this area is also of the RAM type or
NVRAM.
On one side, there is the image of the states of the entries and
outputs, and on the other hand, the numerical data and internal variables, such as counters,

timers, brands, etc.

•Program memory. This memory, along with the processor, makes up the
CPU is divided into two areas: the so-called system memory, which
it uses RAM, and that which corresponds to the system program or firmware,
What is a fixed program recorded by the manufacturer and, therefore, uses the type of
ROM memory. In some PLCs, only the EPROM is used, so that
the system memory program can be modified, after deleting the previous one
with UV.

2.4 Input - Output Interfaces.

In compact PLCs, the inputs and outputs - I/O - are located in a single
block, along with the rest of the PLC.
In modular systems, the I/O are independent modules or cards, with several I/O.
that connect to the data bus through their driver and connector
corresponding, or to a frame or rack, which provides it with that connection to
bus and its mechanical support.

The main functions are to adapt the working voltages and intensities of
the sensors and actuators for the working of the PLC electronic circuits;
make an electrical separation between the logic circuits and the power ones
generally, through optocouplers – and provide the means of
identification of the sensors and actuators before the processor.

Entries
The tickets are easily identifiable, as they are physically characterized by
the terminals to connect input devices or sensors, for their
numbering, and by its identification input entry.
They also have a luminous activation indicator, through an LED diode.

Regarding its voltage, the inputs can be of three types:


Free of tension,
Direct current,
Alternating current.
Regarding the type of signal they receive, these can be:
Analog and
Digital

Analog. When the magnitude that is coupled to the input corresponds to a


measure of, for example, pressure, temperature, speed, etc., that is, analog,
It is necessary to have this type of input module. Its principle of
operation is based on the conversion of the analog signal to binary code
through an analog-to-digital converter–ADC–.

Digital. They are the most used and correspond to an input signal either or
nothing; that is, at a level of tension or its absence. Example of elements of
these are the end of race switches, buttons, etc.

Outputs
The identification of the outputs is carried out with the indication of output.
It is in the outputs where the output devices are connected or coupled.
actuators.
It includes an LED power indicator.
There are three types of outputs that can occur:
The relay,
A transistor,
A triac.

While the transistor output is used when the actuators are DC, the
Relays and triacs are commonly used for AC actuators.
Regarding the intensities that each of the outputs can support, these are
variables; however, they usually range between 0.5 and 2 A.

As in the inputs, the outputs can be analog and digital - although


these last ones are the most used –. In the analog ones, it is necessary a
digital to analog converter - D/A - that performs the inverse function to that of the
entrance.

2.5 Sources.

It is responsible for supplying voltage to all the modules that connect to the
PLC, as well as the processing unit and other cards according to the
PLC configuration. Its function is to reduce and adapt the input voltage, which
it is of high values and alternating current, to lower voltage values and of
direct current, Initially, the input voltage must be reduced to values
more manageable. Then, through a rectifier, it must be converted from AC to
Finally, regulators must be used to ensure stability in the
output voltage,

Basic source of a PLC

In some cases, the source may be switched type, whose main


characteristics are a reduced weight and a high output current. The low weight is
it is because it does not use bulky transformers.
Due to the importance of a PLC within an automatic process, the
the power supply of your circuitry is of utmost importance, so a good design
it must involve an alternate source that allows it to function when
the electrical fluid falls. With this, we ensure that the electronic devices
internals do not suffer failures due to overvoltage spikes and other effects
counterproductive factors existing in the distribution network.
Another option is to keep the power supply of the PLCs connected to a UPS.
(Uninterruptible Power Supply) or uninterruptible power source, which
provides the appropriate voltage for a certain time when the fluid fails
electric. This helps the PLC not to have so many abrupt shutdown cycles, the
which can be very harmful.
When acquiring a PLC, among the parameters to consider
we must include some that refer to the power source. The most
the following are important, which must be adjusted according to the
needs of the process and of the PLC as such:

In most PLCs, the power supply is included within the


same compartment where the CPU is located. In other cases, the power supply is
configurable, allowing for the adaptation of voltages and current capacities,
according to the application's needs.

PLC power supply


During the programming process of the PLCs, when it is done through a
manual programmer device, the supply voltage is provided by the
same source of the PLC, which implies that it must have the capacity to support
external connection elements. In fact, in many high-end automation systems,
The power source usually has enough current to power some sensors.
external, of course, low consumption. The maximum current capacity of the
Voltage output is printed on the connection terminals of the module.

Typical voltage configuration:

+ 5 V to power all the boards

+ 5.2 V to power the programmer

+ 24 V for the 20 mA current loop channels

In addition to compact PLCs like the S7-200, there are modular PLCs, with
possibility of exchanging its components and possibilities of expansion of
its capabilities:
Modular PLC

2.6 Modes of operation.


Programmable Logic Controllers are sequential machines that
they execute the instructions indicated in the user program sequentially
stored in its memory, generating commands or control signals from
from the input signals read from the plant (application): upon detecting changes
in the signals, the automaton reacts according to the program until it obtains the
necessary exit orders. This sequence runs continuously for
get the updated control of the process.
The basic operating sequence of the automaton can be divided into three phases.
main ones:
Reading signals from the input interface.
Processing of the program for obtaining the control signals.
Writing signals on the output interface.
In order to optimize time, the reading and writing of the signals is done simultaneously.
for all inputs and outputs; Then, the inputs read from the modules of
The input is stored in a temporary memory (Image inputs). This is accessed by the
CPU during program execution, and as outputs are obtained, it
they are kept in another temporary memory (output image). Once executed the
complete program, these output images are all transferred at once to the
output module.
There are four generic operating modes of PLCs: RUN, STOP, ERROR and
POWER–ON

RUN: The PLC executes the user program as normal operating mode, it
birthday the cycle of functioning explained with prior

STOP or TERM: The PLC ignores the user program and executes its programs.
internal. In this mode, the user can monitor and/or program the PLC from
a PC

ERROR: The PLC stops the execution of the user program, as its
internal programs find a programming or hardware error.
As in the case of STOP mode, all outputs are deactivated and not allowed.
carry out the RUN mode until the problem that caused it is resolved
error

POWER-ON: This mode occurs from the moment the PLC is powered on;
this uses the POWER-ON mode to self-configure and perform checks
of the system state. Once the startup routines are completed, they assume according to the
conditions of the system, one of the other three nodes.
Exampe
l oftheoperan
tigmodesoftheDL05PLChasthreeoperan
tigmodes:mode
TERM,[Link](kilethsi exampe
l ),tisi omtied
POWER-ON mode, which will always be present in the PLC.

Mode Description
TERM (Termn
i a)[Link]
li be
l.
debuggn
i g, programmn
i g, and execuo
tin. The
dfierent ways and the changes n
i the
programmn
i g can be swtcihed to
through programming software.
RUN (ProgramExecuto
i n).TheCPUsi forced
wth
in
i theexecuo
tinmodefitheydonotexsit
errors.
STOP TheCPUsisrtuggnilgo
tso
tp.

2.7 Operating cycle.

The operation of the Programmable Logic Controller is, except for the initial process
what follows a Reset, of sequential and cyclic type, that is, the operations have
place one after another, and they continue to repeat while the automaton is
under tension.
Figure 2.7 schematically shows the sequence of operations performed
the automaton, with the operations of the operation cycle being the ones that are repeated

indefinitely.
The operating cycle is divided into two parts as can be observed in the
diagram scheme of the figure. called Initial Process and Operation Cycle.
Figure 2.7. Sequence of operations of an automaton.
Initial process:
As shown in the figure, before entering the operating cycle, the automaton
carry out a series of common actions, which mainly aim to initialize
the states of the same and check the hardware. These check routines,
included in the monitor ROM program, check:

The connection bus of the I/O units.


The battery level, if it exists
The connection of the system's internal memories
The connected external memory module, if it exists.

If any error is found during the check, the error LED would be activated and would remain
error code registered.

Once the connections have been verified, the internal variables are initialized:

The internal memory positions are turned OFF (except for the)
maintained or protected against voltage loss
All image I/O memory positions are cleared.
All counters and timers are cleared (except for those maintained or
protected against voltage losses.

Once the Initial Process has passed and no errors have appeared, the automaton enters
the Operation Cycle.

Operating cycle:
This cycle can be considered divided into three blocks:

Common Process
Execution of the program
Peripheral service
Common process:
In this first block, the cyclical checks of connections are carried out and of
program memory, protecting the system against:
Hardware errors (I/O connections, absence of program memory, etc.).
Syntax errors (impossible to execute program).

The cyclical connection check verifies the following points:


Power supply voltage levels
Battery status if it exists.
Connection buses with interfaces

The program memory check verifies its integrity and the


possible syntax and grammar errors:
Data maintenance, verified in the 'checksum'.
Existence of the END instruction for program termination
Correct jump structure and block nesting
Correct instruction codes

Program execution:
In this second block, the statuses of the entries and exits are consulted.
and the command or dispatch orders are prepared based on them.
The execution time of this block of operations is the sum of:
Access time to I/O interfaces.
Time for program scrutiny
And this, in turn, depends, respectively on:
Number and location of I/O interfaces.
Length of the program and type of CPU that processes it
Peripheral service:
This third and final block is only addressed if there is anything pending.
exchange with the outside. In case there is any, the CPU dedicates time to it.
limited, from 1 to 2ms, in handling the data exchange. If this time were not
sufficient, the service will be interrupted until the next cycle.

2.8 Runtime and real-time control.


The total time that the Programmable Logic Controller takes to perform a
operation cycle is called operation cycle execution time or more
simply cycle time 'Scan time'. This time depends on:
The number of I/O involved.
The length of the user program.
The number and type of peripherals connected to the automation device.

The total cycle times (real time) are then the sum of times.
employees in carrying out the various operations of the cycle
Self-diagnosis (Common process)
I/O Update (Program Execution)
Program execution. (Execution of the program)
Peripheral service. (Peripheral service)
2.9 Quick process elements.
There are three types of activities that require quick responses from the automaton:

Execution of subroutines or programs at intervals shorter than those that


it allows the overall cycle time of the automaton.
High-frequency input pulse reading.
Detection of very short duration signals, shorter than the cycle time.

Each of the previous circumstances poses different problems that compel


also to look for different solutions in the automaton.
Thus, for the first point, reduction of the response time for a signal
determined, the execution of the program block that controls can be ordered
independently of the rest of the cycle, starting this;
By means of a periodic signal (to reduce the cycle time)
Through an external interrupt signal (To obtain answers
fast)

The elements of the Fast Process are as follows:


Alarm processing (external interruption)
Processing periodic routines (timed interruption)
High-frequency impulse reading
Detection of short duration signals

2.10 Peripheral and programming devices.

La programación de un PLC se realiza mediante periféricos del autómata, como


they can be a PC, a programming console, an EPROM recorder, among other things
other devices. The program that has been used the most so far has been the
SYSWIN in its different versions, but new ones are starting to be used.
more comprehensive programs, like the CX-PROGRAMMER.
The programming of an automaton begins with the execution of a GRAFCET or
CONTROL DIAGRAM of the process to be controlled and based on this GRAFCET
we will create the RELAY DIAGRAM or CONTACT SCHEME, which
it allows a logical representation of control similar to systems
electromechanical. (The above will be examined in depth in unit 3)

PLC programming console

Programming with PC

You might also like