Allen Bradley PLC Programming Tutorials | Training in RSLogix 5000
Introduction to Allen Bradley PLC programming
Allen Bradley PLC Programming is a highly desired skill in industrial automation. It’s what allows one to create a set of instructions in order to control different devices, pieces of machinery and entire manufacturing plants. However, there are multiple challenges when it comes to learning PLC programming: high complexity of the platforms, costly hardware & software costs as well as low availability of online materials.
Our goal is to make this skill readily available for engineers and technicians around the world. We believe that with enough dedication, anyone can learn how to work with PLCs and apply this skill toward a rewarding career in industrial automation.
There are many flavors & brands of PLCs: Allen Bradley, Mitsubishi, Omron, Siemens and others. They’re all different, yet similar to each other. We strongly believe that the fundamentals of PLC programming will be reapplicable between platforms. In other words, if you learn how to work with Allen Bradley PLCs, you’ll be able to easily reapply your knowledge toward the Siemens platform. Focus your learning objectives on principles rather than the details of the platform.
In this article, we’ll give you an overview on what it takes to get started in RSLogix 5000 or Studio 5000 which is an environment of programming ControlLogix & CompactLogix Allen Bradley PLCs. It’s heavily utilized within the North American markets and is highly sought after by employers.
RSLogix 500 vs RSLogix / Studio 5000 & Software Licenses
Most PLC programming packages require a paid license. Clients, which include large manufacturing companies, OEMs & Machine Builders, have absolutely no trouble paying for these. However, they are quite inaccessible for those looking to get into allen bradley PLC programming.
An excellent alternative to acquiring these licenses is to find a package which doesn’t require one. Every manufacturer has a package which will be free, feature a limited trial or otherwise. It’s highly recommended to learn through one of these softwares if you don’t have access to the expensive packages through your employer.
In the case of RSLogix or Studio 5000, the alternative would be RSLogix 500. This package comes in different license levels. However, it can be downloaded for free; the process was described by us on the following page: Download RSLogix 500 for Free.
Students become discoraged by the fact that there seems to be a major difference between RSLogix 500 and 5000. However, that isn’t the case. The tag names as well as the UI presented will differ, but the fundamentals of PLC programming remain the same. If you can confidently say that you’ve mastered PLC programming concepts in RSLogix 500, you won’t have any trouble applying these skills to RSLogix or Studio 5000.
Understanding the PLC Programming Interface of Studio 5000
The first challenge you’ll be faced with is understanding the programming environment or User Interface (UI). Before you dive into programming instructions, it’s recommended to navigate around the screen and learn about the tools available to you.
The image above represents the Studio 5000 environment toolbar. Wtihin this toolbar, you will find the standard tools available within most software tools: Open, Save, New, etc. However, the toolbar is also the place you’ll find a lot of PLC specific instructions, communication environments & more. As you build your skills in allen bradley PLC programming, you’ll start using these more and more.
On the left side, one of the most important status windows is displayed. The software indicates the satus of the PLC which is currently set to “Rem Run”, tells us that the PLC is in “Run Mode”, the Controller is OK, etc. In short, we’re online with an actual PLC & everything appears to be OK.
Lastly, the bottom right section contains a set of instructions which are used in PLC programming. They are separated in different sections such as “Favorites”, “Add-On”, “Safety”, etc. As you utilize the interface, it will become more obvious where to locate the tools you need and what they’re used for based on their location within the environment.
The controller organizer is perhaps the most important piece of the RSLogix / Studio 5000 Interface. It consists of key sections which give the programmer access to the tag databases as well as the programs which are executed by the controller.
From top to bottom we have the Controller Tags, Tasks, Motion Groups, Add-On Instructions as well as Data Types. These components are critical in PLC programming.
The “Tasks” folder is particularly important as it contains every task the controller will be executing. Inside of this folder, you will find an array of tasks of different types. A single task can be defined as continuous. In other words, as soon as it’s finished, it will re-execute. Other tasks will be defined as periodic. A periodic task will execute based on the priority as well as the timer assigned to it. It’s important to understand these nuances, especially in high-speed applications, as tasks will be dropped as their priority decreases and as you schedule more tasks within a smaller time period.
Under each Task, you’ll find programs. There’s no special benefit to separating your routines into programs beyond ease of programming and troubleshooting. Programs can be scheduled or unscheduled. These two states will indicate to the PLC weather to execute or ignore a specific program.
Lastly, we have routines within the program. A routine is the component which contains the code of the program. A routine may be written in “Ladder Logic”, “Functon Block Diagram”, “Sequential Function Charts” or “Structured Text”. These formats are different and should be used according to the requirements of the software. However, Ladder Logic is the most utilized standard primarily for historic reasons.
Creating Rungs and Tags in Ladder Logic
At this point, we can proceed to creating our first routine. The routine will contain a single rung with two most basic instructions: XIC Instruction and OTE Instruction. A rung can be placed onto the canvas by clicking the empty space and selecting “Insert New Rung”. It can also be added to the routine by clicking the appropriate shortcut in the menu above the routine programming region.
Once the run is in place, we can drag the instructions onto the UI or we may select the rung and click the appropriate icons. We’ve seen programmers do it either way. However, clicking the icon seems to save a few seconds. Now that the instructions are in place, they require us to configure the tags which will be tied to them. In both cases, the structures required by the XIC and the OTE instructions are Booleans or BOOLs. This type of a datastructure represents a binary value which may only be set to a 0 or 1; or a LOW or HIGH.
The most straightforward way to create both of these tags is to add a label above each instruction. Once that’s done, you may right click the name and create a new tag. Verify the name, usage, type as well as the scope of the tag. For the purposes of this tutorial, Make sure that the Usage is set to “Local Tag”, the Type is set to “Base”, the Data Type is set to “BOOL” and the Scope set to “PLC”. Click Create.
Executing a Specific Routine
As mentioned above, a program may have multiple routines. How does the PLC determine which routine to execute at a specific time?
The order is determined by the programmer through various instructions within the program. Although it’s possible to jump between routines in any order, it should be obvious what was the intention based on the main routine. A main routine is assigned to each program and will be the first routine to execute. As the PLC executes this routine, you may add a JSR instruction with a pointer to another routine in order to execute it. Once the specified routine finished executing, the PLC will return and complete the original routine. Based on this sequence, it’s advisable to create all the JSR instructions in a sequential order. This practice makes sure that the next person who’s troubleshooting your code isn’t lost and can easily follow the flow of the program.
In this tutorial we went over the basics of ladder logic programming within the RSLogix / Studio 5000 environment. We’ve learned the basics of the User Interface, how to navigate the different panels available to us and how to get started with a basic routine which executes a single rung of logic. We’ve briefly touched on the concepts of adding XIC and OTE Instructions to a rung as well as specifying the tags associated to them.
Watch the video below to gain further insights into the process as well as a complete overview on how to load the program into the PLC and execute what we’ve built in this tutorial.