0% found this document useful (0 votes)
11 views46 pages

Control Lecture 1 1

Control systems manage and regulate the behavior of devices to achieve desired outcomes, categorized mainly into open loop and closed loop systems. Open loop systems operate without feedback, while closed loop systems utilize feedback to adjust outputs based on input variations. Additionally, programmable logic controllers (PLCs) enhance control flexibility and reliability in industrial applications by allowing easy reprogramming and integration of various input and output devices.

Uploaded by

Cye Bodino
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views46 pages

Control Lecture 1 1

Control systems manage and regulate the behavior of devices to achieve desired outcomes, categorized mainly into open loop and closed loop systems. Open loop systems operate without feedback, while closed loop systems utilize feedback to adjust outputs based on input variations. Additionally, programmable logic controllers (PLCs) enhance control flexibility and reliability in industrial applications by allowing easy reprogramming and integration of various input and output devices.

Uploaded by

Cye Bodino
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 46

Types of Control System

Control System:

Control System is a system of devices which is used to manage, commands, directs and regulates the
behaviour of the other devices to accomplish a desired level. In other words, it is a system which
controls other device system to achieve a desired result. Control Systems are present almost
everywhere. For eg. Control System is used in a single home heating controller using a thermostat as ca
controller for domestic boiler to a large scale industrial system.

Types of Control System:

There are two main types of control system:

1. Open loop control system and

2. Closed loop control system.

1. Open Loop Control System

- In open loop control system, the input control action from the controller is independent of the system
output or process variable. In other words, when there is a variation in input variable, it doesn't make
changes in the output variable.

- This type of control system is also referred as non-feedback control loop system. As the control
response between input and output are not compared.

- for an instance, an immersion rod is used for heating the water. When the input is provided by
supplying external electric current to the rod, the rod starts to heat the water, while there is no
feedback for the sensing of required heating level for rod.

2. Closed Loop Control System

- In a closed loop control system, the input control action from the controller is dependent of the system
output or process variable. When there is a variation in input of the controller, the output or process
variable will change.
- closed loop control system has feedback loop which helps to ensure the controller exerts a control
action to control a process variable or output at the same value as the setpoint.

- Thus, closed loop control system is also called as feedback controllers.

For an instance, an air conditioner is used for cooling the room, initially, the actual temperature of the
room is measured once you switch on the conditioner. During regulating a specific temperature as per
requirement, air conditioner uses a thermostat which gives feedback to the control system.

Other than these two control systems, the types may vary depending on the application requirement.
These are as follow:

3. Feedback Control System: In this type of control system, sensors, control algorithms, and actuators ae
involved to regulate the process variable at a setpoint. Feedback Control System tries to achieve a
desired result with the help of feedback and can change the output at some extent when conditions
vary. The closed loop control systems are the example of feedback control system.

4. Feedforward Control System: In this type of control system

- No corrective action is taken until after a deviation in the controlled variable occurs. Thus, perfect
control, where the controlled variable does not deviate from the setpoint during disturbance or set-
point changes, is the theoretically impossible.

- Corrective action taken before the actual disturbance occurs on the output.

- Feedback control does not provide predictive control action to compensate for the effects of known or
measurable disturbances.

- it may not be satisfactory for processes with large time constants and / or long time delays. If large and
frequent disturbance occur, the process may operate continuously in a transient state and never attain
the desired steady state.

- in some situations, the controlled variable cannot be measured on-line, and , consequently, feedback
control is not feasible.
5. Linear and Nonlinear Control System: Linear Control System use negative feedback to produce signal
to maintain the controlled Process Variable (PV) at the desired Setpoint (SP). It also follows homogeneity
and additivity. While nonlinear control system does not follow homogeneity.

6. Continuous time and discrete time control system. This type of control system is based on the type of
signal used. In continuous time control system, all the signals are continuous in time. In discrete time
control system, one of more signals are discrete time signals.
7. SISO and MIMO Control System: Based on the number of input and output, control system can be
classified as SISO (Single Input Single Output) and MIMO (Multiple Input Multiple Output).

SISO stands for Single Input and Single Output, the name SISO itself suggest that control system has one
input and one output. On the other hand, MIMO stands for Multiple Inputs and Multiple Outputs. MIMO
has more than one input and output.
What is Programmable Logic Controllerr, also called a PLC or programmable controller, is a computer-
type device used to control equipment in an industrial facility.

The kinds of equipment that PLCs can control are as varied as industrial facilities themselves. Utilities
Plants, Batch Control Application, Chemical Processing, Conveyor systems, food processing machinery,
auto assembly lines, etc. .. you name it and there’s probably a PLC out there controlling it.

Programmable Logic Controller

In a traditional industrial control system, all control devices are wired directly to the PLC. Then, the
control program inside the PLC provides the “wiring” connection between the devices.

The control program is the computer program stored in the PLC’s memory that tells the PLC what’s
supposed to be going on in the system. The use of a PLC to provide the wiring connections between
system devices is called softwiring.

EXAMPLE

Let’s say that a push button is supposed to control the operation of a motor.

In a traditional control system, the push button would be wired directly to the motor. In a PLC system,
both the push button and the motor would be wired to the PLC instead.

Then, the PLC’s control program would complete the electrical circuit between the two, allowing the
button to control the motor.

The soft-wiring advantage provided by programmable controller is tremendous.

In fact, is one of the most important features of PLCs. Soft-wiring makes changes in the control easy and
cheap.

If you want a device in a PLC system to behave differently or to control a different processes element, all
you have to do is change the control program.

In a traditional system, making this type of change would involve physically changing the wiring between
the devices, a costly and time-consuming edeavor.

EXAMPLE

Le’t say that two push buttons, PB1 and PB2, are connected to a PLC. Two pilot lights, PL1 and PL2, are
also connected to the PLC.

The way these devices are connected now pressing push button PB1 turns on pilot light PL1 and pressing
push button PB2 turns on pilot light PL2.

Let’s say that you want to change this around so that PB1 controls PL2 and PB2 controls PL1.
In a traditional system, you would have to rewire the circuit so that the wiring from the first push button
goes to the second pilot light and vice versa.

However, because these devices are connected to a PLC, making this change is as simple as making a
small change in the control program.

PLC Advantages

In addition to the programming flexibility we just mentioned, PLCs offer other advantages over
traditional control systems.

These advantages include:

- High reliability
- Small space requirements
- Computing capabilities
- Reduced costs
- Ability to withstand harsh environments
- Expandability

A PLC basically consists of two elements:

1. Central Processing Unit


2. Input / Output System

The Central Processing Unit

The central processing unit (CPU) is the part of a programmable controller that retrieves, decodes,
stores, and process information.

It also executes the control program stored in the PLC’s memory. In essence, the CPU is the “brains”
of a programmable controller.

In functions much the same way the CPU of a regular computer does, except that is uses special
instructions and coding to perform its functions.

The CPU has three parts:

- The processor
- The memory system
- The power supply

The processor is the section of the CPU that codes, decodes, and computes data.

Memory system is the section of the CPU that stores both the control program and data from the
equipment connected to the PLC.
Power supply is the section that provides the PLC with the voltage and current it needs to operate.

The Input / Output System

The input / output (I/O) system is the section of a PLC to which all of the field devices are connected.

If the CPU can be thought of as the brains of a PLC, then I/O system can be thought as the arms and
legs.

The I/O system is what actually physically carries out the control commands from the program
stored in the PLC’s memory.

The I/O system is consists of two main parts:

- The Rack
- I/O modules

The rack is an enclosure with slots in it that is connected to the CPU.

I/O modules are devices with connection terminals to which the field devices are wired. Together, the
rack and the I/O modules form the interface between the field devices and the PLC.

When set up properly, each I/O module is both securely wired to its corresponding field devices and
securely installed in a slot in the rack.

This creates the physical connections between the field equipment and the PLC. In some small PLs, the
rack and the I/O modules come prepackaged as one unit.

PLC Cabinet

All of the field devices connected to a PLC can be classifies in one of two categories:

- inputs

- outputs

Inputs are devices that supply a signal/data to a PLC.

Typical examples of inputs are push buttons, switches, and measurement devices. Basically, an input
device tells the PLC, “Hey, something’s happening out here.. you need to check this out to see how it
affects the control program.”

Outputs are devices that await a signal/data from the PLC to perform their control functions. Lights,
horns, motors, and valves are all good examples of output devices.

These devices stay put, minding their own business, until the PLC says, “You need to turn on now” or
“You’d better open up your valve a little more, etc.
EXAMPLE

An overhead light fixture and its corresponding wall switch are good examples o everyday inputs and
outputs. The wall switch is an input – it provides a signal for the light to turn on. The overhead light is an
output- it waits until the switch sends a signal before it turns on.

Let’s pretend that you have a souped-up overhead light/switch circuit that contains a PLC.

In this situation, both the switch and the light will be wired to the PLC instead of to each other.

Thus, when you turn on the switch, the switch will send its “turn on” signal to the PLC instead of to the
light. The PLC will then relay this signal to the light, which will then turn on.

PLC-EXAMPLE

There are two basic types of input and output devices:

- Discrete
- Analog

Discrete devices are inputs and outputs that have only two states: on and off.

As a result, they send / receive simple signals to / from a PLC. These signals consists of only 1s and 0s. A
1 means that the device is on and a 0 means that the device is off.

Analog devices are inputs are inputs and outputs that can have an infinite number of states. These
devices can not only be on and off, but they can also be barely on, almost totally on, not quite off, etc.

These devices send/receive complex signals to/from a PLC. Their communications consist of a variety of
signals, not just 1s and 0s.

EXAMPLE

The overhead light and switch we just discussed are both examples of discrete devices. The switch can
only be either totally on or totally off at any given time. The same true for the light.

A thermometer and a control valve are examples of the other type of I/O devices – analog.

A thermometer is an analog input device because it provides data that can have an infinite number of
states. Temperature isn’t just hot or cold. It can have a variety of states including warm, cool, moderate,
etc.

PLC input-and-output devices

A control valve is an analog output for the same reason. It can be totally on or totally off, but it can also
have an infinite number of settings between these two states.
Because different input and output devices send different kinds of signal, they sometimes have a hard
time communication with the PLC. While PLCs are powerful devices, they can’t always speak the
“language” of every device connected to them.

That’s where the I/O modules we talked about earlier come in. The modules act as “transistors”
between the field devices and the PLC. They ensure that the PLC and the field devices all get the
information they need in a language that they can understand.

CONTROL PROGRAM

We discussed a little bit earlier about the control program. The control program is a software program in
the PLC’s memory. It’s what puts the control in a programmable controller.

The user or the system designer is usually the one who develops the control program. The control
program is made up of things called instructions. Instructions are, in essence, little computer codes that
make the inputs and outputs do what you want in order to get the results you need.

There are all different kinds of instructions and they can make a PL do just about anything (add and
subtract data, time and count events, compare information, etc.)

All you have to do is program the instructions in the proper order and make sure that they are telling the
right devices what to do and voila.. you have a PLC-controlled system.

And remember, changing the system is a snap. If you want the system to act differently just change the
instructions in the control program.

Different PLCs offer different kinds of instructions. That’s part of what makes each type of PLC unique.
However, all PLCs use two basic type of instructions:

- Contact
- Coil

Contacts are instructions that refer to the input conditions to the control program – that is, to the
information supplied by the input field devices. Each contact in the control program monitors a certain
field device.

The contact waits for the input to do something in particular (e.g. turn on, turn off, etc. – this all
depends on what type of contact it is).

Then, the contacts tells the PCL’s control program. “The input device just did what it’s supposed to do.
You’d better check to see if this is supposed to affect any of the output devices.”

Coils are instructions that refer to the outputs of the control program – that is, to what each particular
output device is supposed to do in the system.
Like a contact, each coil also monitors a certain field device. However, unlike a contact, which monitors
the field device and then tells the PLC what to do, a coil monitors the PLC control program and then tells
the field device what to do.

It tells the output device, “Hey, the PLC just told me that the switched turned on. That means that
you’re supposed to turn on now. So let’s go.

EXAMPLE

Let’s talk again about that souped-up switching circuit, in which a wall switch and an overhead light are
connected to a PLC. Let’s say that turning on the switch is supposed to turn on the light.

In this situation, the PLC’s control program would contain a contact that examines the input device—the
wall switch – for an on condition and a coil that references the light. When the switch turns on, the
contact will “energize,” meaning that it will tell the PLC that the condition it’s been looking for has
happened.

The PLC will relay this information to the coil instruction by energizing it. This will let the coil know that it
needs to tell its referenced output – the light – to turn on.

In PLC talk, this three-step process of monitoring the inputs, executing the PLC control program, and
changing the status of the outputs accordingly is called the scan.

PLC Memory

A PLC’s memory system is very complex, allowing it to store information not only about the control
program but about the status of all the inputs and outputs as well. To keep track of all this information,
it uses a system called addressing.

An address is a label or number that indicates where a certain piece of information is located in a PLC’s
memory.

Just like your home address tells where you live in your city, a device or piece of data’s address tells
where information about it resides in the PLC’s memory.

That way, if a PLC wants to find out information about a field device, it knows to look in its
corresponding address location.

Some addresses contain information about the status of particular field devices. Other addresses store
data that’s the result of control program computations.

Still others contain reference data entered by the system programmer. Nonetheless, no matter what
type of data it it, a PLC uses its addressing scheme to keep track of it all. That way, it’ll have the right
data when it needs it.

PLCs can seem a little daunting at first, but there’s no need to panic. Just remember that all PLCs follow
the basic rules of operation we’ve just discussed. All PLCs have a CPU and an input/output system.
They also all use a control program, instructions, and addressing to make the equipment in the control
system do what it’s supposed to do.

And no matter how many inputs and outputs you add to it, every PLC does the same three things: (1)
examines its inputs devices, (2) executes its control program, and (3) updates its output devices
accordingly. So in reality, understanding PLCs is as simple as 1-2-3!

Now that you know what these things called PLCs are and how they make our lives easier, you might
want to take the next step and learn how to use them. If you do ,you’re on the right track.

Since PLCs are now being used more than ever, a working knowledge of PLCs is an invaluable skill.

WHAT IS SCADA?

SCADA is normally a software package designed to display information, log data and show alarms.

This can be graphical and tabular and can involve words and pictures (mimics).

The software would normally be installed on a computer and all the various signals would be wired back
to the central point (CPU), or marshalled and gathered using some form of bus system or direct wired.

SCADA can be used to monitor and control plant or equipment. The control may be automatic, or
initiated by operator commands. The data acquisition is accomplished firstly by the RTU’s (remote
Terminal Units).

The central host will scan the RTU’s or the RTU’s will report in Data can be of three main types.

Analogue data (i.e. real numbers) will be trended (ie placed in graphs). Digital data (on/off) may have
alarms attached to one state or the other. Pulse data (e.g. counting revolutions of a meter) is normally
accumulated or counted.
Supervisory control and data acquisition – SCADA refers to ICS (industrial control system) used to control
infrastructure processes (Utilities, water treatment, wastewater treatment, gas pipelines, wind farms,
etc), facility-based processes (airport, space stations, ships, etc.) or industrial processes (production,
manufacturing, refining, power generation, etc.).

The following subsystem are usually present in SCADA systems:

- The apparatus used by a human operator; all the processed data are presented to the operator
- A supervisory system that gathers all the required data about the process
- Remote Terminal Units (RTUs) connected to the sensors of the process, which helps to convert
the sensor signals to the digital data and send the data to supervisory steam.
- Programmable Logic Controller (PLCs) used as field devices
- Communication infrastructure connects the Remote Terminal Units to supervisory system.

Generally, a SCADA system does not control the processes in real time – it usually refers to the system
that coordinates the processes in real time.

SCADA System Concepts

SCADA refers to the centralized systems that control and monitor the entire sites, or they are the
complex systems spread out over large areas.

Nearly all the control actions are automatically performed by the remote terminal units (RTUs) or by the
programmable logic controllers (PLCs).

The restrictions to the host control functions are supervisory level intervention or basic overriding.

For example, the PLC (in an industrial process) controls the flow of cooling water, the SCADA system
allows any changes related to the alarm conditions and set points for the flow (such as high
temperature, loss of flow, etc) to be recorded and displayed.
Data acquisition starts at the PLC or RTU level, which includes the equipment status reports, and meter
readings. Data is then formatted in such way that the operator of the control room can make the
supervisory decisions to override or adjust normal PLC (RTU) controls, by sing the HMI.

SCADA systems mostly implement the distributed databases known as tag databases, containing data
elements called points or tags. A point is a single output or input value controlled or monitored by the
system.

Points are either ‘soft’ or ‘hard’.

The actual output or input of a system is represented by a hard point, whereas the soft point is a result
of different math and logic operations applied to other points.

These points are usually stored as timestamp-value pairs. Seies of the timestamp-value pairs gives
history of the particular point.

Storing additional metadata with tags is common (these additional data can include comments on the
design time, alarm information, path to the field device or the PLC register).

Human Machine Interface


The HMI, or Human Machine Interface, is an apparatus that gives the processed data to the human
operator. A human operator uses HMI to control processes.

The HMI is linked to the SCADA system’s databases, to provide the diagnostic data, management
information and trending information such as logistic information, detailed schematics for a certain
machine or sensor, maintenance procedures and troubleshooting guides.

The information provided by the HMI to the operating personnel is graphical, in the form of mimic
diagrams.

This means the schematic representation of the plant that is being controlled is a available to the
operator.

For example, the picture of the pump that is connected to the pipe shows that this pumps is running and
it also shows the amount of fluid pumping through the pipe at the particular moment.

The pump can then be switched off by the operator. The software of the HMI shows the decrease in the
flow rate of fluid in the pipe in the real time.

Mimic diagram either consist of digital photographs of process equipment with animated symbols, or
schematic symbols and line graphics that represent various elements.

HMI package of the SCADA systems consist of a drawing program used by the system maintenance
personnel or operators to change the representation of these points in the interface.
These representations can be as simple as on-screen traffic light that represents the state of the actual
traffic light in the area, or complex, like the multi-projector display that represents the position of all the
trains on railway or elevators in skyscraper.

SCADA systems are commonly used in alarm systems. The alarm has only two digitals status points with
values ALARM or NORMAL. When the requirements of the Alarm are met, the activation will start.

For example, when the fuel tank of a car is empty, the alarm is activated and the light signal is on. To
alert the SCADA operators and managers, text messages and emails are sent along with alarm activation.

SCADA Hardware

SCADA system may have the components of the Distributed Control System. Execution of easy logic
processes without involving the master computer is possible because ‘smart’ PLCs or RTUs. IEC61131-
39(Ladder Logic) is used, (this is functional block programming language, commonly used in creating
programs running on PLCs and RTUs.)

IEC 61131-3 has very few training requirements, unlike procedural languages like FORTRAN and C
programming language.

The SCADA system engineers can perform implementation and design of programs being executed on
PLC or RTU. The compact controller, Programmable automation controller (PAC), combines the
capabilities and features of a PC-based control system with a typical PLC.

Distributed RTUs’, in various electrical substation SCADA applications, use station computers or
information processors for communicating with PACS, protective relays, and other I/O devices.
Almost all big PLC manufacturers offer integrated HMI/SCADA systems, since 1998.

Many of them are using non-proprietary and open communication protocols. Many skilled third party
HMI/SCADA packages have stepped into the market, offering in-built compatibility with several major
PLCs, which allows electrical engineers, mechanical engineers or technicians to configure HMIs on their
own, without requiring software-developer-written custom-made program.

Remote Terminal Unit (RTU)

The RTU is connected to the physical equipment. Often the RTU converts all electrical signals coming
from the equipment into digital values like the status – open/closed – from a valve or switch, or the
measurement like flow, pressure, current or voltage.

By converting and sending the electrical signals to the equipment, RTU may control the equipment, like
closing or opening a valve or a switch, or setting the speed of the pump.

Supervisory Station

A ‘supervisory Station’ refers to the software and servers responsible for communication with the field
equipment (PLCCs,RTUs etc), and after that, to HMI software running on the workstations in the control
room, or somewhere else.

A master station can be composed of only one PC (in small SCADA system). Master station can have
multiple servers, disaster recovery sites and distributed software applications in larger SCADA systems.

For increasing the system integrity, multiple servers are occasionally configured in hot-standby or dual-
redundant formation, providing monitoring and continuous control during server failures.

SCADA Operational Philosophy

The cost resulting from control system failures are very high. Even lives may be lost. For a few SCADA
systems, hardware is ruggedized, to withstand temperature, voltage and vibration extremes, and
reliability is increased, in many critical installations, by including communications channels and
redundant hardware:

A part which is ailing can be identified and the functionality taken over automatically through backup
hardware. It can be replaced without any interruption of the process.

Communication Methods and Infrastructure

SCADA systems initially used modem connections or combination of direst and radio serial to meet
communication requirement, even though IP and Ethernet over SONET/SDH can also be used at larger
sites like power stations and railways. The monitoring function or remote management of the SCADA
system is called telemetry.
SCADA protocols have been designed to be extremely compact and to send information to the master
station only when the RTU is polled by the master station. Typically, the legacy of SCADA protocols
consists of Conitel, Profibus, Modbus RTU and RP-570.

These protocols of communication are specifically SCADA-vendor. Standard protocols are IEC61850,
DNP3 and IEC 660870-5-101 or 104. These protocols are recognized and standardized by all big SCADA
vendors. Several of these protocols have extensions for operating through the TCP/IP.

The development of many automatic controller devices and RTUs had started before the advent of
industry standards for the interoperability.

For better communication between different software and hardware, PLE for Process Control is a widely
accepted solution that allows communication between the devices that originally weren’t intended to
be part of the industrial network.

Monolithic: The First Generation

SCADA Architectures

In the first generation, mainframes systems were used for computing. At the time SCADA was
developed, networks did not exist.

Therefore, the SCADA systems did not have any connectivity to other systems, meaning they were
independent system. Later on, RTU vendors designed the Wide Area Networks that helped in
communication with RTU.

The usage of communication protocols at the time was proprietary. I the mainframe system failed, there
was a back-up mainframe, connected at the bus level.

Distributed: The Second Generation

The information between multiple stations was shared in real time through LAN and the processing was
distributed between various multiple stations.

The cost and size of the stations were reduced in comparison to the ones used in the first generation.
The protocols used for the networks were still proprietary, which caused many security issues for SCADA
systems.

Due to the proprietary nature of the protocols, very few people actually knew how secure the SCADA
installation was.

Modern SCADA Systems

Modern SCADA system allow real-time data from the plant floor to be accessed from anywhere in the
world. This access to real-time information allows governments, businesses, and individuals to make
data-driven decisions about how to improve their processes. Without SCADA software, it would be
extremely difficult if not impossible to gather sufficient data for consistently well-informed decision.
Also, most modern SCADA designer applications have rapid application development (RAD) capabilities
that allow users to design applications relatively easily, even if they don’t have extensive knowledge of
software development.

The introduction of modern IT standards and practices such as SQL and web-based application into
SCADA software has greatly improved the efficiency, security, productivity, and reliability of SCADA
systems.

SCADA software that utilizes the power of SQL database provides huge advantages over antiquated
SCADA software. One big advantage of using SQL databases with a SCADA system is that it makes it
easier to integrate into existing MES and ERP systems, allowing data to flow seamlessly through an
entire organization.

Historical data from a SCADA system can also be logged in a SQL database, which allows for easier data
analysis through data trending.

Networked: The Third Generation

The SCADA system used today belong to this generation. The communication between the system and
the master station is done through the WAN protocols like the Internet Protocols (IP).

Since the standard protocols used and the networked SCADA systems can be accessed through the
internet, the vulnerability of the system is increased.

However, the usage of security techniques and standard protocols means that security improvements
can be applied in SCADA systems.
SCADA Trends

In the late 1990s instead of using the RS-485, manufactures used open message structures like Modbus
ASCII and Modbus RTU (both developed by Modicon). By 2000, almost all I O makers offered fully open
interfacing like Modbus TCP instead of the IP and Ethernet.

SCADA systems are now in line with the standard networking technologies. The old proprietary
standards are being replaced by the TCP/IP and Ethernet protocols. However, due to certain
characteristics of frame-based network communication technology. Ethernet networks have been
accepted by the majority of markets for HMI SCADA.

The ‘Next Generation’ protocols using XML web services and other modern web technologies, make
themselves more IT supportable. A few examples of these protocols include Wonderware’s SuiteLink, GE
Fanuc’s Proficy, I Gear’s Data Transport Utility. Rockwell Automation’s Factory Talk and OPC-UA.

Some vendors have started offering application-specific SCADA system that are hosted on remote
platforms all over Internet. Hence, thre is no need to install systems at the user-end facility. Major
concerns are related to the Internet connection reliability, security and latency.

The SCADA systems are becoming omnipresent day by day. However, there are still some security issues.

SCADA Security Issues


Security of SCADA-based systems is being questioned, as they are potential targets to
cyberterrorism/cyberwarfare attacks.

There is an erroneous belief that SCADA networks are safe enough because they are safe enough
because they are secured physically. It is also wrongly believed that SCADA networks are safe enough
because they are disconnected from the Internet.

SCADA systems also are used for monitoring and controlling physical processes, like distribution of
water, traffic lights, electricity transmissions, gas transportation and oil pipelines and others systems
used in the modern society. Security is extremely important because destruction of the systems would
have very bad consequences.

There are two major threats. The first one is unauthorized access to software, be it human access or
intentionally induced changes, virus infections or other problems that can affect the control host
machine. The second threat is related to the packet access to network segments that host SCADA
devices.

In numerous cases, there remains less or no security on actual packet control protocol; therefore, any
person sending packets to SCADA device is in position to control it.

Often SCADA users infer that VPN is sufficient protection, and remain oblivious to the fact that physical
access to network switches and jacks related to SCADA provides the capacity to bypass the security on
control software and control SCADA networks.

SCADA vendors are addressing these risks by developing specialized industrial VPN and firewall solutions
for SCADA networks that are based on TCP/IP. Also, white-listing solutions have been implemented due
to their ability to prevent unauthorized application changes.

APPLICATIONS OF SCADA:

1) Application in Power Plants:

A group of Hydro and Gas generation plants when the load demand exceeds the generating capacity.
These plants are considered as peak load plants because these plants can start in no time and deliver
power to the grid.

These plants are located in the remote locations. These plants are controlled by opening and closing the
valves of turbines so that they can deliver the power in peak conditions and can be kept on standby
during normal load conditions.

2) Application in Oil and Gas Plants:

Many process control parameters, motors, pumps, valves are spread over the wide area in the field.
Control and monitoring applications include turning on and off motors, pumps, valves and gathering
information of process parameters (like flow rate, pressure, temperature) continuously and taking
certain decisions can be done through SCADA systems.

3) Applications in Pipelines:

Pipelines carrying oil, gas, chemicals and water which are located at varying distances from the plant
needs continuous monitoring and control.

Control includes opening and closing the valves, starting and stopping the pumps. Monitoring the flow
rate and other parameters to avoid leakage in the pipeline by acquiring the data and carrying out
suitable controls is done through SCADA systems.

4) Applications in Power Transmission:

Electrical power transmission which is spread over thousands of kilometres can be controlled by opening
and closing the circuit breakers and other functions. This is done in master control substation which can
control the other substations through SCADA systems.

5) Application in Irrigation System:

Irrigation systems which are spread over wide area can be controlled by closing and opening the valves,
gathering the meter values of amount of water supplied and taking the control actions can e done
through SCADA systems.

Ladder Programming Basic


One of the best visual programming languare is a PLC programming language called ladder logic or
ladder diagram (LD).

The great thing about ladder logic is that it’s much more visual than most programming languages, so
people often find it a lot easier to learn.

The smart thing about ladder logic is that it looks very similar to electrical relay circuits. So if you already
know a little bit about relay control and electrical circuits, you can learn ladder logic even faster.

But that’s definitely not a requirement, and I myself didn’t understand relays when I frist learned ladder
logic.

In this ladder logic tutorial, you will learn everything you need to know about the ladder diagram PLC
programming language. You will be able to start making real PLC program with ladder logic in almost any
PLC programming software.

After reading this tutorial I strongly recommend that you continue with part 2 of the course. If you want
to deepen your understanding further, you can also take an online PLC programming course.

What is Ladder Logic?

Ladder logic (also known as ladder diagram or LD) is a programming language use to program a PL
(Programmable Logic Controller). It is a graphical PLC programming language which expresses logic
operations with symbolic notation. Ladder logi is made out of rungs of logic, forming what looks like a
ladder – hence the name ‘Ladder Logic’.
Ladder logic is mainly for bit logic operations, although it is possible to scale a PLC analog input. Even
simple bit logic operations can be beneficial in more advance PLC programs and SCADA system
programming.

The people or the organization that sets the standards for ladder logic is PLCOpen. Ladder logic is not
only a programming language for PLC’s. It is one of the standardized PLC programming languages. This
simply means that ladder logic is described in a standard. That standard is called IEC 61131-3. But for
now, the only thing you need to know is that there is a standard describing this programming language.

Introduction to Ladder Logic

To get you started with ladder logic there are few things you should know about the programming
language. You should know why ladder logic was invented because then it will be much easier for you to
understand it. Especially if you have prior experience with electrical circuits and relays or some Boolean
logic.

Invented for Technicians

Ladder logic is a graphical programming language which means that instead of text, the programming is
done by combining different graphical elements. These graphic elements are called symbols.

One of the smart things about the ladder logic symbols is that they are made to look like electrical
symbols. Ladder logic was originally created for technicians, electricians, and people with an electrical
background. People who are used to look at electrical diagrams and schematics.

Take a look at the symbols and see if you think they look familiar. Just as in electrical diagrams ladder
logic have symbols for contacts and relays (which are called coils in ladder logic). The symbols may look
a little different from the ones you find in electrical schematics, but they have almost the same
functions.

If you’re a technician who works with PLCs a lot (or are a budding technician who will be working with
PLCs a lot).

How to Read Ladder Logic

Another difference between ladder logic diagram and electrical schematics is the way they are drawn.
Where electrical schematics are often drawn horizontal, ladder logic diagram are drawn vertically.

The best explanations for drawing ladder logic vertical instead of horizontal I can give you are these:

1. Easier to read

First of all, it makes ladder logic easier to read because it is natural for the eye to go from the left to
right and then down to the next line. Just like when you are reading. Course, this applies only to people
living in countries where the reading is done from left to right.

2. Drawn on computer
When you draw ladder logic on a computer you will make one line at a time. As you draw more and
more line (in ladder logic called rungs) they will stack on top of each other , making up what looks like a
ladder. The best way to look at a large ladder diagram with many line is to scroll vertically along with the
screen.

3. Order of execution

The last reason for drawing ladder logic vertically is to set the order of execution. The order of execution
is how the PLC will run your ladder logic. To be more precise in what order your ladder logic instructions
will be executed by the PLC. A PLC will always start at the top of your ladder logic and then execute its
way down.

Relay Ladder Logic

As I said before ladder diagram can look a lot like electrical schematics going vertical. Most people learn
to draw ladder logic diagrams this way – by building them as electrical schematics. But there are some
differences. This is why I will advise you to learn it in a different way.

I will explain this way in this ladder logic tutorial.

The problem here is that electrical control systems and the PLC work in different ways.

Here are the biggest differences:

- The PLC takes one ladder logic line (rung) and executes that and then goes to the next line
- In electrical systems, multiple lines (current pathways) can be executed (activated) at the same
time

With these crucial differences in mind, let’s get into it. It’s time to learn some ladder logic.

Ladder Logic Basics

The first thing you will see when you create a new piece of ladder logic is two vertical lines. It is in
between these two lines your ladder logic goes. When you draw ladder logic, you will draw vertical
connections between these two lines. Each of those is called a rung. Just like on a physical ladder.
In these rungs, you can put any of the ladder logic symbols to create the logic you want. As you can see
above, I have put numbers on each rung. This is to understand how the PLC hardware will execute the
ladder logic. You may be familiar with the PLC scan time or scan cycle. Roughly said, the PLC will first
scan all its inputs, then execute the program to set outputs.

But how does the PLC execute our ladder logic?

One rung at a time.

This might be one of the most important rules of ladder logic. The PLC only executes one rung at a time,
then executes the next. In fact, the PLC only executes one symbol at a time.

Ladder Logic Programming with Instructions

Each symbol in ladder logic is an instruction. This can, in the beginning, be rather confusing. But don’t
worry. I will explain this with simple examples. Let me start by giving you a simple example. In this first
example, you will be introduced to the two first ladder logic symbols.

So what are these instructions or symbols?

They are basically logic instructions, that make you able to create a piece of logic. That piece of logic is
our ladder logic or PLC progam. I you take a closer look at the example below, you will see two
instructions (symbols).
You can check out my video tutorial, and see how the basic PLC instructions work. I would still
recommend you to finish this tutorial anyway since the video only gives you basic coverage.

Examine if Closed

The first instruction here is called examine if closed. The symbol for the instruction looks like this.

This is a conditional instruction. It means that you can use it to check if something is true. For example,
check if a bit is on.

As you can see there is name above the instruction symbol – 10.0.

This is the address of the specific bit, this instruction will examine. In this case, a digital input. It could
also just be an internal memory bit or even an output.

Examine if closed is also known as normally open. It works basically the same way as a normally open
contact in an electrical circuit. Of course, the normally open contact has no memory bit as a condition.
The condition is whether the contact is activated or not. So the condition could be a finger pressing a
button.
The main point here is that each instruction has to be assigned an address in the PLC. Yes, inputs and
outputs are also bits of memory in the PLC. In the example above, the examine if closed instruction has
been given memory address 10.0 as a condition. This address belongs to the first input of the PLC.

Here’s how it works:

- When the PLC scan cycle starts, the PLC will check the states of all inputs.
- It will then write in memory the Boolean value for these states (0 or 1).
- If an input is LOW the bit will be set to 0.
- And if the input is HIGH the memory bit will be set to 1.

Output Coil

The instruction itself even has a place in the PLC memory. What the PLC will put there is the result of the
instruction. To see what the PLC uses that result for, we have to look at the next instruction:

An output coil is used to turn a bit on and off.

As you can see, the symbol is placed on the right side of the rung. This means, that all the instructions
that come before (in the same rung) act as a condition for that instruction. In our example that will be
the result of the examination if closed instruction.

Let’s check out what the results of that instruction could be, to see how it works:

1. PLC scan | Inputs  IO byte


2. Program runs | IO.0  XiC result
In the animation above you can see the PLC first scans all its inputs. The states of these inputs are then
saved in a memory byte is just 8 bits next to each other. For now, you don’t have to think too much
about it. But placing the bits next to each other is very smart. I’ll come back to that later.

When the PLC has the states of all inputs saved, the program will start to run. The first instruction to be
executed is the examination if closed (normally open). The result of this instruction will be the same as
the state of the memory bit.

It makes sense to call the instruction normally open. In a normal state (where the memory bit is 0) the
contact will be open, and the result is 0. But if the memory bit is 1 the contact will close and yield the
result1.

At last let’s look at the output rung:

1. XiC result  Output coil


2. Output coil  Output byte
I the animation above doesn’t work well, you can check out the video animation below. It’s on YouTube
and usually works well:

Now, the output coil uses the result of the previous instruction as a condition. This is called the RLO
(Result of Logic Operation). The RLO is stored in special place in PLC memory. In Siemens S7 PLC’s that
place is called the status word.

A word in PLC terms is 16 bits next to each other or 2 bytes.

The output coil works in a simple way. It simply sets the bit to the same value as its condition (RLO).

In the PLC all the digital outputs are also assigned to bits in memory. We’ll call that the output byte (Q0),
so the bits Q0.0 – Q0.7. The result of the output coil will be put in memory bit Q0.0.

When PLC has executed the whole program, it will set the outputs. The state of each output is set to the
same output is set to the same state as the output bits.

This whole scan cycle is very important to keep in mind when you’re programming in ladder logic.
Otherwise, your program might act a bit strange. This will be illustrated in the next example. At the
same time, you will also learn about 3 other logic instructions.

Output Latch

In the previous example, you learned how to read the state of digital input and set a digital output to the
same state. Let’s say that digital input is a momentary pushbutton. It is called momentary because it as
spring inside. This means, that the pushbutton will only be active as long as you press it.

The ladder program above works just fine. But as you might have noticed, the output will only be active
as long as the input is active. You will have to hold your finger on the button to keep the output
activated. But let’s say that the output controls a fan for a ventilation system. It would not be very
convenient for the operator to hold down the button all the time. We need a way to keep the output
active, even though the operator releases the pushbutton.

In ladder logic there are two ways to do that:

If you are familiar with electrical schematics, you may find this familiar. This is called a latch or a self-
hold.
The name reveals how this work. The coil simply holds itself. Let’s take it step-by-step to see how that
works.

When PLC run this ladder logic program the first time (with the button pressed), the output will be
activated. This is just like the example before. The fun happens the second or third time the PLC run the
ladder logic. Since this is a momentary pushbutton, it will not be active for long. Depending on how long
time the PLC takes to execute the program the button might be deactivated again the second, third or
fourth time.

Let’s jump forward to the first scan cycle where the button is no longer pressed.

The output is still active since the pushbutton was pressed in the last scan cycle. This time the PLC will,
again, read the inputs and save them in the memory byte. In memory bit IO.0 the PLC will now save a
“0”. The first examine if closed instruction with IO.0 as the condition will be evaluated to false “0”.

But as you can see, there’s another examine if closed instruction parallels to the other. But this one hs
the output memory bit as condition. This will, therefore, be evaluated as true or “1”, since the output is
still active. As long as the output memory bit is “1”, the output will be activated. It acts as a condition
for itself.

The reason that the self-holding instruction is put in parallel to the other instruction is to make it an OR
condition. I will come back to that later. Important to know here is that either IO.0 OR QO.0 has to be
true to activate the output.

Examine if Open

Well, congratulations!

You just learned how to make a functioning ladder PLC program. A pushbutton that activates an output.
In our example, this would be connected to a contactor giving supply to a fan. The output then hold
itself.

But there is a practical problem with this program. How do we stop the fan?

We want, somehow to be able to turn off the output again. The simplest way to do that would be to add
a stop push button. The button will be connected to the second input.

Thereby giving it the memory address IO.1.

The question is now: which instruction should we use for the stop button?

And even more important: where should we place it in our ladder logic?

To answer the first question, let me introduce you to another ladder logic instruction:

Examine if open.
Here’s how the examine if open symbol looks like:

This instruction works the exact opposite way of the examine if closed instruction. The result of this
instruction will be an inverted condition. It simply means that, if the condition is “0” the result will be “1.
Vice versa of course, so with condition “1” the result will be “0”.

If you think about it, this is precisely how we want to stop button to work. To turn off the output coil we
must somehow give it the condition “0”.

Now to the second question. Where to place it?

We have to place it after the self-holding instruction. Said in another way – serial connected. Otherwise,
the latch would still give a “1” condition to the output coil when the stop button is pressed.

Now, we end up this ladder logic:

You can see that it invents the condition to the output coil. This will break the latch. To activate the latch
again, the start button has to be pressed.

In the example above I used the examine if open instruction for a stop button.
This is not good practice!

Because in order for the stop button to work when it’s pressed, we have to use a normally open contact
on the button itself. You can read more about why you have to use normally open contact on the button
itself. You can read more about why you have to use normally closed contact for stop buttons in my
article about it. In short, it is to make sure that the system stops when a wire to the button breaks.

After using this good practice our ladder logic look like this:

Although we changed the instruction, the ladder will still work in the same way. It’s because we also
changed the way the physical stop button works.

You now learned how to set an output and hold it until a stop button is pressed. But there are other
ways to do this. Latching is not the only way.

Building Logic with Ladder

Congratulations on making it this far! You’re clearly dedicated to learning PLC ladder logic ( or are
extremely bored).

If this is your first time learning ladder diagram, don’t worry if you’re finding it to be a bit confusing.

Learning something for the first time is always a bit rough. As you gain more exposure to the topic, you’ll
find that concepts that you first found confusing become second-nature.

So – where should you go to learn more about ladder logic and PLCs?

Ladder Logic Tutorial – Part 2

Building Logic

Welcome to the second part of my ladder logic tutorial. In part 1 of the ladder logic tutorial, I
introduced you to the very basics of ladder and to some basic instructions.

In this second part of the tutorial I will teach you how to solve actual problems with ladder logic and
how to use it to build PLC programs. At the same time you will be introduced to several other ladder
logic instructions.
- Set / Reset Coiils
Set or Reset Priority
- Set / Reset Function Blocks
SR Function Block
RS Function Block
- Building Logic with Ladder Logic
Logic Gates with PLC instructions
OR and AND Gates
NOT Logic Gate
Interlocking with Ladder Logic
Ladder Logic Exercise 1: Interlocking
- One shots for Signal Edges
Rising Edge Detection
Falling Edge Detection
Ladder Logic Exercise 2: Rising Edge
Ladder Logic Exercise 3: Falling Edge
- Ladder Logic Exercise 4: Logic

So, let’s get started from where we left in part 1. Latches. In PL programming the latch is not the only
way to hold the state of a coil.

Set/Reset Coils

The next two instructions we’re going to look at are called set and reset. Or in Allen Bradley terminology
latch and unlatch coils. The whole point of these is to free you from using contacts as latching. Thereby
you can set an output in one place in your ladder logic. You can then reset the coil in a totally different
place in your ladder logic.

Let me illustrate how they work:

As you can see the set /reset consists of two coils. A set coil and a reset coil. But even though they are
two separate coils, they control the same bit.
What this means is that when you give a pulse to the set coil, the bit will be set. In contrast to a normal
coil the set coil will keep the bit set even though the conditions before the coil changes. The only way to
reset the bit again is to give a pulse to the reset coil.

When you’re building larger PLC programs with thousands of bits, some even connected to a SCADA
system, make sure you know where you’re setting the bits, and where you are resetting the bits.

Ser or Reset Priority

Building a set / reset function with two different coils introduces a new problem:

Which one of them has the highest priority?

If both conditions for setting and for resetting is true, what will the state of the coil be in the end?

It is important to know about this because even though it’s considered bad programming practice,it can
still happen that both conditions are true. Typically this happens under a fault condition and for safety
reasons it is important to know what then happens.

What the PLC executes last is will be the result.

If you set the coil in one network and reset it with the same condition in a network just below, the coil
will be reset. Remember, the PLC executed ladder logic one instruction at a time – from top to bottom.

If you put the set and reset in different POU’s then the result will come from the last POU the PLC calls
and executes.

Set/Reset Function Blocks

Another way the set / reset functionality can be implemented is with function blocks. They can be used
in not only ladder logic, but also in function block diagram and structured text.

They are pretty straight forward and easy to use. What is smart about these function blocks is that the
set and reset condition are in the same place. But because of this there are actually two different
function blocks that can implement the set / reset functionality.

Each of the two function blocks has different priority for the set and the reset.

Here’s the first one:

SR Function Block

The first function block is officially called a mono-flop with dominant set, but is also referred to as SR or
set/reset function block. This has set as the highest priority which means the output will be set if both
set and reset conditions are true at the same time.
Here’s how the SR function block looks like:

As you can see it has one input for setting and one for resetting. On the other side it has the output.

RS Function Block

The other function block is called RS or a mono-flop with dominant reset. Basically it works in the exact
same way as with the other set / reset function block with one crucial difference.

With this block you will have reset as the highest priority. If both conditions are true at the same time,
the output will be reset as the final result.

Again, this block has two inputs and one output.

Building Logic with Ladder Logic

Now, after you have learned about these new set and reset ladder logic instructions, I think it is time to
start building some actual logic.

Because to be a good PLC programmer in ladder logic is not only to know about the instructions. It is to
be able to solve problems using ladder logic. So let me show you some examples of real world problems
solved with ladder logic PLC programs.

One thing I like to do when solving problems with ladder logic is to thin in conditions. This is more
formally known as combinatorial logic. You have probably even heard about it before. Or at least the
logic gates – AND, OR XOR etc.
Since I already wrote about the logic gates and how they work in the article about combinatorial logic I
will not go into how they work here. What I will rather do is to solve some real world problems using
combinatorial logic.

Logic Gates with PLC Instructions

The first example I want to give is interlocking. Because with simple instructions you can build the logic
required to make up an interlocking functionality.

Interlocking is used in may PLC applications because it prevents things from being active while other
things are active. A well known example of this is the star/delta motor. If you’re controlling that with a
PLC you have to make sure that the output for the star relay cannot be activated if the delta relay output
is active.

Star/Stop Logic Example

Let’s take a look at a simple example of interlocking with two motors, where only one can run at a time.
Each motor has a start and stop button to start and stop the motor.

The start and stop of the motors can be implemented with the latching or set / reset functions I talked
about earlier in this tutorial. In this example I will use the latching using the examine if closed (normally
open) instruction.

You might wonder why I chose the latching over set / reset coils. I did that because with these simple
instructions we can quickly implement the logic.

The first conditions for the start and stop buttons for each motor is of course conditions for the motor to
start or stop. We should look at the conditions for the motor. And since the motor can be in two states,
we need to look at the conditions for both of these states:

START AND NOT STOP

Motor (active)

STOP

Motor (inactive)
Since the motor can only be in two different states we only have to look at the conditions for the motor
to be activated. Because if these conditions are false the motor will be inactive.

We can also add the latching functionality which will be the motors themselves:

START OR MOTOR AND NOT STOP

Motor (active)

What is important to notice here is that we have broken down a function description into logic. Each of
the buttons and the motor represents conditions for the states of the motor. Between these are the
logic relation between them.

Start / Stop Motor Control with Latching

These logic relationship can with ease be implemented with ladder logic. Because each of these logic
relationship can be translated into ladder logic.

OR and AND Gates with Ladder Logic

The logic relationship between the start button and the motor itself is O. Either the start button or the
motor will set the motor active.

In ladder logic the OR logic is implemented with a parallel connection of two instructions:

On the other hand the stop button has to be not pressed for the motor be keep being activated. But the
logic relationship between the start and motor, and the stop button is AND. Because for the motor to be
activated other the start conditions and not the stop button had to be true.

AND logic is implemented with ladder logic as a serial connection of instructions.


One of the major advantages of ladder logic is that you graphically can build logic.

Because if you follow the lines from left to right at each network, you can see the logic relationships
between instructions.

OR always has two options, and thereby to lines. AND only has one option and therefore only one line.

NOT Logic Gate with Ladder Logic

There is still one logic relationship left between the conditions above. For the motor to be active the
stop button has to not be pressed. For this we will use the NOT logic.

NOT logic or negation can be implemented with a negated contact either in the ladder logic or as a
negated physical contact. These are also known as examine if open or normally closed instructions.

As I talked about in part 1 of this ladder logic tutorial, I will not implement the stop button with an
examine if open PLC instruction for safety reasons. Instead, I will use a normally closed contact as stop
button and thereby negating the logic. Said in another way, the physical normally closed contact will
make up the NOT logic for the stop button.

Here’s is how the ladder logic will finally look like after the logic relationships are implemented:
Interlocking with Ladder Logic

Of course this piece of ladder logic is only the logic for one motor. In our example we had two motors.
Therefore the full ladder logic will look like this:

Start / Stop Motor Control of 2 Motors

At least we need to implement the interlocking. And believe it or not – interlocking can also be seen as
logic.

In fact, it is quite simple to implement if you think about it as logic. Because the only thing out motors
need to interlock them is one extra condition. The condition will negated since we need the motor not
to be active when the other is. So for motor 1 to be active, motor 2 needs not to be active and vice
versa.

START 1 OR MOTOR1 AND NOT STOP1 AND NOT MOTOR2

Motor 1 (active)

START2 OR MOTOR2 AND NOT STOP2 AND NOT MOTOR1

Motor 2 (active)

Since we have added one condition more in a logic AND relationship with the other logic, we can
implement it in ladder logic with a serial connection of a negated contact:
Start / Stop Motor Control with Interlocking

This was a simple example of how to build PLC programs in ladder logic by breaking down the problem
into actual logic. But these logic relationships can not only be used with normally open and normally
closed instructions. They can be used with many different PLC instructions – even counters and timers.

Now, the whole point of this tutorial is that you will learn how to build some ladder logi. That’s why it is
your turn now. Just below I made a ladder logic exercise for you to practice.

Go ahead and try to solve the problem. You can use any ladder logic software or you can just draw the
ladder logic by hand. Try to break the exercise down into the logic you’ve learned about in this tutorial.

Ladder Logic Exercise 1: Interlocking

Function: Start /stop of 3 motors, but only 2 motors can run simultaneously. For example if motor 2 and
3 is running, you cannot start motor 1.
I hope you enjoyed and learned something from the first exercise.

This exercise introduced another problem that will lead us to the next ladder logic instructions. The
problem is not so much the ladder logic itself, but rather comes from the buttons connected to the
inputs.

One Shots for Signal Edges

Normally you would expect the operator to press the start and stop buttons only once – and for a short
time. But the operator can hold the buttons pressed for longer time or the button can simply be stuck
when pressed. This is a typical hardware problem that will affect our PLC program.

Rising Edge Detection

Now it is time for another ladder logic instruction. I will introduce you to the first type of one shot
instruction – rising edge detection, R_TRIG or positive edge detection. On some platforms like Allen
Bradley this instruction is known as one-shot rising or just OSR instruction.

As the names imply these ladder logic instructions are looking at the rising edge of a digital signal. This
means that they will only look at the change in the digital signal from 0 to 1.

Here’s an illustration of the positive edges of a digital signal:

The length of the signal is irrelevant, because we’re only looking at the edge or the change in the state
of the signal. And for this reason, these ladder logic instruction for detecting rising edges are perfect for
the start and stop button in the example before.

Positive Edge Contact and Coil

You’ve already learned about the normally open or examine if closed instruction. That instruction is
evaluating the state of bit. If the state of the bit was 1 or true, then the result of the evaluation would
also be 1 or true.

The positive edge sensing contact looks a lot like the examine if closed instruction. In fact, it has the
same symbol except this one has a P in the white space:
Also the functionality is a little different. Because this instruction is not evaluating the state of a bit, but
rather the change in the state of a bit. A positive change or a change from 0 to 1 to be more specific.

Now, since this instruction is only looking at a change in the stated of a bits, this instruction will only
evaluate to true for one scan time. Because if the state or a bit is 0 and in the next scan time it is 1, then
the instruction will evaluate to true.

During the next scan time, the state o this bit will probably still e 1. And since there is no change in the
state of the bit, the instruction will evaluate to 0 or false.

This is exactly the reason these instructions are called one shots. The only evaluate to 1 or true in the
same scan time as the state changes. Here’s how the instruction function in slow motion.

As you can see, this instruction only gives out a pulse in the scan time where the positive transition
happens.

At last, you can also find the positive edge detection as a coil instead of a contact:
It has the exact same functionality except that this is a coil.

R_TRIG Function Block

You can also do positive or rising edge detection with a function block. That one is called R_TRIG and is a
standard PLC instruction. I will not go into details about how it works, since I already described in my
article about function block diagram. It works pretty much the same way as the positive edge contact.

Falling Edge Detection

Just like the positive edge you can also find instruction to detect a negative edge. There are naturally
called negative edge detection, falling edge detection or F_TRIG. Allen Bradley calls it one-shot falling or
just OSF instruction.

Common for all of these instructions is that they are looking for a change in the state of the signal from
1 to 0. Here’s an illustration of a negative or falling edge of a digital signal:

Falling edge detection is a functionality that can be very useful. You can for example use them to detect
when something turn off.

Negative Edge Contact and Coil

You will find the negative edge detection both as a contact and as coil instruction. Again, they are called
one-shots because they are only active in the same scan time as the transition from 1 to0 happens.

Depending on where in your ladder logic you need to detect a negative edge you can use either of them.
A typical application for this instruction is when you need to start something when another thing stops.
It could be a hearing element and two fans for example. When the heating element is running one of the
fans need also to run. But as soon as the heating element turn off, the second fan needs to run for faster
cooling.

You can try to solve this example in ladder logic exercise 3, and see if you can use the negative edge
detection to start the second fan.

F_TRIG Function Block

Again, you will also find a function block for negative or falling edge detection. It is called F_TRIG and it
basically works like the negative edge contact. You can read all about F_TRIG here.

With all this information, I think it is time for some exercises. In my opinion, the best way to learn is to
solve problems. In these exercises you will have to use the rising and falling edge detection. But before
that, there is one last thing you should know.

Remember that the one-shot instruction only were active in one scan time. If you want to use them to
start something that has to run for longer time, you need either a latch or do it with set/reset.
Otherwise you rist only activating the output for one scan time.

Here’s the first exercise to practice with the rising edge detection:

Ladder Logic Exercise 2: Rising Edge

Function: A start and stop button is used for starting and stopping a motor. But make sure that the
buttons can only start and stop the motor on a positive or rising edge.

And for the falling edge detection, here’s another exercise:

Ladder Logic Exercise 3: Falling Edge


Function: A start and stop button turns on and off a heating element and a fan. When the heating
element turns off, the second fan has to start. The second fan will turn off as soon as the heating
element and fan turns on.

These two exercises should have taught you how to use the one-shot instructions to prevent things from
happening more than once.

Before the end of this second part of my ladder logic tutorial I would like to give you one last exercise.
Because in this part you learned all about building logic. So let us see if you can translate a logic
expression into ladder logic:

Ladder Logic Exercise 4: Logic

Function: Implement the following logic for a valve and a motor output:
That was all I had for this second part of my ladder logic tutorial. I hope you learned a bit about building
logic with ladder logic. I will advice you to keep practicing logic and solving problems with ladder logic.
Only in that way will it become a natural for you to build logic solutions.

You might also like