D02 Hardware
D02 Hardware
2
Parts of PLC
• Power supply
• Central Processing unit
• Input-Output Modules
• Communication port
• Memory
• Programming Device
3
Internal Architecture of a PLC
Address Bus
Programme
Panel
Control Bus
C
User L System Data Input /
Battery Program CPU O ROM RAM
output
C unit
RAM
K
Data Bus
Driver
Inputs Opto-Coupler Buffer Latch Interface
Drivers
Outputs
4
Central Processing Unit (CPU)
Central Processing Unit or Processor is the unit containing the microprocessor.
This unit interprets the input signals and carries out the control actions according to
the programme stored in its memory, communicating the decisions as action signals
to the outputs.
The memory unit is used in the CPU for storing the PLC program and other data
involving for monitoring and controlling the industrial system.
PLC is usually recommended for repetitive processes, which means it will repeat
scanning the process (IO’s) again and again. It is called SCAN TIME.
5
Processor Scan
The process of reading the inputs, executing the program, and updating the outputs
is known as the scan.
The scan time is the total time the PLC takes to complete the program and I/O update
scans. The program scan time generally depends on two factors:
• Amount of memory taken by the control program
• Type of instructions used in the program
6
Processor Scan
A processor is able to read an input as long as the input signal is not faster than the
scan time.
7
Power Supply Unit
The Power Supply Unit (PSU): The power supply unit is needed to convert the mains
AC voltage (230V r.m.s.) to low DC voltage (5V) necessary for the processor and the
circuits in the input and output interface modules.
In fixed or compact
type PLC, we can
connect the power
supply to the inbuilt
positive and negative
terminals.
In modular type PLC, power
supply modules are provided with
each rack unit where CPU, IO
modules, and any other modules
will be installed.
8
IO modules
IO modules are common to all PLC types, which are used to make communication
between CPU and field devices.
9
Communications Interface
The communications interface is used to
receive and transmit data on communication
networks from or to other remote PLCs.
It is concerned with such actions as device
verification, data acquisition, synchronisation
between user applications and connection
management
Supervisory System
Communications Network
PLC 1 PLC 2
10
Memory unit
Memory unit is where the programme containing the control actions to be exercised
by the microprocessor is stored and where the data is stored from the input for
processing and for the output.
The executive memory: is a collection of permanently stored
programs.
• Read-only memory (ROM) is designed to permanently store a
fixed program that is not alterable under ordinary
circumstances.
The application memory: provides a storage area for the user-
programmed instructions that form the application program.
• Random-access memory (RAM), often referred to as read/write
memory (R/W), is designed so that information can be written
into or read from the memory storage area.
This is where information is stored on states of input and
output devices and the values of timers and counters and other
internal devices.
(This is sometimes called the register table or data table).
11
Memory unit
PROM (Programmable ROM): non-volatility, a permanent storage backup for some
type of RAM.
EPROM (Erasable PROM): it’s the same as ROM but the stored data can be edited,
removed, and store new changes by exposing it to ultraviolet light.
EEPROM (Electrically EPROM): provides permanent storage for the program and can
be easily changed with the use of a programming device. But editing of memory is
limited by several times.
Flash EEPROM: It looks like an EEPROM, but it can be editable for unlimited numbers
of times. It works as a standalone memory storage device like a USB pen drive.
12
Memory structure
The smallest unit of information in a digital system is known as a "bit" (for "binary
digit"). A bit stores one of two possible states, either a "0" (false or not true) or "1"
(true).
A light switch is an example of a "binary" system with only two states. The light switch
determines either a "light on" or a "light off“ state, and this "value" can be stored in one bit.
The digital value of the light switch answers the question: "Is the light on?" If the light is
switched on ("true"), then the value is 1. If the light is switched off ("false"), then the value
is 0.
13
Memory Areas of Siemens PLC
Load Memory is a non-volatile storage memory for the user program, data, and
configuration. Therefore, when a program is downloaded to the CPU, it will first stored in
the load memory area
• Internal Load Memory Memory capacity: 1K unit = 1024 words
• External Load Memory
Working Memory: is volatile storage for some elements of the user program while executing
the program. Work memory is like a RAM of a computer.
The CPU copies some elements of the user project from load memory into work
memory. This storage area is volatile and lost on power failure and is restored when
CPU power is restored.
System Memory: part of the memory where it can store the addressing part of the PLC
program like Inputs, Outputs, Timers, Counters, and Bit memory
Address Bus
Programme
Panel
Control Bus
• Data bus
• Control bus User C
L System Data Input /
• Address bus Battery Program CPU O
C
ROM RAM output unit
Data Bus
15
Buses
Data Bus
• The data bus carries the data used in the processing done by the CPU.
• A microprocessor termed as 8-bit, has an internal data bus that can handle 8-bit
numbers (words).
• It can thus perform operations between 8-bit numbers and deliver results as 8-bit
values
Address Bus
Programme
Panel
Control Bus
User C
L System Data Input /
Battery Program CPU O
ROM RAM output unit
C
RAM
K
Data Bus
16
Buses
Address Bus
• The address bus is used to carry the addresses of memory locations.
• Each word is located in memory
• Every memory location is given a unique address so that the CPU ‘knows’ where to
look (read) a particular word or to store (write) a particular word.
• If the address bus consists of 8-lines, then there can be 28 = 256 addresses
• If the address bus consists of 16-lines, then there can be 216 = 65,536 addresses
Address Bus
Programme
Panel
Control Bus
User C
L System Data Input /
Battery Program CPU O
ROM RAM output unit
C
RAM
K
Data Bus
17
Buses
Control Bus
The control bus carries the signals used by the CPU for control,
For example it might be used to inform a memory device whether it is to receive
data from an input or output.
It is also used to carry timing signals used to synchronise actions
Address Bus
Programme
Panel
Control Bus
User C
L System Data Input /
Battery Program CPU O
ROM RAM output unit
C
RAM
K
Data Bus
18
Buses
I/O System Bus
The system bus is used for communications between the input /output ports and the
input/output unit
Address Bus
Programme
Panel
Control Bus
User C
L System Data Input /
Battery Program CPU O
ROM RAM output unit
C
RAM
K
Data Bus
19
PLC Siemens S7-1200
20
Siemens S7-1200 CPU 1212 AC/DC/RLY
S7-1200 CPU 1212 AC/DC/RLY 3 types of output:
- Relay (AC/DC)
Power supply/ Input/ Output - Transistor relay (DC)
- Triag relay (AC)
21
Siemens S7-1200 CPU 1212 AC/DC/RLY
22
Operation mode of CPU
The CPU has three modes of operation: STOP mode, STARTUP mode, and RUN
mode. Status LEDs on the front of the CPU indicate the current mode of operation
In RUN mode, the scan cycle In STOP mode, the CPU is In STARTUP mode, the CPU
is executed repeatedly. not executing the executes any startup logic
Interrupt events can occur program, and you can (if present). Interrupt
and be processed at any download a project events are not processed
point within the program during the startup mode
cycle phase.
23
How Processor Works?
24
Data Type Supported by S7-1200
Few are some of the widely used data type supported in S7-1200
25
Memory area in S7-1200
Memory Area Description
I The CPU copies the state of the physical inputs to I memory at the
Process Image Input beginning of the scan cycle.
Q The CPU copies the state of Q memory to the physical outputs at
Process Image Output the beginning of the scan cycle.
The user program reads and writes the data stored in M memory.
M Any code block can access the M memory. You can configure
Bit memory addresses within M memory to retain the values of the data after a
power cycle
Whenever a code block is called, the CPU allocates the temporary,
L or local, memory (L) to be used during the execution of the block.
"Temp" memory When the execution of the code block finishes, the CPU reallocates
the local memory for the execution of other code blocks.
Use the DB memory for storing various types of data, including
intermediate status of an operation or other control information
DB parameters for FBs, and datastructures required for many
Data block instructions such as timers and counters. You can specify a data
block to be either read/write or read only. You can access data
block memory in bits, bytes, words, or double words.
26
Activity: Read the PLC Datasheet
The datasheet of a PLC covers almost every feature that the PLC can provide.
Not all the information inside the datasheet will be important to you, that will depend
on whether you are a PLC programmer or an installation engineer.
27