We all know that programmable logic controllers or PLCs are an essential part of automation control hardware that can help us in numerous industries. However, when compared with the first ones or with industrial PCs, today, you can find more efficient, user-friendly, less expensive and smaller ones.

Of course, everything depends on the programming language that you are using for PLC, but the most common one is still ladderlogic due to its convenient way for engineers to understand them with ease.

We are here to present you a brief introduction on this particular programming language so that you can determine whether you would like to go ona paid course or seek free tutorials that would help you in your future job prospects:

How It All Started?

In the previous century, more accurate in '80, people used relay logic with the idea to control the automotive industry. Imagine that you are going to work at a new plant, and you will have to redesign the entire model.

Back in the day, you would have to rewire all relay panels so that you can accommodate it to change that is happening within your plant and industry. During that time, the production had to rest, and engineers had to die to finish everything promptly with the idea to reduce overall expenses industry had due to free time.

You probably know that relay panels feature numerous electromechanical relays that are completely wired together with the idea to perform some function in the plant. For instance, the opening and closing the relay contacts on thepanel gives you the possibility to choose whether you wish to make it on or off during the manufacturing process.

When the cube's mold reaches the position, the switch will energize a relay coil, and that will close the contact due to the injection pump. After a while, the pump will fill the mold with plastic so that you can create appropriate shape per your conveniences.

Back then, people used a combination of relays, switches, contacts,and coils and we can say that all together is Relay Logic. It represents a dependable control's method that we still use in today's industry. Click here to learn more on relay logic and its use throughout the industry.

However, the costs that we have mentioned above associated with mechanical failures, logic changes and extensive wiring have forced most people to find a better and more affordable way to control the production.

That is the moment when PLC entered the market and changed everything.

The Structure of Ladder Logic 

 

The first thing that you should know when it comes to ladder logic is that it uses electrical ladder diagrams that relay logic applies too, but in a completely different way. These diagrams will help you get the appropriate information on how you make connections between devices similarly as on relay panels.

We call them to ladderdiagrams because they resemble a ladder because they feature two vertical rails and one rung between them. The positive power rail is on the left,and it flows directly to the negative power rail, which is on the right. You can see between the physical devices connected on the rung.

Ladder Diagrams VS Ladder Logic

Ladder logic looks similarly as electrical ladder diagrams, but when it comes to logic, the physical contact has to be replaced with memory bits so that software could work based on your preferences.

For this particular program, the relay logic's ladder diagram features duplication with ladder logic, and it contains memory locations instead without the hard-wired idea that was time-consuming in the past. Even though people use memory locations internally, while for others you can combine them with outputs and inputs.

If you want to monitor and control real-world devices, you will have to wire them with input and output modules. When it comes to programmable logic controller features inputs and outputs that we assign as X and Y memory addresses.

Check this link: https://www.techopedia.com/definition/20292/ladder-logic to learn more on ladder logic.

When the contact is open, you will be able to read from the I/O module where you will find a pushbutton. On the other hand, each Y will feature an output device so that you can control it, and it could be light outside the machine. You can also add other locations to internal bits but per your preferences and ideas.

Have in mind that CPU from PLC will provide you witha wide array of functions, and we are not talking only about coils and contacts. You will also gain drum sequencers, shift registers, math and many more that will aid you during the programming efforts.

How to Execute Ladder Logic?

Before you decide to execute the logic, you should understand that CPU has to read the appropriate physical input that you have tied with input/output modules. You should also update their status in the processor's memory table.

We have mentioned above that you should start from the top left, and the processor works that way that you will be able to execute each rung from left to right. In case that you press PB1, the CPU will turn ON, and that means that other part will change states, which will lead to the opening of another CPU that will activate everything and finally enter the fourth rung until it reaches the off.

When compared with other types of programming languages, you should understand that ladder logic functions all at once, so you are not programming line by line, but everything has to be balanced if you want it to finish the work in a matter of seconds.

Even though we use contacts and coils in this particular language, you should have in mind that we are talking about memory presentations and not actual devices. As soon as processor reaches the last rung, it will create an update to real-world output and put it back all over. This particular process will continue as quickly as it is in RUN mode.

Scan time is the time that takes CPU to execute one pass and to get back to the beginning. Scan time is essential for applications that require fast timing, which is why you should program individual purpose input and output modules and subroutines so that you can reduce the scan time.

Published by silv Watson