Download as pdf or txt
Download as pdf or txt
You are on page 1of 9

Ladder Logic Symbols

Ladder logic symbols are the fundamental programming components used in ladder diagrams.
In PLC programming, ladder logic symbols can be used individually or in combination to create
logic instructions. Traditionally, ladder logic symbols were created for bit logic operations, but
now include higher level functions such as timers, counters, math, comparison, PID loops, data
manipulation and data conversion.
This section provides a list of ladder diagram elements, contacts, coils, and timers available for
use within the graphical configuration utility. It also describes how they correspond to
controller function blocks.

 Normally Open Contact (NO)


Operation:
If the condition is TRUE then the contact is CLOSED and output logic flow is enabled. If the
condition is FALSE then the contact is OPEN and output logic flow is blocked.
Common Uses: Start Push buttons, selector switches, digital instrumentation, internal
programming.

 Normally Closed Contact (NC)


Operation:
If the condition is TRUE then the contact is OPEN and output logic flow is blocked. If the
condition is FALSE then the contact is CLOSED and output logic flow is enabled. The NC
contact symbol operation is opposite to the NO contact symbol.
Common uses: Stop Push buttons, Fail safe instrumentation, Motor Thermal Overloads,
internal programming.
 Positive Transition-Sensing Contact
Operation:
The contact will be CLOSED if the condition changes from FALSE to TRUE in one scan
cycle. Otherwise, it will be OPEN.
 Negative Transition-Sensing Contact
Operation:
The contact will be OPEN if the condition changes from FALSE to TRUE in one scan cycle.
Otherwise, it will be CLOSED.

 Output coil
Operation:
If the input condition is TRUE then the output is ON. If the input condition is FALSE then
the output is OFF.

Page 1 of 9
Common uses: Motor control, actuator control, indication lamps, warning sirens, internal
programming, sequence logic.

 Negated Output coil


Operation:
If the input condition is TRUE then the output is OFF. If the input condition is FALSE then
the output is ON.
Common uses: Motor control, actuator control, indication lamps, warning sirens, internal
programming, sequence logic.
 Positive Transition-Sensing Coil/Positive Edge Detection
Operation:
If the input condition transitions from FALSE to TRUE then the output is ON, for the time
taken to do one PLC scan (one scan cycle)
Common uses: Counting applications, Math commands, Data Transfer commands, Latch
output during a specific set of conditions.

 Negative Transition-Sensing Coil/Negative Edge Detection


Operation:
If the input condition transitions from FALSE to TRUE then the output is OFF, for the time
taken to do one PLC scan (one scan cycle)
Common uses: Counting applications, Math commands, Data Transfer commands, Latch
output during a specific set of conditions.

 Set Latch coil


Operation:
If the input condition transitions from FALSE to TRUE then the output is set ON. Once the
output is set ON, it stays ON, even if the input condition goes FALSE.

 Reset Latch coil


Operation:
If the input condition is TRUE then the output is reset to OFF. If the input condition is
FALSE it has no effect on the output. The SET and RESET coils can share the same variable
address and therefore work hand in hand.
Common uses for Set and Reset Coil Symbols: Motor and actuator outputs, indication lamp
and warning sirens, internal programming, toggle logic (flip flops), complex latching logic
which is set and reset in multiple locations.

Page 2 of 9
 Timer Delay ON
Operation:
If the input condition is TRUE then the timer begins. When the PRESET time set point has
been reached the output turns ON. If the input condition goes FALSE, at any stage, the timer
stops and the output turns OFF as well.
Common uses: Time delay for Warning Sirens, Star/Delta Motor Starters, sequence start
delays, de-bounce time delay to fix digital instrumentation flicker.

 Timer Delay OFF


Operation:
If the input condition is TRUE then the output turns ON. Then if the input condition goes
FALSE the timer begins. When the PRESET time set point has been reached the output turns
OFF. If the input condition goes TRUE, at any stage, the timer stops and the output turns ON
as well.
Common Uses: Cooling Fan run on time delay.

Ladder logic symbols

Page 3 of 9
Ladder Logic Programming
Because ladder logic is a graphical programming language the programming software is drag
and drop, so it makes it very user friendly. The programming software to write ladder logic
code is obtained from the manufacturer and is installed onto your PC. Some manufacturers
have free programming software and some require a software license.
Ladder Logic Programming Rules
Every PLC manufacturer has slightly different ladder logic programming rules when it comes
to building the logical expressions contained within a rung. Even a manufacturer with multiple
PLC models can have varying rules depending on processing power of each PLC model. But
there are seven basic rules that all PLC manufacturers use for ladder logic programming.
1. A PLC scans each rung in the ladder diagram from the left hand side to the right hand side
and from the top to the bottom.
2. The PLC scan runs in a repeated cyclic manner where the inputs are monitored, the rung
logic evaluated and then the state of the outputs are executed. The scan time is expressed in
milliseconds (ms).
3. The logic state of the outputs is evaluated as the program scans through the rungs. But they
are only updated at the very end of each PLC scan, simultaneously.
4. There must be at least one input or logic expression at the start of each rung.
5. There must be at least one output at the end of each rung.
6. Each rung in the ladder diagram represents one logic operation in the overall control
operation.
7. An input, output or logic expression can be used more than once in the ladder diagram. The
same tag name and address is used to label it if used more than once.

In order for the PLC to process the ladder logic rungs each symbol needs to be allocated to a
variable name whether it is an input, output or internal data. There are three essential elements
that must be defined when declaring a variable and one optional element.
1. Variable Name – The name must be unique and is used to make the ladder logic easily
readable by human beings, such as yourself. There will be restrictions on the length and
sometimes characters that can be used.
2. Address – the address can be either an Input, Output, Internal or System memory
address. The address nomenclature is dependent on the PLC manufacturer.
3. Data Type – The data type used will depend on the symbol being used and the
programming operation required. Defining a variable as a BOOL (Boolean) means it
has a binary value, an INT (integer) means it has a whole number value and a REAL
(floating point) means it has a number value with a decimal point.
4. Comment – Adding a comment is optional, but can assist in describing the variable if
the amount of characters in the variable name was insufficient.

Page 4 of 9
Module Addressing
The PLC has to be able to identify each particular input and output. It does this by allocating
addresses to each input and output. With a small PLC this is likely to be just a number, prefixed
by a letter to indicate whether it is an input or an output. Thus for the Mitsubishi PLC we might
have inputs with addresses X400, X401, X402, and so on and outputs with addresses Y430,
Y431, Y432, and so on, the X indicating an input and the Y an output. Toshiba uses a similar
system.
Different PLC manufacturers use slightly different naming conventions for variables and
memory allocation. It’s just a matter of checking the PLC’s help file to determine what to use.
With larger PLCs that have several racks of input and output channels, the racks are numbered.
With the Allen-Bradley PLC-5, the rack containing the processor is given the number 0 and
the addresses of the other racks are numbered 1, 2, 3, and so on, according to how setup
switches are set. Each rack can have a number of modules, and each one deals with a number
of inputs and/or outputs. Thus addresses can be of the form shown in the figure below.

For example, we might have an input with address I: 012/03. This would indicate an input, rack
01, module 2, and terminal 03.
With the Siemens SIMATIC S5, the inputs and outputs are arranged in groups of eight. Each
such group is termed a byte, and each input or output within a group of eight is termed a bit.
The inputs and outputs thus have their addresses in terms of the byte and bit numbers,
effectively giving a module number followed by a terminal number, a full stop (.) separating
the two numbers. The figure below shows the system.

Thus I0.1 is an input at bit 1 in byte 0, and Q2.0 is an output at bit 0 in byte 2.
Another example: a simple connection using the Siemens s7-400 PLC is shown in the figure
below.

Page 5 of 9
A simple connection in Siemens s7-400 PLC
You can notice from the figure that the common of the digital input module is connected to the
ground of the circuit while the common of the digital output module is connected to the power
source. In addition, a switch is connected to the input I0.0 in the digital input module, and an
LED connected to the output Q0.0 in the output module.
In addition to using addresses to identify inputs and outputs, PLCs also use their addressing
systems to identify internal, software-created devices, such as relays, timers, and counters.
It’s a good idea to keep each rung as simple as possible. Cramming too much into a rung can
save on memory but it can create a really complex network of logic that can come back and
bite you if you need to return at a later date to upgrade or modify your program.
A well written PLC program will ensure your machine or plant will be highly productive,
efficient and with low downtime.
If the program starts to get quite large then addition of sub-routines are recommended. Some
PLC models will also have additional areas where the sub-routine programming is done. Either
way subroutines can help your ladder logic programming to be easier to read and assist in
troubleshoot by providing a way to organize your code into kind of a filing system.
It’s up to you with regards to naming your subroutines. Remember to create sub routines so
that you can group all the same type of code in the one place. Some examples of possible sub
routines that can be created are: Main Program, Sequence Steps, Motor control, Fault logic,
Interlock logic, Analogue scaling etc.
Once your ladder logic program is complete you will need to compile the program. The
compile, button is usually located in the toolbar. Compiling the program is just checking for
syntax, memory and program structural errors. If there are any issues then error messages will
be generated that directly points you to the source of the problem.
Once all the errors are fixed it’s time to download to the PLC. The download button is also
usually located in the toolbar of the PLC programming software.

Page 6 of 9
So you’ve written the ladder logic program, compiled and downloaded to the PLC, but nothing
is happening…You need to put the PLC into run mode.
Run mode simply starts the PLC scan cycle.
Some PLC’s have a key switch, others have a soft switch done through the PLC development
software (usually some buttons in the toolbar). Either way there should be a RUN light that
illuminates on the face of the PLC.
Debugging Ladder Logic Program
Ladder logic is great for debugging your program. When you place the PLC development
software in ONLINE mode the symbols in each rung highlight in real time when their
respective conditions are TRUE. So if your rung is fully highlighted all way up to your output,
then the output is TRUE.
To assist in testing and commissioning you can also force the state of binary variables to TRUE
or FALSE and also force analogue variables to a specific value. This can be very useful, but
remember to release all the forced variables after you’ve finished testing your program.
Most PLC programming software have the facility to create variable tables which display the
variable information and status or value. This gives you a handy display area for analysing the
status and value of the variables instead of scrolling up and down through your rungs of code.

Programming in Siemens PLC SIMATIC Step7


SIMATIC software is the universal configuring and programming environment for SIMATIC
controllers, human machine interface systems and process control systems. SIMATIC software
with STEP 7 and numerous engineering tools supports all phases of product deployment, from
hardware configuration of the system and parameterization of modules to service of the
installed system. PLC programming can be done also with the help of SIMATIC Manager,
which provides the possibility to write programs.

Motor Starter Example


This example will show the practical aspect of programming in Step 7 with a real, existing part
of a system. A motor starter coil (M) is wired in series with a normally open, momentary Start
push-button, a normally closed, momentary Stop push-button, and normally closed overload
relay (OL) contacts.

Page 7 of 9
Electrical schematic of the starter
PLC Motor Control
The motor control application can also be accomplished with a PLC. In the following example,
a normally open Start push-button is wired to the first input (I0.0), a normally closed Stop push-
button is wired to the second input (I0.1), and a normally closed overload relay contacts (part
of the motor starter) are connected to the third input (I0.2). These inputs are used to control
normally open contacts in a line of ladder logic programmed into the PLC.

Initially, I0.1 status bit is a logic 1 because the normally closed (NC) Stop push-button is
closed. I0.2 status bit is a logic 1 because the normally closed (NC) overload relay (OL)
contacts are closed. I0.0 status bit is a logic 0, however, because the normally open Start push-
button has not been pressed.

Page 8 of 9
Normally the open output Q0.0 contact is also programmed on Network 1 as a sealing contact.
With this simple network, energizing the output coil Q0.0 is required to turn on the motor.
When the Start push-button is pressed, the CPU receives a logic 1 from input I0.0. This causes
the I0.0 contact to close. All three inputs are now a logic 1. The CPU sends a logic 1 to the
Q0.0 output. The motor starter is energized and the motor starts.

The output status bit for Q0.0 is now equal to 1. On the next scan, when the normally open
contact Q0.0 is solved, the contact will close, and the output Q0.0 will stay on, even if the Start
push-button is released.

When the Stop push-button is pressed, the input I0.1 turns off, the I0.1 contact opens, the
output coil Q0.0 de-energizes and the motor turns off.

Page 9 of 9

You might also like