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)

Exporting programs (Simple)

In this recipe, we will demonstrate how to export a program to an XML-based (Extensible Mark-up Language) L5X file for manipulation or reporting.

Getting ready

In order to complete this recipe, you will need an RSLogix 5000 program to export.

How to do it...

  1. From RSLogix 5000 Controller Organizer, right-click on a program and select the Export Routine… option.

  2. Use the Export window file browser to select a location on your computer to save your L5X file. Click on the Save button to store the L5X file on your computer.

  3. Open the L5X on your computer using Notepad by right-clicking on the file and selecting Open With…; then select Notepad from the list.

  4. View the XML file in Notepad.

How it works...

The L5X file is an XML-based representation of your program. The L5X file can be used to make widespread changes to your program, for reporting purposes, or for importing by third-party products. More information about importing and exporting programs from RSLogix 5000 can be found in the Rockwell publication Logix5000 Controllers Import/Export Project Components available at

There's more...

The L5X file can also be easily modified and re-imported into your project.

Importing an L5X

You can use the L5X file to modify your program and re-import it into your project. For example, if there are repeated parts of your plant, you can perform Find / Replace of the tags that will change between each area using Notepad. Once your changes are in place, you can re-import the L5X file by right-clicking on Controller Organizer and selecting the Import Routine… option, and then navigating to the L5X file you wish to import.

The Import Configuration window provides you with a wide range of options for importing your routine into your project as shown in the following screenshot: