PLC PROGRAMMING
PLC Programming Languages
The standard IEC 61131 (International Electro technical
Commission) was established to standardize the multiple
languages associated with PLC programming by defining the
following five standard languages:
• Ladder Diagram (LD) —a graphical depiction of a process with rungs of
logic, similar to the relay ladder logic schemes that were replaced by PLCs.
• Function Block Diagram (FBD) —a graphical depiction of process flow using
simple and complex interconnecting blocks.
• Sequential Function Chart (SFC) —a graphical depiction of interconnecting
steps, actions, and transitions.
• Instruction List (IL) —a low-level, text-based language that uses mnemonic
instructions.
• Structured Text (ST) —a high-level, text-based language such as BASIC, C, or
PASCAL specifically developed for industrial control applications.
Ladder Diagram and Programming:
Load: The load (LD) instruction is
a normally open contact
A Load (contact) symbol
Load Bar: The Load Bar instruction is a normally closed contact.
A Load Bar (normally closed contact) symbol
An OUT (coil) symbol
Out :The Out instruction is sometimes also
called an Output Energize instruction. The
output instruction is like a relay coil
matrix limitation diagram for a typical PLC.
A maximum of seven parallel lines and 10 series contacts
per rung is possible.
Addressing format
Logic elements
Programming a PLC :
➢In order to create or change a program, the
following items are needed:
➢ PLC
➢ Programming Device
➢ Programming Software
➢ Connector Cable
➢You can use a personal computer as a programming device
Instructions
• Timers
• Counters
• Master control
• Jump control
• Data handling
• Shift registers
TIMERS
• In general, there are three different PLC timer
types:
– On-delay timer (TON)
– Off-delay timer (TOF)
– Retentive timer on (RTO)
ON-DELAY TIMER (TON)
An on-delay timer is used
when you want to
program a time delay
before an instruction
becomes true.
Contd..
OFF-DELAY TIMER (TOF) and
RETENTIVE TIMER ON (RTO)
The off-delay timer (TOF) A retentive timer (RTO)
operation will keep the accumulates time whenever
output energized for a time the device receives power,
period after the rung and it maintains the current
containing the timer has time should power be
gone false. removed from the device.
OFF-DELAY TIMER (TOF)
RETENTIVE
TIMER ON (RTO)
COUNTERS
UP-COUNTER
Contd..
DOWN-COUNTER
• The down-counter
instruction will count down
or decrement by 1 each
time the counted event
occurs.
• Each time the down-count
event occurs, the
accumulated value is
decremented.
MASTER CONTROL
JUMP CONTROL
DATA HANDLING INSTRUCTIONS
• Moving data
• Comparison of magnitude of data( greater
than, equal to, less than)
• Arithmetic operation (Addition & subtraction)
• Conversion between binary coded decimal,
binary, octal.
MOVE INSTRUCTION
DATA COMPARISON
EQUAL TO NOT EQUAL TO
GREATER THAN
GREATER THAN OR EQUAL
DATA COMPARISON
LESS THAN LESS THAN OR EQUAL
LIMIT TEST
ARITHMETIC OPERATION
ADDITION SUBTRACTION
MULTIPLICATION DIVISION
CONVERSION
TO BINARY CODED DECIMAL
FROM BINARY CODED DECIMAL
The convert to BCD (TOD) instruction is used to The convert from BCD (FRD) instruction is
convert 16-bit integers into binary-coded used to convert binary-coded decimal
decimal (BCD) values. (BCD) values to integer values.
BIT SHIFT REGISTERS
• A bit shift register is a register that allows the
shifting of bits through a single register or group of
registers.
• The bit shift register shifts bits serially (from bit to
bit) through an array in an orderly fashion.
• A shift register can be used to simulate the
movement , or track the flow, of parts and
information
• Common applications for shift registers include the
following:
– Tracking of parts through an assembly line
– Controlling of machine or process operations
– Inventory control
– System diagnostics
Data in the shift register could represent the following:
• Part types, quality, and size
• The presence or absence of parts
• The order in which events occur
• Identification numbers or locations
• A fault condition that caused a shutdown
ANALOG I/O MODULES
• Discrete devices are inputs and outputs that
have only two states: on and off.
• In comparison, analog devices represent
physical quantities that can have an infinite
number of values.
• Typical analog inputs and outputs vary from 0
to 20 milliamps, 4 to 20 milliamps, or 0 to 10
volts.
Contd..
• The analog input interface module contains the
circuitry necessary to accept an analog voltage or
current signal from the level transmitter field device.
• This input is converted from an analog to a digital
value for use by the processor.
• The circuitry of the analog output module accepts the
digital value from the processor and converts it back to
an analog signal that drives the field tank level meter.
• Common physical quantities measured by a PLC analog
module include temperature, speed, level, flow ,
weight, pressure, and position.
Contd..
• For example, a sensor may measure
temperature over a range of 0 to 500°C, and
output a corresponding voltage signal that
varies between 0 and 50 mV.
Selection of PLC
• Input/output capacity → Future?
• Types of Input / Output required
• Size of memory
• Speed and power of CPU
Areas of Application
➢ Manufacturing/Machining
➢ Food/beverage
➢ Metals
➢ Power
➢ Mining
➢ Petrochemical/Chemical
Examples of PLC Programming
Softwares:
[Link]-Bradley – Rockwell Software
RSLogix 500
2. Modicon - Modsoft
3. Omron - Syswin
4. GE-Fanuc Series 6 – LogicMaster6
5. Square D- PowerLogic
6. Texas Instruments – Simatic
7. Telemecanique – Modicon TSX Micro