You are on page 1of 16

THE PLC (A brief history and description of the PLC).

PLCs were invented in the 60/70's for the automotive manufacturing industry. Since this time, they have
developed into one of the most versatile tools used for industrial automation. A working knowledge of PLCs and
other microprocessor based control systems are critical to technical personnel who are staying current with
technology in industry.
Programmable Logic Controllers or PLC are the hub of many manufacturing processes. These microprocessor
based units are used in processes as simple as boxing machines or bagging equipment to controlling and tracking
sophisticated manufacturing processes. They are in virtually all new manufacturing, processing and packing
equipment in one form or another. Because of their popularity in industry, it becomes increasingly more
important to learn skills related to these devices. Click on the buttons to learn more about industrial
automation and this invaluable tool.
The microprocessor or processor module is the brain of a PLC system. It consists of the microprocessor,
memory integrated circuits, and circuits necessary to store and retrieve information from memory. It also
includes communications ports to other peripherals, other PLC's or programming terminals. Today's processors
vary widely in their capabilities to control real world devices. Some control as few as 6 inputs and outputs
(I/O) and others 40,000 or more. One processor can control more than one process or manufacturing line.
Processors are often linked together in order to provided continuity throughout the process. The number of
inputs and outputs PLCs can control are limited by the overall capacity of the PLC system hardware and
memory capabilities. The job of the processor is to monitor status or state of input devices, scan and solve the
logic of a user program, and control on or off state of output devices.
RAM or Random Access Memory is a volatile memory that would lose it's information if power were removed..
This is why some processor units incorporate a battery back up. The type of RAM normally used is CMOS or
Complementary Metal Oxide Semiconductor. CMOS RAM is used for storage of the user's program (ladder
logic diagrams) and storage memory.
ROM or Read Only Memory is a non-volatile type of memory. This means you don't need an external power
source to keep information. In this type of memory, information can be read, but not changed. For this reason
the manufacture sometimes calls this firmware. It is placed there for the internal use and operation of
processor units.
ANALOG (Analog Inputs and Outputs).
Analog inputs and/or outputs can be 0 to 10V; -10 to +10V; -5v to +5v; 0 to 20mA and 4 to 20mA.
The analog signals are sent to the PLC input where they are read in and converted into a numerical value.
Analog outputs are numerical values in the PLC which are sent to the outputs where they are converted into a
variable signal (volts or mA).The "raw" numerical value from an analog input signal can be processed further for
use within the user program. This raw value is usually scaled before such use to make it easier to process. i.e. a
20mA max signal maybe converted into 1024 units but in the real world 20mA may equate to, say, 600 degrees.
It can be seen that if the actual input was 13mA to use the un-scaled value to set min/max alarms in the PLC
would be difficult; therefore the user program firsts "scales" the raw values into something more sensible.
For example a sub-routine could scale the raw value to, 1024 units = 600 units, to set min/max alarms now
would be easier. i.e.. 300 units = 300 degrees.
E.G.
Process = 0 to 600 degrees
Input = 0 to 20mA (0 degrees = 0 units; 600 degrees = 1024 units)
Raw value = 0 to 1024 units.
Scale = 0 to 600
The sub routine would have to carry some maths to perform the following.
MAX SCALED VALUE / MAX RAW VALUE * ACTUAL RAW VALUE
Max Scaled Value = 600
Max Raw Value = 1024
Actual Raw Value = 700 (variable)
Using the above equation the scaled value would be 410.16 (degrees)
If the actual raw value was 1000 the scaled value would be 585.94 (degrees)
If the actual raw value was 200 the scaled value would be 117.18 (degrees)
A file of raw values against mA signal is available, in Excel format, for down- load from the download page (mA
to Units).
COMMUNICATIONS (PLC Communications).
There are several methods to communicate between a PLC and a programmer or even between two PLCs.
Communications between a PLC and a programmer (PC or Hand held) are provided by the makers and you only
have to plug in a cable from your PC to the programming port on the PLC. This communication can be RS232;
RS485 or TTY.
Communications between two PLCs can be carried out by dedicated links supplied/programmed by the makers
(RS232 etc) or via outputs from one PLC to the inputs on another PLC.
This direct link method of communication can be as simple as, if an output on the first PLC is on then the
corresponding input on the second PLC will be on and then this input is used within the program on the second
PLC.
If a word of input/outputs (16 bits) are used then numerical data can be transferred from one PLC to the
other (refer back to the section on numbering systems).
There are many other methods of communication between PLCs and also from PLC to PC. Please refer to the
manuals supplied with the PLC that you are using for full details on communications.
COUNTERS (Counters and their use).
COMPARATORS (Various Comparators and their use).
DATA (How PLC's Store Data).
Data areas are internal registers where information may be stored. Information such as math
calculation/results can be stored in this data area as well as messages etc. The data areas are usually battery
backed so that in the event of a power failure the information stored will be available again once the PLC has
powered up.
In Siemens PLCs there are 256DW (data words) in each DATA BLOCK of which there can be 256 DATA
BLOCKS. In Omron PLCs this data area is called the DM area. Reference should be made to the manual for the
make PLC you are using to see what data area is available to use!
THE PLC
Now that we have a basic understanding of the workings of a PLC and some of the numbering systems used we
can look at the operation of PLCs.
A PLC operates by continually scanning the program and acting upon the instructions, one at a time, to switch
on or off the various outputs. In order to do this the PLC first "looks" at all the inputs and remembers their
states ( i.e.. "1" or "0" / on or off) this information is then stored in memory. The PLC then scans the program
instructions and decides if an output should be on or off BUT, and this is important to remember, the physical
output is NOT turned on immediately. When the PLC has finished scanning the programmed instructions it will,
finally, turn on the required outputs. This is called updating the process output image.
At this point the PLC then checks its own operating system and if everything is ok it then goes and checks the
states of the inputs and starts all over again.
This is program scanning and the delay is called the program scan time.
From the above statement it should be seen that there is a delay from when an input is turned on; the program
scanned and then a physical output being turned on or off. As the delay is only mS it is not usually a problem
unless you are using the PLC in a high speed process. However it should be remembered that in a PLC with many
thousand I/O an input could turn on and then off before the PLC has finished scanning the programmed
instructions.
This could result in an output coming on for one or two scans when in fact it should be off.
GATES (AND & OR Gates)
NUMBERING SYSTEMS (PLC Numbering Systems)
PLC PROGRAMMING SCAN (How PLC's SCAN the program).
PULSE (How to Generate a Pulse/Edge trigger in S5).
SET & RESET (Set and Reset of an Output).
SHIFT REGISTER (Shift Registers).
What is a "SHIFT REGISTER"?
In many applications it may be necessary to store the status of events that have previously happened. If only
one or two events are required to be monitored then it would simply be a matter of using "FLAGS" or
"INTERNAL MARKERS".
However it might be desirable to store the status of many events and this is where the Shift Register would
be used.
The Shift Register will usually have a minimum of three "controlling" inputs.
DATA.
This input is the DATA that needs to be monitored and can be
stored as "BIT" information. In some cases it can be stored as
"BYTE or WORD" information.
CLOCK.
This input controls the "DATA" input. When the Shift register
"sees" the rising edge of this input (i.e.: the Clock input goes
from status "0" to status "1") it will transfer the status of the
Data input into the Shift Register.
RESET.
This input will clear all the information inside the Shift Register to 0.
The shift register goes by many names. SFT (ShiFT), BSL (Bit Shift Left), SFR (Shift Forward Register) are
some of the
common names.
These registers shift the bits to the left. BSR (Bit Shift Right) and SFRN (Shift Forward Register Not) are
some examples of instructions that shift bits to the right.
It should be noted that not all manufacturers have shift registers that shift data to the right but most all do
have left shifting registers.
STATEMENT LIST (Programming in STATEMENTS instead of LADDER).
TIMERS (Creating and using Time delays).
PROGRAMMING EXAMPLES (Other Programming Examples).
Water Pump 1 (By Gerrit) A water pump control system. (txt)
x02 c0
-----| |---------------------(SET)------
x02 c0
-----| / |---------------------(RST)------
x01 c0 c1
-----| |-----| |-----------(SET)------
x01 c1
-----| / |---------------------(RST)------
c1 y0
-----| |---------------------(OUT)------
_______
-------------------| End |--------------
-------
x01 = Sensor for high water level
x02 = Sensor for low water level
c0 = Water level low variable
c1 = Indicates that the we whant to fill the tank
y0 = the actual motor that fills the tank
Bit Sate 0 0 1 0 1 1
--x01--x02- --x01--x02- --x01--x02-
| | || | | || | | ||
|''|''''|'| | | || | | ||
| || |'''''''|'| | ||
| | | | |'''''''''|
|_________| |_________| |_________|
Process State 1 2 3
In process state 1 the waters sensors indicate that there are water in the tank by being of. In process state 2
sensor x01 tells the plc that it is not touching water we don't want to fill the tank yet. In process state 3 both
x01 and x02 tells the plc that they are not touching any water. Now we want to fill up the tank line 3 sees that
x02 is on an that the water level low variable is on, so it requestss for the tank to be filled by setting variable
c1 to on line 5 puts the fill motor on. As the water fills sensor x02 tells the PLC that it sees water and turns
off the water level low variable, the tank still fills up despite of line 3, because we set the variable c1. After
'n while the sensor x01 sees water an turns the Fill Tank variable c1 off. And this stops the motor in line 5.
Water Pump 2 (By Gerrit) A water pump control system (improved). (txt)
x02 c0
-----| |---------------------(SET)------
x02 c0
-----| / |---------------------(RST)------
x01 c0 c2 c1
-----| |-----| |--| |----(SET)------
x01 c1
-----| / |---------------------(RST)------
c1 y0
-----| |---------------------(OUT)------
c11 x02 c2
-----| |-----| / |-----------(RST)------
c2 ________
-----| / |------------------ | TMR |---
| T0 |
| K500 |
--------
T0 c2
-----| |--------------------(SET)-------
| T0
---(RST)-------
c2 c11
-----| |--------------------(RST)-------
_______
-------------------| End |--------------
-------
x01 = Sensor for high water level x02 = Sensor for low water level
c0 = Water level low variable c1 = Indicates that the we whant to fill the tank
c2 = Dump Done
c11 = Dump valve
y0 = the actual motor that fills the tank
Bit Sate 0 0 1 0 1 1
--x01--x02- --x01--x02- --x01--x02-
| | || | | || | | ||
|''|''''|'| | | || | | ||
| || |'''''''|'| | ||
| | | | |'''''''''|
|_________| |_________| |_________|
Process State 1 2 3
The Dump Process waits for the dump valve to open, this is controlled by the PLC program, it also checks to
see that there is some water to dump. The dump process is set on a timer so as you can see in rung 7 it waits
for 50 seconds then stops dumping. Afterwards it sets the Dump Done variable and resets the Dump Valve in
rung 9. In order to make sure that the tank only fills when we finished dumping we put in the 'dump done
switch' in rung 3.
Garage Door 1 (By Gerrit) A garage Door opening/closing system. (txt)
-|---------------|- -|-------------|-
X03 | | X03 | Garage |
Bit Status 1 | |\| | 1 | |\| Door |
--- | | --- | |
| Garage | |_____________|
| Door |
X04 | | X04
Bit Status 1 | |\|_______________| 0 | |\
--- ---
Open Button = X00 Top Proximity Sensor = X03
Close Button = X01 Bottom Proximity Sensor = X04
Stop Button = X02 Motor Up = Y0
Motor Down = Y1
Open = V00
Close = V01
Stop = V02
V00 X03 V02 V01 Y0
---| |---| |---| / |---| / |----------(OUT)---
V01 X04 V02 V00 Y1
---| |---| / |---| / |---| / |----------(OUT)---
X02 V02
---| |----------------------------------(SET)---
| |
| Y0 Y1 |
-| |--| |-
X00 V00
---| |----------------------------------(SET)---
|
| V01
|--(RST)---
|
| V02
|--(RST)---
X01 V01
---| |----------------------------------(SET)---
|
| V00
|--(RST)---
|
| V02
|--(RST)---
_______
----------------| END |--------------------------
There are two things that must happen, the door must close and open. The conditions when the door is opening
are: The door can only open when the top proximity sensor is on, the stop variable is off and the door is not
closing indicated by the V01 variable The door can only close when the bottom proximity sensor is off, the
stop variable is off and the door is not opening.These criteria are attended to in lines 1 and 2. Then we need
two put in a line to stop the door anywhere, this is done in line 3, there is also a by pas line for protection, so
that if the sensors fail in any why we will not burn out the motor. Line 4 deals with the open button, if it is
pushed it requests the door to open by setting the V00 variable, and resets the close door variable witch stops
the door if it is moving down and resets the stop variable. Line 5 handles the close button, by requesting the
door to close in setting the V01 variable, and stops the door by resetting the open variable, and also resets the
stop variable.

You might also like