You are on page 1of 13

PLC Introduction

Programmable Logic Controllers (PLCs), also referred to as programmable controllers,


are in the computer family. They are used in commercial and industrial applications. A
PLC monitors inputs, makes decisions based on its program, and controls outputs to
automate a process or machine. This course is meant to supply you with basic
information on the functions and configurations of PLCs.
PLCs consist of input modules, a Central Processing Unit (CPU), and output modules.
An input accepts a variety of digital or analogue signals from various field devices
(sensors) and converts them into a logic signal that can be used by the CPU. The CPU
makes decisions and executes control instructions based on program instructions in
memory. Output modules convert control instructions from the CPU into a digital or
analogue signal that can be used to control various field devices (actuators). A
programming device is used to input the desired instructions. These instructions
determine what the PLC will do for a specific input. An operator interface device allows
process information to be displayed and new control parameters to be entered.
Prior to PLCs, many of these control tasks were solved with contactor or relay controls.
This is often referred to as hard-wired control. Circuit diagrams had to be designed,
electrical components specified and installed, and wiring lists created. Electricians
would then wire the components necessary to perform a specific task. If an error was
made the wires had to be reconnected correctly. A change in function or system
expansion required extensive component changes and rewiring.
The same, as well as more complex tasks, can be done with a PLC. Wiring between
devices and relay contacts is done in the PLC program. Hard-wiring, though still
required to connect field devices, is less intensive. Modifying the application and
correcting errors are easier to handle. It is easier to create and change a program in a
PLC than it is to wire and rewire a circuit.
PLC Advantages
Smaller physical size than hard-wire solutions
Easier and faster to make changes
PLCs have integrated diagnostics and override functions
Diagnostics are centrally available
Applications can be immediately documented
Siemens Step 7 PLC
Various Varco control systems uses the Siemens Step 7 300 series PLC (AR4000,
TDS-4S, Electronic Driller). The complete system consists of the 315-DP CPU, with
local Inputs and Outputs, and remote Inputs and Outputs through the PROFIBUS DP
network.
What is PROFIBUS ?
PROFIBUS is a serial fieldbus used primarily as the communication system for
exchange and information between automation systems and distributed field devices.
Thousands of successful applications have provided impressive proof that use of
fieldbus technology can save up to 40% in costs for cabling, commissioning and
maintenance as opposed to conventional technology. Only two wires are used to
transmit all relevant information (i.e. input and output data, parameters, diagnostic data,
programs and operating power for field devices). In the past, incompatible vendor-
specific fieldbuses were frequently used, virtually all systems in design today are open
standard systems, the user is no longer tied to individual vendors and is able to select
the best and most economical product from a wide variety of products.
PROFIBUS specifies the technical and functional characteristics of a serial fieldbus
system with which decentralised digital controllers can be networked together from the
field level to the cell level, Profibus distinguishes between master and devices and slave
devices.
Central Processing Unit 315-2 DP
Varco P/N = 122627-03
Mode Selector
RUN-P Run program mode
The CPU scans the user program, the key cannot be taken out in this position. Programs can be
read of out and loaded into the CPU with a programming device.
RUN Run mode.
The CPU scans the user program, the key can be removed in this position to prevent anyone
changing the operating mode. Programs in the CPU can be read out with a programming device,
but the program in the load memory cannot be changed.
STOP Stop mode.
The CPU does not scan the user program, the key can be removed to prevent anyone changing
the operating mode. Programs can be read of out and loaded into the CPU with a programming
device.
MRES Reset CPU memory
Momentary contact position of the mode selector switch for resetting the CPU memory when a
special sequence is carried out.
Status and Fault LEDs
SF (red) System error fault
Lights up in the event of: - (a) Hardware faults, (b) Firmware errors, (c) Programming errors, (d)
Parameter assignment errors, (e) Arithmetic errors, (f) Timer errors, (g) Defective memory card,
(h) Battery failure or no back-up on POWER ON, (i) I/O fault error.
Note:- You must use a programming device and read out the contents of the diagnostic
buffer to determine the exact nature of the error/fault.
BATF (red) Battery fault
Lights up if the battery defective, not inserted or discharged.
5VDC (green) 5 VDC supply for CPU
Lights up if the internal 5 VDC supply is OK.
RUN (green) Run mode.
Flashes at a CPU restart for at least three seconds, during the CPU re-start the STOP LED also
lights up, when the STOP LED goes off and the RUN LED is on constant, the outputs are
enabled.
STOP (yellow) Stop mode.
Lights up when the CPU is not scanning the user program. Flashes at one-second intervals when
the CPU requests a memory re-set.
Display Elements for PROFIBUS LEDS
SF DP BUSF Description
Off Off Configuration data OK, all configured slaves are
addressable.
On On Bus Hardware fault, DP interface fault
Possible Remedies:- Check the bus cable for short or interruption, evaluate the
diagnostic data, reconfigure or correct the configuring data.
On Flashes Station failure or at least one of the configured slaves
cannot be addressed.
Possible Remedies:- Check to make sure that the bus cable is connected correctly
to the CPU or that the bus is not interrupted. Wait until the
CPU has completed its power up, if the LED does not stop
flashing, check the DP slaves or evaluate the diagnostic data
for the DP slaves.
On Off Missing or incorrect configuring data.
Possible Remedies:- Evaluate the diagnostic data, reconfigure or correct the configuring data.
Step 7 CPU315-DP Back-up battery
Varco P/N = 122627-26
The Back-up battery for the CPU315-DP should only be replaced with the Power On, to
prevent the loss of data from the internal user memory, and to keep the clock of the
CPU running.
Siemens recommend that the Back-Up battery be replaced at yearly intervals.
When not in use the Back-Up batteries should be stored in a cool dry place, and can be
stored for five years.
Flash EPROM Memory Card
Installing the Memory card into the CPU.
Varco P/N 122627-24
The purpose of the Memory Card is to store the user program, this will then be retained
when the CPU is powered down, even if a back-up battery has not been installed. With
the 315 - 2DP CPU, the Memory Card can be written to directly when installed as above
in the CPU.
The following procedure should be used for writing to the Flash Card when inserted in
the CPU :-
1. Power down the CPU and insert the Flash card.
2. Power up the CPU.
3. Delete the CPU using the key switch.
4. In the OFFLINE mode, download all the Blocks and System Data to the RAM.
5. Once all Blocks and Data are loaded, do a compare ONLINE and OFFLINE,
this should show that there are no differences (except for DBs).
6. Still in the OFFLINE mode, do a Save RAM to ROM.
This should then display the message that this has been carried out satisfactory.
CPU Memory Reset
The CPU memory must be reset before a transfer of a complete user program to the
CPU, or if the CPU requests a MRES with its STOP LED flashing at one second
intervals, possible reasons for this are as follows:-
1. Wrong memory card has been plugged into the CPU.
2. RAM error in CPU.
3. Working memory too small, that is not all blocks of the user program on a
memory card could be loaded.
4. Attempt to load blocks with errors, for example if a wrong command has been
programmed.
With the 315-2 DP CPU and 5V FEPROM plugged in, the CPU requests a memory
reset.
Resetting the CPU Memory using the Mode Selector.
To reset the CPU using the Mode selector the following procedure should be carried
out:-
1. Turn the key to the STOP position
2. Turn the key to the MRES position and hold it in this position for about three
seconds, until the STOP LED lights up again.
3. Within three seconds, you must turn the key back to the MRES position and
hold it in this position until the STOP LED flashes, when the CPU has
completed the reset, the STOP LED stops flashing and remains lit.
The CPU has then performed the Reset.
Typical Power Supply Module
Above is an example of a typical Power Supply module that is used to power the
24VDC part of the Siemens step 7 PLC circuit.
Basic Circuit Diagram
Typical Digital Output module SM 322
Module front view and block diagram of relay outputs
The relay output module above is of typical type that is used for the Siemens Step 7 PLC. This
example is a Relay output module with 8 output points, isolated in groups of two.
Typical Digital Input Module SM 321
Module front view and block diagram of digital inputs
The module above is a typical example of the digital input module used with the
Siemens Step 7 PLC system, this example has 16 input points, isolated in groups of 16.
Typical Varco Step 7 PLC Program Structure
The above Step 7 program is a typical example of how Varco structure their programs.
The program is split into Functions (FC), which are initially called from the Organisation
Block (OB). There are two Program Block types, they are User Blocks and System
Blocks.
User Blocks are the areas provided for managing the program code and the data for the program.
Based on the requirement of the process, the program can be structured with the various options
for user blocks, some of these blocks can be executed cyclically, while others can be executed
only when needed. User blocks are also referred as Program blocks.
System Blocks are pre-defined function or function blocks integrated in the operating system on
the CPU, these blocks do not occupy any additional space in the user memory. System blocks are
called from the user program level, these blocks have the same interface, same design and the
same number in the entire system.
The User Blocks types that are used are Organisation block, Functions and Data blocks.
Organisational Blocks (OB) form the interface between the S7 CPU and the user program, the
program for the AC Top drive is stored in various blocks and uses OB1 to call these blocks when
needed.
Functions (FC) are logic operation blocks to which no memory area is assigned, an FC does not
need an instance data block, temporary variables are stored in the local stack until the Function is
concluded, and are lost when the FC finishes executing.
Data Blocks (DB) are permanently assigned areas in which data or information is stored that
another function collected, they are read/write areas that can be loaded in the CPU as part of the
program.
The System Block that is used in the program is the System Functions (SFC).
A System Function is a pre-programmed, debugged function that is integrated in the S7 CPU,
some of these tasks supported by these blocks are setting parameters for modules, data
communication, copying functions etc. SFCs can be called from the program without being
loaded as part of the program, and do not have to be assigned to a data block.
When the program is structured into Blocks, it must be accessed by calling one block from
another. As seen in the diagram above, when the program calls the second block, the called block
then executes all of its instructions, once the called block has completed execution of its
instructions, the calling block resumes the execution of its program at the network following the
Call instruction.
Choosing The Correct Operating mode
Step 7 allows you to examine, modify and write to programs in three different ways,
these ways are Direct, Offline and Online.
DIRECT
This mode is ideal for maintenance, in this mode you can directly monitor programs without
referencing to a project (no program loaded into Step 7). The project can be can be modified or
simply monitored to gather information about the system.
OFFLINE
Offline mode is best suited to offline programming, i.e. when the CPU is not present or
when the programming unit is not connected to the CPU. In this mode, blocks can be
written and then transferred (downloaded) to the CPU, downloading is obviously only
possible if the MPI cable is connected to the system. The program can also be
monitored, providing the program in the programming unit is the same as the one in the
CPU.
ONLINE
Online mode is the suited to programming with the programming unit connected to the CPU, if
the MPI cable is not present, the link will be automatically aborted. Programming changes will
however only take place when the appropriate ICON has been selected. To avoid differences
between the program on the disk and the program in the CPU (time stamp conflict), it is essential
to STORE TO DISK first and then DOWNLOAD to the CPU. Monitoring in this state is easier
as you are looking at what is at present in the CPU.
When working with Step 7, it is essential that only one of these modes is selected at any
one time, Step 7 will not allow to have blocks open in the Offline and online modes
together, one of the modes will have to be closed down before continuing.

You might also like