Book Image

Instant PLC Programming with RSLogix 5000

Book Image

Instant PLC Programming with RSLogix 5000

Overview of this book

RSLogix5000 is a user friendly IEC61131-3-compliant interface for programming the current generation of Rockwell Automation PLCs, which includes Ladder Diagrams (LD), Graphical Function Block Diagrams (FBD), Graphical Structured Text (ST), and Sequential Function Charts (SFC). Instant PLC Programming with RSLogix 5000 captures the core elements of PLC programming with RSLogix 5000 with a minimal investment of time. We will avoid getting into control theory and focus on condensing the information specific to RSLogix 5000. We have selected the key areas of RSLogix and provide a step-by-step approach to teaching them. This book start by follows the steps involved in creating a new RSLogix 5000 project and configuring racks, slots, and channels. Next, we will create routines using the various languages available in RSLogix 5000, troubleshooting and resolving issues we encounter along the way. Finally, we will dive into the advanced features, such as online changes, code generation, task management, and user-defined structures. You will also learn object-oriented PLC programming techniques using advanced features like user-defined types (UDTs) that improve the maintainability, uniformity, and readability of our routines. We also highlight the strengths and limitations of online changes and demonstrate techniques to maximize flexibility. You will learn everything you need to get up and running with RSLogix 5000 as well as best practices used by industry experts.
Table of Contents (7 chapters)

Understanding online changes (Intermediate)

In this recipe, we will introduce the concept of Online Changes in RSLogix 5000. We are going to make an online modification to our VALVES routine by adding logic to check for a power-failure event.

Getting ready

In order to complete this recipe, you will need to have a PLC project that is free from errors, has been downloaded to the PLC, and is Online and Equal.

How to do it...

  1. When you are online on your PLC (if you are not sure how to do this read the recipes Uploading explained (Simple) and Downloading explained (Simple)), right-click on Program Tags, and select New Tag… (or press Ctrl + W).

  2. On the New Tag form that appears, create a new base type tag using the following values:



    • Type: Base

    • Data Type: BOOL

    • Scope: MainProgram

  3. Now, we are going to add our newly created POWER_FAILURE tag to the VALVES Ladder Logic Routine. Open the VALVES routine by double-clicking on it from the Controller Organizer tree.

  4. Now, the tricky part with an online change in RSLogix 5000 is that we cannot make modifications to an existing Ladder Logic that is currently running. However, we can add new Ladder Logic Rungs. So the workaround for editing rung is to copy and paste an existing rung, modify it, and then delete the old rung. So, let's copy the existing rung at position one by right-clicking on it and selecting Copy (or press Ctrl + C).

  5. Next, we will paste our rung under the existing rung by right-clicking on it and selecting Paste (or press Ctrl + V).

  6. After pasting the rung, you will notice that iiiii will appear to the left of the rung indicating that it is pending insertion.

  7. Now that we have added the new rung, we can edit and go ahead and delete the old rung. Right-click on the only rung and click on Delete (or press Delete).

  8. After deleting the old rung, you will notice that ddddd appears to the left of the rung indicating that it is pending deletion.

  9. Now we can make our modification to our newly inserted rung. Choose the rung we have inserted and click on the Examine Off element to add it.

  10. Click on ? above the Examine Off element and associate it with the POWER_FAILURE tag. The following screenshot displays the Examine Off element with the associated tag.

  11. The changes we have made to the routine will not execute until we finalize our program (or accept, test, and assemble it). From the drop-down menu, navigate to Logic | Online Edits | Finalize All Edits in Program (or press Ctrl + Shift + F).

  12. A dialog box will appear confirming that you want to finalize all edits to the program. Click on Yes.

  13. After finalizing the edits, you will notice that the iiiii and ddddd indicators have disappeared and the new logic is now live.

How it works...

Online changes in RSLogix 5000 allow changes to be made to a running PLC without interrupting the code execution or the process it is controlling. In the later versions of RSLogix 5000, it is also possible to make online changes to FBD, ST, and SFC.