Ladder Logic Examples and PLC Programming Examples
Ladder Logic Examples and PLC Programming Examples
Ladder Logic Examples and PLC Programming Examples
PLC Programming
Examples
Why Use PLC Ladder Logic
Examples?
The reason I use ladder logic examples is one of the big advantages of code. In this
case the PLC programming language ladder logic. You can reuse chunks of a PLC
program in your own PLC program. In fact reusable code is widely used and many
automation projects are build on the ISA-88 or S88 batch control standard which
encourages reusable function blocks. Reusing code can also have advantages when
you’re integrating a SCADA system.
You can “copy and paste” lines of ladder logic symbols from one PLC program to
another PLC program. By doing so, you will shorten the development time of a project.
So that you don’t have to invent everything from the very bottom each time you are
developing a new PLC program. That is why I often make use of PLC program
examples.
I wrote another article where I included examples of PLC analog input and output
programming. If you want to learn ladder logic from the beginning, you should check out
my ladder logic tutorial or maybe even start learning from an online PLC training course.
Simple Ladder Logic Program
Examples
Ladder diagram examples and solutions to simple PLC logic functions. These are
all basic PLC functions implemented in ladder logic.
The start button will activate the relay, or ladder logic relay M10.0. When the start button
is released, the relay will still be activated, because of the latch in ladder rung 2. This
latching will be broken when the stop button is activated.
You might wonder why the stop button in this example is normally open. And the
reason for that, is that you should use normally closed as stop button, to avoid
dangerous situations under failure.
Push on push off logic can be done in several ways. It can be done by using ladder
logic and boolean logic instructions or it can be done with a counter. It can even be
done with PLC rising edge and falling edge triggers or with shift registers.
But… there is a faster way to make the same toggle function with a single push button:
The example is from Mayur Haldankar’s blog about PLC programming and DSP (digital
signal processing). He even has examples of DSP programs written in C++.
In his example, he uses 3 (4) rungs only to make the toggle function of a push button
(simple version):
Generally speaking, you have three types of PLC timers available in ladder logic.
The on-delay timer, the off-delay timer and the retentive timer or pulse timer.