Basuwaqi, A.
M 1
PROGRAMMING OF PLC
Types of PLC Programming Language
a. Structured text programming (ST) - A high level language that has some
similarities to Pascal. Statements can be used to assign values to variables.
b. Logic diagram (LD) – A graphical language, and most widely used. Use Boolean
mnemonics to represent the process, before converting into logic diagram.
c. Functional Block Diagram Programming (FBD) – A graphical language. Used in
applications involving the flow of signals between control blocks.
d. Instruction List (IL) - A low level programming language, much like assembly
language programming.
e. Sequential Function Chart (SFC) - A graphical programming method. Very
useful for describing sequential type processes.
Basuwaqi, A. M 2
PROGRAMMING OF PLC
Instruction lists (IL)
• A programming method, which can be considered to be the entering of a ladder program
using text, is instruction lists (IL).
• Instruction list gives programs which consist of a series of instructions.
• Each instruction being on a new line. An instruction consists of an operator followed by
one of more operands .
• Mnemonic codes are used, each code corresponding to an operator/ladder element. The
codes used differ to some extent from manufacturer to manufacturer
Basuwaqi, A. M 3
PROGRAMMING OF PLC
IL Language Instruction code mnemonics
Basuwaqi, A. M 4
PROGRAMMING OF PLC
Instruction lists (IL)
Consider the following example
instructions
Operands
Comments
Basuwaqi, A. M 5
PROGRAMMING OF PLC
Instruction lists (IL)
with there being the instruction earlier in the program to jump to PUMP_OK if a particular
condition is realized.
an N after it is used to negate its value. Thus the ANDN operator inverts the value of ladder
contacts and ANDs the result
Basuwaqi, A. M 6
PROGRAMMING OF PLC
Ladder programs and instruction lists
1. whenever a rung is started, it must use a ‘start a rung code’. This might be LD, or perhaps
A or L, to indicate the rung is starting with open contacts.
2. LDI, or perhaps LDN or LD NOT or AN or LN, to indicate it is starting with closed
contacts.
3. All rungs must end with an output or store result code. This might be
OUT or = or ST
Basuwaqi, A. M 7
PROGRAMMING OF PLC
Ladder programs and instruction lists
MITSUBISHI SIEMENS
Basuwaqi, A. M 8
PROGRAMMING OF PLC
Ladder programs and instruction lists
Basuwaqi, A. M 9
PROGRAMMING OF PLC
Ladder programs and instruction lists
Basuwaqi, A. M 10
PROGRAMMING OF PLC
Ladder programs and instruction lists
Basuwaqi, A. M 11
PROGRAMMING OF PLC
Ladder programs and instruction lists
Branch codes
ORB (OR branches/blocks together) Basuwaqi, A. M 12
PROGRAMMING OF PLC
Ladder programs and instruction lists
Basuwaqi, A. M 13
PROGRAMMING OF PLC
Ladder programs and instruction lists
More than one rung
Basuwaqi, A. M 14
PROGRAMMING OF PLC
Ladder programs and instruction lists
Example 1:
A B C
Basuwaqi, A. M 15
PROGRAMMING OF PLC
Ladder programs and instruction lists
Answer Example1
A B C
Basuwaqi, A. M 16
PROGRAMMING OF PLC
Sequential function charts (SFC)
The term sequential
function chart (SFC) is used
for a pictorial representation
of a system’s operation to
show the sequence of the
events involved in its
operation
SFC charts have the following elements
Basuwaqi, A. M 17
PROGRAMMING OF PLC
Sequential function charts (SFC)
Part of an SFC and its equivalent
ladder program
Basuwaqi, A. M 18
PROGRAMMING OF PLC
Structured text
• Structured text is a programming language that strongly resembles the programming
language PASCAL.
• Programs are written as a series of statements separated by semicolons (;).
• Assignment statements are used to indicate how the value of a variable it to be changed,
Light := SwitchA;
Consider:
Basuwaqi, A. M 19
PROGRAMMING OF PLC
Structured text
Conditional statements
IF ... THEN ... ELSE is used when selected statements are to be executed when certain
conditions occur. For example:
Basuwaqi, A. M 20
PROGRAMMING OF PLC
Structured text
Examples:
Programs have first to define the data types required to represent data
Basuwaqi, A. M 21
PROGRAMMING OF PLC
Structured text
signals from sensors and output signals to be used in a program,
Basuwaqi, A. M 22
PLC WIRING DIAGRAMS
Electromagnetic Control Relays
• The PLC’s original purpose was the
replacement of electromagnetic relays
with a solid-state switching system that
could be programmed.
• The programmable controller is
designed to replace the physically small
control relays that make logic decisions
but are not designed to handle heavy
current or high voltage .
Basuwaqi, A. M 23
PLC WIRING DIAGRAMS
Electromagnetic Control Relays Operation
Basuwaqi, A. M 24
PLC WIRING DIAGRAMS
Contactors
• A contactor is a special type of
relay designed to handle heavy
power loads that are beyond the
capability of control relays.
• Unlike relays, contactors are
designed to make and break
higher powered circuits without
being damaged.
Three-pole
magnetic contactor
Basuwaqi, A. M 25
PLC WIRING DIAGRAMS
Contactors
• PLC used in conjunction with a contactor
to switch power on and off to a pump
Contactor used in conjunction with a PLC output
Basuwaqi, A. M 26
PLC WIRING DIAGRAMS
Motor Starters
A motor starter is designed to provide power to motors.
The motor starter is made up of a contactor with an
overload relay attached physically and electrically to it.
• Overload relays are designed to meet the special
protective needs of motor control circuits.
• They allow harmless temporary overloads that occur
when a motor starts.
• The overload relay will trip and disconnect power to
the motor if an overload condition persists.
• Overload relays can be reset after the overload
condition has been corrected Basuwaqi, A. M 27
PLC WIRING DIAGRAMS
Motor Starters
Three-phase magnetic motor starter
Basuwaqi, A. M 28
PLC WIRING DIAGRAMS
Motor Starters
PLC control of a motor
Basuwaqi, A. M 29
PLC WIRING DIAGRAMS
Manually Operated Switches
Manually operated switches are controlled by hand. These include toggle switches,
pushbutton switches, knife switches, and selector switches.
Pushbutton switches are the most common form of manual control
Commonly used types of pushbutton switches
Basuwaqi, A. M 30
PLC WIRING DIAGRAMS
Manually Operated Switches
Three-position selector switch
Dual in-line package (DIP) switches
Basuwaqi, A. M 31
PLC WIRING DIAGRAMS
Mechanically Operated Switches
A mechanically operated switch is controlled automatically by factors such as pressure,
position, or temperature
Mechanically operated limit switch
Basuwaqi, A. M 32
PLC WIRING DIAGRAMS
Mechanically Operated Switches
Temperature switch
Basuwaqi, A. M Pressure switch 33
PLC WIRING DIAGRAMS
Sensors
• Sensors are used for detecting, and often measuring, the magnitude of something.
• They convert mechanical, magnetic, thermal, optical, and chemical variations into electric
voltages and currents
Proximity sensor: that detect the presence of an object (usually called the target) without
physical contact
Basuwaqi, A. M 34
PLC WIRING DIAGRAMS
Sensors
Capacitive proximity sensors
Basuwaqi, A. M 35
PLC WIRING DIAGRAMS
Sensors: Light Sensors
Through-beam scan
Basuwaqi, A. M 36
PLC WIRING DIAGRAMS
Sensors: Ultrasonic Sensors
An ultrasonic sensor operates by sending
high-frequency sound waves toward the
target and measuring the time it takes for the
pulses to bounce back
Basuwaqi, A. M 37
PLC WIRING DIAGRAMS
Output Device Control
Solenoid
Basuwaqi, A. M 38
Basuwaqi, A. M 39