▲Wirig Diagram Hot
▲ ▲ ▼

"Basic PLC Programming Examples for Beginners"

By

Embarking on the journey of learning Programming Logic Controllers (PLCs) can be an exciting and rewarding experience. PLCs are the backbone of modern automation, and knowing how to program them opens doors to a wide array of career opportunities. As a beginner, it's essential to start with the basics and build a solid foundation. In this article, we'll explore some fundamental PLC programming examples, using a human-centric approach that balances theory with practical examples.

PLC programming, often likened to learning a new language, requires patience and practice. We'll use the popular ladder logic programming language, as it's widely used and offers a visual, easy-to-understand representation. By the end of this article, you'll have a good grasp of basic PLC programming concepts and be ready to dive into more advanced topics.

Getting Started with Ladder Logic

Ladder logic is a graphical language that represents a PLC program. It's called 'ladder logic' because it resembles a ladder, with 'rails' (power lines) at the top and bottom, and 'rungs' (individual instruction lines) in between. Each rung contains a series of instructions that, when combined, create a program that controls a specific process.

PLC Programming – The ULTIMATE guide for beginners!
PLC Programming – The ULTIMATE guide for beginners!
an image of a computer screen with the words, plc programming courses learn robotics
an image of a computer screen with the words, plc programming courses learn robotics
PLC Basics Explained: Beginner Guide to Industrial Automation
PLC Basics Explained: Beginner Guide to Industrial Automation

To start, let's establish some basic symbols and rules. Here are a few fundamental symbols you'll encounter:

  • Normally Open (NO) Contact: When the condition is true, it closes, allowing current flow.
  • Normally Closed (NC) Contact: When the condition is true, it opens, preventing current flow.
  • Coil: Represents an output, which can cause something to happen (like turning on a light).

Example: Simple Light Control

Let's create a simple PLC program to control a light. The light turns on when a push button is pressed and turns off when the button is released:

an instruction manual for the beginer to learn programming with diagrams and instructions on how to program
an instruction manual for the beginer to learn programming with diagrams and instructions on how to program
Contacts and Coils in PLC Ladder Logic | PLC Training | PLC Tutorials
Contacts and Coils in PLC Ladder Logic | PLC Training | PLC Tutorials
Fundamentals of Ladder Diagrams for PLC Programming
Fundamentals of Ladder Diagrams for PLC Programming
Symbols Meaning
NO (Normally Open) Push button (closed when pressed)
Coil Light output

The ladder logic for this would look like this:

Simple light control ladder logic

Here, when you press the normally open (NO) push button, the light (coil) turns on. When you release the button, the light turns off. Simple, right?

5 PLC Programming Languages Every Automation Engineer Must Know
5 PLC Programming Languages Every Automation Engineer Must Know
PLC Basics Explained: Beginner Guide to Industrial Automation
PLC Basics Explained: Beginner Guide to Industrial Automation
the practical guide to programmable log controllers get the book now
the practical guide to programmable log controllers get the book now
PLC Programming Examples on Industrial Automation
PLC Programming Examples on Industrial Automation
Programmable Logic Controller (PLC) Industrial Applications | Electrical A2Z
Programmable Logic Controller (PLC) Industrial Applications | Electrical A2Z
PLC Programming Tutorial – Ladder Logic Basics for Beginners
PLC Programming Tutorial – Ladder Logic Basics for Beginners

Example: Simple Timer

Now let's introduce a timer. This example demonstrates a light turning on for a specific duration (set by a timer) after the push button is pressed:

Simple timer ladder logic

In this ladder logic, when you press the push button, the timer starts. Once the timer reaches its set value, the light turns on. After the light turns on, pressing the push button no longer has any effect, and the light remains on until the PLC is powered off.

Beginner's Guide to PLC Programming Languages - Learn Robotics
Beginner's Guide to PLC Programming Languages - Learn Robotics
Structured Text Programming: A Step by Step Guide (With Examples) | PLC Academy
Structured Text Programming: A Step by Step Guide (With Examples) | PLC Academy

Understanding Sequences and Variables

So far, we've created simple, single-action programs. In the real world, however, PLCs often control complex processes that require multiple steps or actions in sequence. To handle this, we use variables and sequences.

Variables in PLCs store data during program execution. They can be used to keep track of states, counts, or other dynamic values. Sequences, on the other hand, allow you to control the flow of your program and handle complex, step-by-step processes.

Example: Two-Light Sequence

Let's create a simple two-light sequence. When you press a start button, the first light turns on, and after a delay, the second light turns on:

Two-light sequence ladder logic

In this ladder logic, we've introduced a variable (V[timer]) to keep track of the delay between lights. When you press the start button (S), the first light (Y[light1]) turns on. After the delay set by V[timer], the second light (Y[light2]) turns on.

Example: Counter

Counters are another type of variable that can increment, decrement, or control a specific count. Here's an example of a counter controlling how many times a light toggles on and off:

Counter example ladder logic

In this example, every time you press the push button, the counter (CTU[light_count]) increments by 1. When the counter reaches a specified value (in this case, 5), the light toggles on or off. Once the counter reaches its maximum value, it resets to 0, and the process starts again.

Embracing the journey of learning PLC programming can be a rewarding experience. With each passing day, you'll gain new insights and skills that will pave the way for exciting career opportunities. So, keep practicing, exploring, and seeking out more complex problems to solve. The world of automation is wide open, and PLC programming is your key to unlocking its potential. Now go forth, create, and innovate!

💬 Comments ↗ Share ★ Save
AD