Sunday, July 21, 2019

PLC Communication Protocols




PLC communications has grown and changed over the many years since the controller’s inception decades ago. Industrial needs and technological advances have kept PLC communications evolving, and this post will explore some past and present communication standards, and what the future may hold.

The communication protocol is a set of rules that govern data communication.
In other words, the communication protocol acts as an agreement between two or more communicating devices.
PLCs needs to communicate to a number of different devices. First, there are devices which are part and parcel of the PLC, such as remote I/O. Next, are other PLCs and control devices, such as motor drives and servo controllers. Communication with some type of operator interface device is also often required, as is Internet connectivity. Finally, PLCs often communicate to server level PCs running various manufacturing related applications.

All of these communications require two things:
Physical connection or layer, which is the wiring and connection components, and
Shared protocol, which is the common language allowing each device to understand what the bits and bytes in the communication messages mean.
Back in its infancy, PLC communications were typically proprietary, with each supplier having their own closed connections and protocol. This made communications relatively simple among a single supplier’s products, but devilishly complex if you chose to venture outside the realm.

Following are the different types of communication protocols used in every PLC.
  • Ethernet
  • Profibus
  • RS-232
  • RS-485
  • Multi-Point Interface (MPI)
  • Point to Point (PPI)
  • Data Highway (DH)
  • Control Net
  • Device Net
  • USB Adapter
  • PC Adapter



These are the foremost protocols used for the PLC and other network connections. These protocols are supported by different PLC software brands.
The communication protocols are depended upon three fundamental parts as mentioned below.
1.    Baud rate
2.    Network length
3.    Number of nodes

Baud rate is also known as “Communication speed”.
The rate of data transmission on the network is called Baud Rate.
In simple term, it is calculated as “number of data transferred per second”.
The different types of standard communication protocols support different speed (baud rate), distances (network length) and the number of connecting devices (nodes).
  • If you want to communicate with the more number of nodes with more speed, Ethernet is the best choice.
  • If your network has a length more than 25 Kilo-meter, you should use Control Net protocol


Saturday, May 11, 2019

PLC VS PAC: Similar but not the same.

Programmable Logic Controller (PLC) and Programmable Automation Controller (PAC) are primarily an industrial system that are designed keeping in mind manufacturing environment in a plant. These computers are highly reliable when it comes to gauging the ability to control and monitor industrial processes. PLC’s and PAC’s both utilise protocols and networks such as Ethernet, ControlNET, DeviceNET, and also integrate with software and databases like OPC, and SQL, etc. These systems can be used in combination but, they can be individually characterised. The basic difference lies in the programming interface of the two, making them serve different functions. The PACs are programmed using C or C++, therefore, have an open architecture and incorporate modular design. Whereas, the PLCs have simple program execution. Owing to this, it can scan along with limited memory and discrete Input and Output.
With technology evolving, the difference between the two is seen to be diminishing. However, there is a difference in utility and functionality. Owing to the ease of programming offered by modules, it is easy to attach or detach components from PAC. Moreover, simplified programming makes it capable of monitoring and controlling thousands of input/output (I/O) points. On the other hand, PLCs are wire-based systems and the addition of devices will require additional wiring with them. Since small footprints and compact terminations are hard to wire using conventional methods, the manufacturers are now using prefabricated cable assemblies rather than discrete point-to-point wiring.
PLC’s work well in small-scale automation tasks, like single machine contro(on and off using triggers) or smaller scale building automation (lighting, temperature control etc.). However, PLCs are a natural and cost-effective choice. Whereas, PAC’s are targeted towards more complex and larger scale automation architectures. They are particularly suited for multi-domain monitoring and control. Functions such as; advanced process control, motion control, drive control, vision applications and HMI‘s can be run on a single platform, whilst using PC-based software to program, monitor and collect data.
In a nutshell, both PLCs and PACs are advancing in terms of memory capacity and distributed i/o to suit the plants’ need. Moreover, the modern day PLCs and PACs are connected through Industrial internet of things to ensure real-time transmission of data. With the integration of devices connected through IoT, the manufacturing process is even more streamlined and offers better network connectivity.

Saturday, April 27, 2019

SAFETY PROGRAMMABLE LOGIC CONTROLLERS (PLCs)


A safety programmable logic controller (PLC) is similar to a standard PLC.  It can be used to control and automate different industrial equipments. A safety PLC supports all the functions/applications that a standard PLC does moreover, a safety PLC contains integrated safety functions that allow it to control safety systems as well. A safety PLC is designed to accomplish two important objectives: Do not fail, and, if unavoidable, fail only in a predictable safe way. It achieves these objectives through its redundant microprocessors, eliminating the need for safety relays to create redundancy. It also has built-in diagnostics allowing it to continuously monitor inputs and outputs. In case of internal fault or failure detection a safe shutdown of PLC occurs preventing any damages.
For a PLC to be considered a safety PLC, it must meet a set of rigorous international standards, specifically IEC 61508 – Functional Safety of Electrical/Electronic/Programmable Electronic Safety-related Systems.
For a safety PLC to achieve a safety integrity level (SIL) of three (3), it must be capable of detecting over 99% of potential failures. Some of the testing required determining the diagnostic coverage involves a series of tests like data verification and program flow control. These tests ensure that the PLC stores critical data and verifies the internal functions the PLC executes are in the correct order. In addition, a safety PLCs must undergo software-fault injection testing (carried out to check the healthiness of PLC).

Advantages of a safety PLC compared to a standard PLC:
·         A safety PLC allows for safety control and standard control while a standard PLC only allows the latter.
·         By using a safety PLC to control a safety system, time and money are saved on field wiring since there is no need for safety relays. As a result, a safety system designed around a safety PLC is extremely flexible.
·         It is easy to modify because it simply requires programming changes but does not require any wiring changes or additional relays.
·         Once the safety system has been tested and validated, the safety program in the PLC can be locked and password protected to prevent unauthorized variations. Certain models even support integrated motion over Ethernet, and can be used to initiate safe torque-off function on various types of variable frequency drives (VFDs).

Disadvantages:
·         The upfront cost is higher, so this type of PLC would not be ideal for smaller, simpler applications.
·         Safety PLCs are still a relatively new product with new technology. Engineers and maintenance technicians are unfamiliar with the newer technology so additional training may be necessary for safety PLCs to be used correctly.
·         Delay time in purchasing from local manufacturers as these PLC modules are not easily available at local vendors.

Safety PLCs are still a relatively new concept; they have already found their way into safety applications in industries around the world.


Sunday, April 14, 2019

IoT And SCADA/PLC: Is One Going To Replace The Other?



Industrial IoT and the connected factory concept are hot topics. Yet often, there is confusion among professionals and students in both on and offline discussions around the role of Industrial Internet of Things (IIoT) applications.
Essentially, IoT should be viewed as a technology that is implemented on top of PLC. It makes things like scalability, data analytics, and standardization and interoperability realities.
So, does the Internet of Things replace SCADA/PLC, Supervisory Control and Data Acquisition? With the implementation of IoT, Industry 4.0 and the interaction with the well-established SCADA systems, these questions of uncertainty are being raised more and more.
According to many IoT experts and data scientists Internet of things can surely help in boosting SCADA systems to the next level. Instead of fighting against each other, the two technologies can instead integrate to push industry even closer to the edge.

What is SCADA?
Supervisory Control and Data Acquisition is just as the name suggests. Essentially, it is a system of software and hardware that allows industries to control industrial processes locally or at remote locations, monitoring, gathering and processing real-time data. It also allows direct interaction with smart devices and human-machine interface software and records events into a log file.
So, SCADA is much like IoT. Yet IoT, the shiny new technology, is developing faster than anything we’ve seen in recent years. However, SCADA is still an important concept in the oil and gas industry. Especially when it comes to monitoring offshore or onshore extraction processes or pipeline from a central remote location. It is used similarly in the mining industry to monitor environmental factors and to track assets. Power utilities use SCADA in Energy Management Systems (EMS) as well as Distribution Management Systems (DMS) to optimize the performance of transmission and distribution networks and to protect the grid network. Then, SCADA is also used by railways to control traction power supply, implement train control automation, and manage communication, electrical and mechanical assets at stations.
So, SCADA systems are still predominant within heavy asset industries. With three generations of SCADA – standalone, distributed and networked – some industries are starting to utilize what some known as the fourth generation SCADA application. Some also know this to be the Internet of Things. And, as the fourth Industrial Revolution is upon us, implementing fourth generation SCADA with the revolutionizing technology of IoT seems very fitting.

What is PLC?
One technology that has been running relatively parallel to SCADA over the past few decades is the Programmable Logic Controller (PLC). The PLC is yet another form of technology that is believed to be becoming slightly outdated due to so many IoT developments within Industry 4.0.
The Programmable Logic Controller receives information from connected sensors or input devices, processes the data, and triggers outputs based on pre-programmed parameters. Essentially, a PLC can monitor and record real-time data such as machine productivity or operating temperature. It can also automatically start and stop processes, and generate alarms if a machine malfunctions.
Many of the functions of a PLC operate in correlation to those of SCADA and IoT. However, in Industry 4.0, programmable controllers are still being called upon to communicate data via web browser, connect to databases via Structured Query Language (SQL) and to the cloud via Message Queuing Telemetry Transport.

A partner in IoT
Ease of installation, reduced cost, increased data accuracy and worldwide remote control and monitoring are all things that IoT offers heavy asset industries. However, as IoT is a relatively new technology in relation to SCADA and PLC, its capabilities are naturally adaptable to modern industry demands. That being said, when SCADA began, it allowed manufacturers’ systems to work together in real-time, much like IoT is doing now. Therefore, it’s very much apparent that the strength of SCADA systems and its technological capabilities are still relevant even in industry 4.0.
Currently, IoT is revolutionizing SCADA by offering more standardization and openness. IoT is also providing scalability, interoperability and enhanced security by introducing the concept of the IoT platform. Essentially, both platforms are used to increase overall productivity by integrating smart maintenance. As well as waste reduction, increase in efficiency, a decrease in downtime and the extension of equipment life.
So, while the IoT market is still in early production, it can coexist with SCADA and PLCs. IoT is bringing about a wave of new business models and technologies that are changing the landscape of industrial automation.

Integrate or die
Admittedly, the SCADA platform is lacking particular innovations, otherwise, the need for IoT would be far more subjective. SCADA is currently being influenced by IoT concepts and solutions that are quickly being integrated into SCADA architecture. This is done so seamlessly that we won’t ever notice a difference.
However, SCADA is still currently limited to the factory floor. Data taken from the factory devices are being viewed only inside the plant. Whereas IoT takes that data, offers insights to the user and makes it available anywhere, anytime. This, in turn, enables new business models to be created. Without the supportive innovations that IoT offers the SCADA and PLC platforms, it is possible that these technologies could, down the track, lose some necessity as more technologies come along that don’t consist of the same integrative nature that IoT carries

How IoT can help
If you already have a SCADA system in place, you can integrate the IoT solution with your SCADA system and collect data from a Data Acquisition Systems (DAS) machine. By leveraging the power and scalability of IoT, you can use collected data to create a wide range of reports such as Overall Equipment Effectiveness reports, Production Data reports as well as utility reports (gas, water, power).
In the future, it’s likely that SCADA systems will evolve into those of IoT. Equipment and PLC will become more intelligent and will be able to integrate different cloud platforms. This will enable new security platforms that will further secure any data that is recorded. This means that improvements that will save money can be performed.
SCADA is more about allowing humans to interact remotely with a process. Whereas IoT is generally used as a machine-to-machine communication tool. Rather than something that exists primarily to present information to a human. That is just a small part of its process. IoT ensures that information is shared with both people and machine, rather than just people. In short, it makes sure that everyone and everything is kept in the loop at all times.

The comparative analysis 
In the end, both SCADA and IoT involve sensors and data acquisition. Although they do differ in many aspects, they both share the one common goal. The optimization of use and, eventually, better control over some devices or a process. The whole idea of a smart grid leads to SCADA and IoT integration. As SCADA is not a full control system, rather a computer system that gathers and analyses real-time data, it is useful in monitoring and controlling a plant or industrial equipment. It will gather information about a mishap, transfer it back to a central site and alert the home station. It will then carry out any necessary analysis and control and display the information in a logical and organized fashion for humans to then interpret and use accordingly.
The Internet of Things is made up of a network of physical devices connected via electronic embedding, software setups, sensor-actuators and network connectivity which all act together for the objects to connect and exchange data. IoT allows objects to be sensed or controlled remotely across different networking infrastructures. Therefore, it creates opportunities for more direct integration of the physical world into computer-based systems. This results in improved efficiency, accuracy and economic benefit and also cuts down on human intervention.
Both platforms offer an abundance of advantages, as well as some vulnerabilities. It is predicted that by 2020, 50 billion devices or things will be connected to the internet. Therefore, the dynamics of an Internet-based control system are becoming a living reality. Industry 4.0 is an era in which emerging trend automation and data exchange in manufacturing technologies are allowing for a shift from traditionally implemented SCADA to an IoT implemented one. With SCADA, cyber-physical systems, the Internet of Things, cloud computing and cognitive computing, Industry 4.0 is an era that will change the dynamics of the entire automation industry.



source:https://www.controleng.com/articles/

Wednesday, April 3, 2019

PROGRAMMING LANGUAGES FOR PLC

There are 5 programming languages that are all a part of the IEC (International Electrotechnical Commission) Section 61131-3 Standard. This IEC Standard allows some fundamental rules that standardize PLCs and their languages.
The 5 most popular PLC Programming Languages are:
1. Ladder Diagram (LD)
2. Sequential Function Charts (SFC)
3. Function Block Diagram (FBD)
4. Structured Text (ST)
5. Instruction List (IL)

LADDER LOGIC


 Ladder Diagram is the oldest PLC language. This graphical programming language was modeled from relay logic to allow engineers and electricians to transition smoothly into programming PLCs.
Within Ladder, rungs and rails represent the real world electrical connections. Specifically, the vertical “rails” represent the supply power of the device while the rungs that are connected to the rails are equal to the amount of control circuits.
Input conditions can be written in input terminals, which then impacts the output on the output terminals. The absence of instructions in ladder logic makes it difficult to model motion or batching–understandably so, because ladder logic strictly adheres to the on/off logic of hard-wired relays.

Ladder Diagram Advantages:

·   The rungs allow it to be organized and easy to follow.
·   It also lets you document comments that are readily visible.
·   It supports online editing very successfully.

Ladder Diagram Disadvantages:

The main disadvantage is that there are some instructions that are not available, which might make it more difficult for programming such as motion or batching.

SEQUENTIAL FUNCTION CHARTS


A sequential function chart is a graphical programming language that mimics a flow chart. Int this language we use steps and transitions to get output.
Steps are functions within the program and house events that are activated based on state and other specified conditions.
Transitions are instructions based on true/false values that move you from one step to another.
Branches are used to initiate multiple steps at a time. The branches act like threads where functions can run concurrently.
All of these steps, transitions, and branches are housed in a series of scripts that execute in a procedural manner. The visual nature of the language allows users to monitor processes that both heavily use conditional logic and run parallel instructions. PLCs that are prone to suffering from bottlenecks can be more intuitively maintained and troubleshoot using the chart to follow the logic of the program.

Sequential Function Charts Advantages
·   Processes can be broken into major steps that can make troubleshooting faster and easier. Having a direct access in the logic to see where a piece of equipment faulted.
·   It can be faster to design and write the logic due to the ability to use repeated executions of individual pieces of logic.
Sequential Function Charts Disadvantages:

Even when you consider the advantages of the Sequential Function Charts, this PLC programming Language does not always fit every application.

Function Block Diagram (FBD)


Block based programming languages are a type of graphical language that minimizes code into blocks, which allows for a simple way to create executable commands.
FBD in particular describes a function between inputs and outputs that are connected by connection lines. The logic of the inputs and outputs are stored in blocks. The blocks are programmed onto sheets and the PLC scans these sheets in order or by specified connections between blocks, much like procedural languages.
The I/O focus mirrors that of ladder logic. Yet, the code that the blocks contain allow engineers to develop more complex batch control tasks among other repeatable tasks.

Function Block Diagram Advantages:
·      The Function Block Diagram does work well with motion controls.
·      The visual method is easier for some users.
·      The biggest advantage of Function Block Diagram is that you can take many lines of programming and put it into one or several function blocks.

Function Block Diagram Disadvantages
The code can get disorganized using this PLC Programming Language because you can place the function blocks anywhere on the sheet. This can also make it more difficult to troubleshoot.

INSTRUCTION LIST (IL)


This is the PLC’s equivalent to assembly language. This gives you immediate access to the machine itself, which allows you to write code that is compressed and fast. The code is represented in the manner that the language’s name suggests: in a list of commands.

 

Instruction List Advantages


The Instruction List language is valuable for applications that need code that is compact and time critical.

Instruction List Disadvantages


There are few structuring possibilities with the “Goto” command being one of them.
There can also be many errors that are more difficult to deal with in comparison to many of the other languages that I have previously reviewed.

STRUCTURED TEXT (ST)


Structured Text is a high level language designed to program PLCs. This language is essentially the C++ of the PLC world. Any PLC that requires complex data handling will most likely use ST.
Advantages of Structured Text:

It is very organized and good at computing large mathematical calculations.
It will enable you to cover some instructions that are not available in some other languages like the Ladder Diagram.

Structured Text Disadvantages


·   The syntax can be difficult.
·   It is hard to debug.
·   It is difficult to edit online.


Friday, March 22, 2019

DIFFERENCE BETWEEN PLC, DCS AND SCADA SYSTEMS


Nowadays it is commonly seen that students are often confused between the terminologies of PLC, DCS and SCADA systems and consider them as the alternatives of each other. However all of these systems are developed to cater different needs. Since the PLC was integrated with Analog I/O it crosses the boundary of being just digital and crosses to the realm of DCS in handling Analogs, Bus Systems, Distributed I/O and etc. Also, since the DCS now handles logics of Digital I/O it also crossed the boundary to the realm of PLC.
The detail analysis of both of these systems is discussed below:

PROGRAMMABLE LOGIC CONTROLLERS:


 PLC is a specialized processor/ computer with all the hardware and software to do a specific automation task, say running a plant/factory. This means that all the Field/Real world Inputs are processed by the PLC (using Input interface hardware ) and the same then issues commands to various devices and actuators(via Output interface). This has some Pros and Cons.

Pros:-
1.      As a single processor is working it can easily access all the data / inputs and use it as it requires.
2.      It has a simple architecture and is easier to implement and maintain.
3.      It has reduced hardware and reduced cost.

Cons:-
1.      As all the functions are done by the same processor it increases the loading on the controller. For large systems the processing power required can be too high.
2.      There is no physical segregation for critical application such as protections.
3.      Failure of the controllers (though redundant controllers can be provided) will lead to complete shutdown of the control system. For some applications a true standalone system is required.
4.      If the various areas are far away the cabling cost of inputs and outputs to the PLC can increase too much and for long distance it can be impracticable.

If a standalone system is made for such application then it will be difficult to integrate them in a common SCADA/ HMI/ interface and the spare for maintaining different systems will increase cost.
DISTRIBUTED CONTROL SYSTEM:
DCS can solve these problems. In a DCS the entire logic and hardware is distribute or broken into different microprocessors or Functional groups (FGs) for ease the implementation and provide segregation.

These separate Functional groups (FGs) are linked to the same HMI/SCADA/interface. The entire control of the plant is broken in small groups with each groups having something similar. 
For example:-
The AC/ventilation system can be separated from the production part as it is not related functionally.
If separate FGs need to communicate some signals, the same is done through Hardwire or Network/protocol such as OPC, Modbus, profibus etc. As most of the processing is already done in the other FG the cabling is also reduced.
Protection system and critical systems can be made into a separate FG and this processor having low input and controls can work with low loading and higher speed.
As an engineer working in Control systems, I too find it very confusing when people use the term PLC and DCS interchangeable. This is because DCS are an advanced or a larger implementation of the PLCs. A number of vendors call the same processor as PLC or DCS depending on the execution or architecture used for the application as illustrated.
Now some important aspects of SCADA are discussed below:
SCADA: Supervisory Control and Data Acquisition

1.      DCS is process oriented while SCADA is data acquisition oriented.
2.      DCS is process state driven while SCADA is event driven.
3.      DCS is commonly used to handle operations on a single locale, while SCADA is preferred for applications that are spread over a wide geographic location.
4.      DCS operator stations are always connected to its I/O, while SCADA is expected to operate despite failure of field communications.

Thursday, March 7, 2019

DIFFERENCES BETWEEN PLCs AND MICROCONTROLLERS:




Gone are the days when microcontrollers were the most popular all over. Now PLC has taken charge of the industrial sector world wide and across Pakistan.
All the industries in Pakistan are now using PLC systems in different ways some of the salient features of PLCs are:
PLCs are robust
PLCs are reliable
PLC Architecture is interchangeable
Integration with multiple communication protocols
Extendable I / Os
Availability for redundant architectures
Easy to communicate with HMIs
Easy to maintain
Easy to use Safety PLCs are available for hazardous processes.
While microcontrollers have some drawbacks:

Microcontrollers are not designed to withstand extreme conditions such as PLCs with the roughness and unique ability. This does not make them ready for industrial applications.

Microcontrollers are considered to be of vital importance in industrial applications by the university students a perception which they created during their academic years. However the use of microcontrollers is very limited. I have occasionally seen the role of them in industries. On the other hand PLCs are the main building block of automation and are widely used across whole country in various different industries.
PLCs and microcontrollers are some of the most misunderstood systems. That misconception comes from the fact that most people try to understand them only from a traditional software engineering perspective. They think that since microcontrollers can be programmed in C or C++ (traditional programming languages for traditional software development), then they must behave like traditional software. In reality, they are more like hardware systems, and have issues that are usually faced in hardware design. Since microcontrollers behave like software, and PLCs are programmable devices like microcontrollers, they too must behave like software.
Today we will discuss the brief comparison between these two technologies and try to cater the questions often arises in student’s mind.

Programmable Logic Controller (PLC) defined by NEMA as a digitally operating electronic apparatus that uses a programmable memory for internal storage of instructions for implementing specific functions such as Logic, Sequencing, Timing, Counting And Arithmetic Through Digital Or Analog Input / Output modules.
A PLC system could range from a stand-alone system that can take 10 digital inputs and 10 digital outputs and a few analog inputs and outputs, to a complete DCS that controls an entire plant or field, with tens or hundreds of different modules connected over long distances, multiple processing units and redundant systems.
At the heart of the PLC is ease of use, but not in the manner that one might think. Its ease of use is in terms of deployment and maintenance. Couple that with reliability and scalability and a system that is almost unbeatable.
Pros:
·         Large capacity - The PLC nowadays have a capacity of 2000+ I/Os that is analog and digital combined. This is maintained through a central engineering station for ease of control.
·         Modular Design - The PLC capacity and design can easily modified to suite customer need post implementation stage. This is not feasible with relays or microcontroller based solutions.
·         Distributed architecture - For large application a distributed system can be implement with communication between various PLC using protocols like Modbus, Ethernet and profibus etc.
·         Industrial Grade - PLCs are designed with tolerance to withstand various hazardous condition for Industries such as Electromagnetic interference, high temperature, power fluctuation etc.
·         Safety - PLCs manufacturers also provide safety features such are SIL certification as per customer requirement for Protection/Emergency Shutdown System.
·         Utility - PLCs can interface with a large no of drives and actuators ranging from analog and digital to special type such as speed measurement and RTD/thermocouples etc. These can be done easily by changing I/Os modules and configuring them.
·         Easy Maintenance and Spares - Due to modular design the trouble shooting is easier and the no of spares requirement is reduced and easily manageable.

Microcontroller is a microprocessor with internal input and output and memory i.e. RAM, ROM, PORTS. It needs surrounding circuitry in order to function. It has little or no real-word signal level compatibility (cannot connect it to a thermocouple or a motor directly). It is typically the central building block in a system that is built up along with other components. 
Pros:
·         In case of Microcontroller the programming is somewhat tedious because of machine language.
·         A microcontroller is also a logic controller but used in dedicated systems which are programmed once and for all, the program for which will not be accessed by the user, and whose program will not need to be altered frequently.
·         Microcontrollers Developed for Dedicated equipment.
·         With a microcontroller, you may have to design your own signal interfacing. 



PLC Communication Protocols