You are on page 1of 27

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.
EEPROM or Electrically Erasable Programmable Read Only Memory is usually an add-on
memory module that is used to back up the main program in CMOS RAM of the processor. In
many cases, the processor can be programmed to load the EEPOM's program to RAM if RAM is
lost or corrupted.
Input Module
There are many types of input modules to choose from. The type of input module used is
dependent upon what real world input to the PLC is desired. Some examples of inputs are limit
switches, electric eyes, and pushbuttons. DC inputs, such as thumbwheel switches, can be used
to enter integer values to be manipulated by the PLC. DC input cards are used for this
application. Since most industrial power systems are inherently noisy, electrical isolation is
provided between the input and the processor. Electromagnetic interference (EMI) and Radio
Frequency Interference (RFI) can cause severe problems in most solid state control systems. The
component used most often to provide electrical isolation within I/O cards is called an optical
isolator or optocoupler. The wiring of an input is not complex. The object is to get a voltage at a
particular point on the card. Typically there are 8 to 32 input points on any one input module.
Each point will be assigned a unique address by the processor. Analog input modules are special

input cards that use analog to digital conversion (A to D) to sense variables such as temperature,
speed, pressure, and position. The external device normally is connected to a controller
(transducer) producing an electrical signal the analog input card can interpret. This signal is
usually 4 to 20 Ma or a 0 to 10 volt signal.
Output Module
Output modules can be for used for ac or dc devices such as solenoids, relays, contractors, pilot
lamps, and LED readouts. Output cards usually have from 6 to 32 output points on a single
module. The output device within the card provides the
connection from the user power supply to the load. Usually silicon controlled rectifiers (SCR),
triac, or dry contact relays are use for this purpose. Individual outputs are rated most often at 2 to
3 amperes. Output cards, like input cards have electrical
isolation between the load being connected and the PLC. Analog output cards are a special type
of output modules that use digital to analog conversion (D to A). The analog output module can
take a value stored in a 12 bit file and convert it to an analog signal. Normally this signal is 0 -10
volts dc or 4 to 20 Ma. This analog signal is often used in equipment such as motor operated
valves and pneumatic position control devices.

PLC programs are made up of a combination of the above "gates" together with inputs, outputs,
timers, counters, internal memory bits, analog inputs, analog outputs, mathematical calculations,
comparators etc. We will now look closer at some of these and the operation of the PLC.

INPUTS

These are the physical connections from the real world to the PLC. They can be limit switches,
push buttons, sensors, anything that can "switch" a signal on or off. The voltage of these devices
are usually, but not always, 24 Volt DC. Manufacturers make inputs that can accept a wide range
of voltages both ac and dc. It should be remembered that an input will be ON, "status 1", when
the voltage is present at the input connection and OFF, "status 0", when the voltage is no longer
present at the input connection.

OUTPUTS

These are the connections from the PLC to the real world. They are used to switch solenoids,
lamps, contactors etc on and off.
Again they are usually 24 Volt DC, either relay or transistor, but can also be 115/220 Volt AC.

INTERNAL MEMORY BITS (RELAYS)

These so called relays only exist in the PLCs memory, they are used to remember certain "states"
or functions that have been performed. They react exactly like ordinary relays and can be on, off
or latching. Manufacturers of PLCs also pre-program certain internal relays with special functions
such as, always on; always off; on whilst the PLC is powering up; on for the first scan of the
program; on if there is an error. For details of other pre-programmed relays you will have to check
the manual for the PLC you are going to use.

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.

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.

ANALOG

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).

THE SHIFT REGISTER

.
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.
1. 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.
2. 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.
3. 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.

Whilst we have covered some of the basics on PLCs on these pages it is impossible to cover
everything. We hope that it has given you plenty to think about and if you have any questions or
require any help then please Email us, we will try and help.

If you want anything included on these pages then let us know.

Remember
PLCs are interesting.
You are in control.
They will "do" what you want them to.
Think OPERATOR safety when writing a program followed by machine safety.

****
Please feel free to contact us with any programming requirements.
We program the following makes of PLC.
SIEMENS
OMRON
PILZ
KM
MITSI
SIEMENS & OMRON HMIs.

You might also like