181200719-PLC-Programming-With-RSLogix-500.pdf

Share Embed Donate


Short Description

Download 181200719-PLC-Programming-With-RSLogix-500.pdf...

Description

PLC Programming with RSLogix 500

How to Program an Allen-Bradley SLC 500 with Rockwell Automation’s RSLogix 500 By Jack Rindell modernmediaonline.com Copyright 2008 Modern Media

Contents Introduction ..................................................................................................................... 4 PLCs ............................................................................................................................... 5 Hardware......................................................................................................................... 6 SLC Rack..................................................................................................................... 6 SLC Power Supply ....................................................................................................... 6 SLC Processors ........................................................................................................... 6 SLC I/O Modules.......................................................................................................... 7 MicroLogix 1000........................................................................................................... 7 MicroLogix 1200........................................................................................................... 7 MicroLogix 1500........................................................................................................... 7 Software .......................................................................................................................... 8 Getting The RSLogix 500 Software.............................................................................. 8 Downloading the RSLogix 500 Starter Software .......................................................... 9 Downloading The RSLinx Lite Software....................................................................... 9 Ladder Logic ................................................................................................................. 11 The Dialect of PLCs ...................................................................................................... 11 Equivalent Logic ............................................................................................................ 15 Scan Time.................................................................................................................. 16 Project Scope................................................................................................................ 17 Summarizing the Scope ................................................................................................ 23 Which PLC? .................................................................................................................. 23 Lay Out The I/O............................................................................................................. 24 Laying Out The Modules In The Rack ........................................................................... 26 Assigning I/O Addresses ............................................................................................... 27 Analog Inputs ............................................................................................................. 27 Digital Inputs .............................................................................................................. 28 Digital Outputs ........................................................................................................... 29 Installing RSLogix.......................................................................................................... 30 Installing RSLogix 500 ............................................................................................... 30 Running RSLogix .......................................................................................................... 31 Configuring Colors, Fonts and Address Display......................................................... 36 Adding Descriptors To Your I/O ................................................................................. 37 Writing the Program ...................................................................................................... 40 Setting Up An Overall Control Rung .......................................................................... 40 Starting a Batch Cycle ............................................................................................... 43 Batching Steps........................................................................................................... 48 Step 1 – Adding City Water........................................................................................ 48 Analog Inputs ............................................................................................................. 51 Setting up an SCP to calculate Tank Weight ............................................................. 54 Setting Up An SCP To Calculate Tank Level ............................................................. 56 Back to Batching – Step 1.......................................................................................... 57 Step 2 – Adding Chemical KM ................................................................................... 60 Step 3 – Adding Chemical KM ................................................................................... 64 2 PLC Programming with RSLogix 500 How to Program an Allen-Bradley SLC 500 with Rockwell Automation’s RSLogix 500 Copyright  2008 Modern Media modernmediaonline.com

Step 4 – Blending....................................................................................................... 65 Step 5 – Pump to Filling Lines ................................................................................... 70 Faults ............................................................................................................................ 72 Valve Position Faults ................................................................................................. 72 Console Status Indicators – Pilot Lights ........................................................................ 81 Adding Rung Comments ............................................................................................... 85 Expanding the Data tables ............................................................................................ 89 Connecting To The SLC And Going Online................................................................... 93 Run Mode.................................................................................................................... 106 Editing in Run Mode .................................................................................................... 113 A Final Note About Our Program ................................................................................ 121 How Do I . . . ? ............................................................................................................ 122 Tips, Shortcuts and Warnings ..................................................................................... 124 Conclusion .................................................................................................................. 129 Index ........................................................................................................................... 130

3 PLC Programming with RSLogix 500 How to Program an Allen-Bradley SLC 500 with Rockwell Automation’s RSLogix 500 Copyright  2008 Modern Media modernmediaonline.com

Introduction The purpose of this book is to teach you how to set up, program and use an AllenBradley SLC 500 PLC. It will tell you what parts you need to buy for a common application. It will tell you how to install RSLogix, how to write a ladder logic program, how to configure your computer and your SLC so that you can download your ladder logic program. There is a sample project included that contains a Project Scope. The Project Scope (or Functional Specification, or whatever your company might call it) defines in detail how the system is to operate when the project is finished. You will learn how to take a Project Scope and turn it into a working PLC program. It will show you, step by step, how to go online with your SLC to monitor your program to verify your ladder logic and make sure it is functioning properly. It will show you how to make changes to your program while you are online. It will show you the keystrokes and mouse movements that you need to know to use RSLogix. Finally, it provides a number of tips and a Frequently Ask Questions section that will save you hours of frustration. This book assumes you have a little background with PLCs – perhaps you have worked with other PLCs from other manufacturers or you have helped to install and wire PLCs. Perhaps you are a Mechanical or Process Engineer and you need to learn how to use RSLogix. If you need a more thorough understanding of basic PLC concepts, you might want to try the Beginner’s Guide to PLC Programming How to Program a PLC (Programmable Logic Controller). This ebook, along with the online tutorial, provides an example of how to automate a drill press, while explaining all the basic concepts of PLC programming that are necessary to write a solid PLC program. The Beginner’s Guide to PLC Programming works well in conjunction with this book, in that it concentrates on basic PLC programming methods that are common to all types of PLCs. In addition, it provides an example of machine operation, whereas PLC Programming with RSLogix 500 uses the example of a chemical batching process. 4 PLC Programming with RSLogix 500 How to Program an Allen-Bradley SLC 500 with Rockwell Automation’s RSLogix 500 Copyright  2008 Modern Media modernmediaonline.com

It is available from Modern Media for $9.95. Visit www.modernmediaonline.com if you would like to learn more about this book.

PLCs Nearly all the industrial equipment that you find in a modern manufacturing facility shares one thing in common - computer control. The most commonly used controller is the PLC, or the Programmable Logic Controller, using a programming language called Ladder Logic. The language was developed to make programming easy for people who already understood how switches, relay contacts and coils work. Its format is similar to the electrical style of drawing known as the “ladder diagram”. The most popular and most widely used manufacturer of PLCs is Rockwell Automation, who produces the Allen-Bradley MicroLogix and SLC series of PLCs. The MicroLogix and SLC families of processors and I/O modules are all programmed using Rockwell’s proprietary software known as RSLogix. In the book, we will concentrate specifically on the SLCs, MicroLogix PLCs and RSLogix. We won’t talk about other manufacturers or other Rockwell software, as RSLogix will (and currently does) perform nearly all the programming requirements of a plant’s automation system. When you are finished with this book, you will be able to sit down in front of any computer running RSLogix and create a new program. You will be able to edit existing programs. You will be able to professionally document any changes you have made. Rockwell Automation Technical Support Unfortunately, we can’t anticipate all the problems you might face as you are troubleshooting a program on the factory floor. There are just too many variables. This is why you must establish a relationship with your local Rockwell Automation technical support team. Get to know them before you are in the final stages of a start-up and you run into a problem. They are very helpful and they can save you hours of frustration. The Rockwell reps are not just technical support personnel; they are skilled engineers that are responsible for running their own projects and writing and troubleshooting their own programs. If you run into a problem, more than likely they have already seen it and have come up with a solution.

5 PLC Programming with RSLogix 500 How to Program an Allen-Bradley SLC 500 with Rockwell Automation’s RSLogix 500 Copyright  2008 Modern Media modernmediaonline.com

Hardware One of the nice things about Allen-Bradley’s smaller PLCs is the relative simplicity of assembling the hardware to create a system. First, let’s see what it takes to assemble an SLC 500 system. You only need to have a few components: a rack, a power supply, a processor and some I/O modules.

SLC Rack These come in four configurations, with varying capacity for installing the I/O modules. 1746-A4 1746-A7 1746-A10 1746-A13

4-Slot chassis 7-Slot chassis 10-Slot chassis 13-Slot chassis

A rack is a frame that holds the modules of an SLC 500 system. It is similar to the motherboard and case in your personal computer. It provides a physical structure to hold the modules that create a system, like your computer’s case. It also provides an electronic back plane that allows modules to communicate and interact. In an SLC system, the SLC 500 processor always resides in Slot 0, which is the first slot.

SLC Power Supply Power supplies come in varying capacities. 1746-P1 1746-P2 1746-P3 1746-P4 1746-P5 1746-P7

SLC Processors There are five SLC 500 processors available: SLC 5/01 SLC 5/02 SLC 5/03 SLC 5/04 SLC 5/05 6 PLC Programming with RSLogix 500 How to Program an Allen-Bradley SLC 500 with Rockwell Automation’s RSLogix 500 Copyright  2008 Modern Media modernmediaonline.com

The 5/01 is the most basic processor, with each succeeding model having more capabilities. The most important difference is found in the SLC 5/05, which has the capability of Ethernet communications.

SLC I/O Modules There are an incredible amount of I/O (input/output) modules available for the AllenBradley SLC family. There are 4-20mA and 0-10VDC analog modules. There are digital (also known as discrete) modules that work in a variety of voltage configurations and capacities. Use the link below to download Allen-Bradley’s literature on the SLC 500 systems: http://literature.rockwellautomation.com/idc/groups/literature/documents/sg/1747sg001_-en-p.pdf Use this link to find manuals regarding Allen-Bradley PLCs: http://literature.rockwellautomation.com/idc/groups/public/documents/webassets/browse _category.hcst Let’s see what it takes to assemble a MicroLogix System.

MicroLogix 1000 The MicroLogix 1000 is a self-contained unit that offers up to 20 digital I/O points and 5 analog I/O points. It differs from the SLC family in that it is just one physical unit.

MicroLogix 1200 The MicroLogix 1200 is a modular unit, allowing you to customize and expand your I/O. The highest capacity racks provide space for four additional I/O modules.

MicroLogix 1500 The 1500 continues in that theme with six expansion slots, providing over 256 I/O points and a couple of counters and outputs.

7 PLC Programming with RSLogix 500 How to Program an Allen-Bradley SLC 500 with Rockwell Automation’s RSLogix 500 Copyright  2008 Modern Media modernmediaonline.com

A full description of the MicroLogix family can be found on Rockwell’s site at the link below. http://literature.rockwellautomation.com/idc/groups/literature/documents/br/1761br006_-en-p.pdf

Software All the SLC and MicroLogix processors use RSLogix software to program the PLCs. Admittedly, the software is a bit pricey, but in my opinion, it is worth it.

Getting The RSLogix 500 Software There is a little known secret, though – Rockwell offers a free version of RSLogix that works with the MicroLogix 1000. There is no copy protection or “trial period” after which the software expires. The downside is that it is limited to the 10 point (6 inputs and 4 outputs) MicroLogix 1000. However, that might be all you need for an application. It is certainly worth downloading the software so that you can gain firsthand experience with RSLogix. Rockwell is currently advertising a MicroLogix 1000, offering “prices that start at only $99”. The advertisement is here: http://www.ab.com/plclogic/micrologix/mlad.html In the meantime, though, download the RSLogix 500 Starter Software here: http://www.ab.com/plclogic/micrologix/1000/RS500starter.html Hopefully, Rockwell won’t have changed any of the links to get this software after this book is published. If they do, use this link on our site to find the page you need: http://www.modernmediaonline.com/plc/rslogix500startersoftware.htm

8 PLC Programming with RSLogix 500 How to Program an Allen-Bradley SLC 500 with Rockwell Automation’s RSLogix 500 Copyright  2008 Modern Media modernmediaonline.com

Downloading the RSLogix 500 Starter Software 1. Use the link below to get to Rockwell’s Software Updates Page. http://support.rockwellautomation.com/WebUpdates/product_list.asp 2. Search or scroll down until you find “RSLogix 500 Starter for 10 Point MicroLogix 1000 Programming Software”. Click on that link. 3. It will take you to a page where you will have to enter your user name to qualify for the update. Fill in your name and click “Qualify for Update”. 4. Select “Option 1: Download All”. Click the button that says “Individual Files”. 5. A window should appear that lists all the files you need. Click on “Save All” to save the files to the folder C:\Rockwell Web Downloads. 6. Go to your desktop and double-click on “My Computer”. Find the folder “Rockwell Web Downloads”. Double-click on that folder. Double-click on “9324RL0050ENE”. It should be the only sub-folder. Double-click on “6.10.00”. Again, it should be the only sub-folder. Find the file “9324RL0050ENE_Core FileSet_1.EXE”. It should be the first one. Double-click on “9324RL0050ENE_Core FileSet_1.EXE”. This unzips the files and creates a folder called “9324RL0050ENE_Core FileSet_Setup”. Double click-on “9324RL0050ENE_Core FileSet_Setup”. Find “setup.exe” and double-click on it. Use the default settings and install the RSLogix starter software. You can now run the program as you would any other Windows program.

Downloading The RSLinx Lite Software If you have a MicroLogix 1000 and you want to connect to it (or connect to an SLC), you will also need RSLinx Lite. You download this in a similar manner. Go to the link below: http://support.rockwellautomation.com/WebUpdates/product_list.asp 9 PLC Programming with RSLogix 500 How to Program an Allen-Bradley SLC 500 with Rockwell Automation’s RSLogix 500 Copyright  2008 Modern Media modernmediaonline.com

and search for “RSLinx Lite Software”. Fill in your name and click “Qualify for Update”. 4. Select “Option 1: Download All”. Click the button that says “Individual Files”. 5. A window should appear that lists all the files you need. Click on “Save All” to save the files to the folder c:\Rockwell Web Downloads. 6. Go to your desktop and double-click on “My Computer”. Find the folder “Rockwell Web Downloads”. Double-click on that folder. Double-click on “9355WAB100ENE”. Double-click on “2.43.01”. It should be the only sub-folder. Find the file “9355WAB100ENE_Core FileSet_1.EXE”. It should be the first one. Double-click on “9355WAB100ENE_Core FileSet_1.EXE”. This unzips the files and creates a folder called “9355WAB100ENE_Core FileSet_Setup”. Double click-on “9355WAB100ENE_Core FileSet_Setup”. Find “setup.exe” and double-click on it. Use the default settings and install the RSLinx software.

10 PLC Programming with RSLogix 500 How to Program an Allen-Bradley SLC 500 with Rockwell Automation’s RSLogix 500 Copyright  2008 Modern Media modernmediaonline.com

Ladder Logic Before we open RSLogix and start programming, there are a few things you need to know about PLCs in general. I have summarized the basic terms and techniques required to work with ladder logic. It isn’t a comprehensive summary, but if you are just starting out, the information here book will be very helpful. Every PLC programmer, no matter what skill level, must know the principles described in this section and the Equivalent Logic section. There is simply no way around it. To effectively write a program, or even edit one, the programmer must know how to visualize the effects of the changes he will make. In other words, you have to be able to look at the logic “on paper” and imagine how the logic will work when it is entered into the PLC.

The Dialect of PLCs Lets' define some terms and symbols: INSTRUCTION – RSLogix’s command language is comprised of “instructions”. An XIC (it looks like a normally open contact --] [-- )is an instruction. A timer is an instruction. A few of the most common instructions are described below. BIT - an address within the PLC. It can be an input, output or internal coil, among others. In RSLogix, there are a couple of ways to show the address of a bit. The default is: [type]:[word]/[bit] For example, an address that references an output of an SLC 500 is O:5/0. That is:

O:5/0 means that it is a physical output. O:5/0 means that it uses Slot 5 (the 6th physical slot) in the rack. O:5/0 means that it is the first output on the card. 11 PLC Programming with RSLogix 500 How to Program an Allen-Bradley SLC 500 with Rockwell Automation’s RSLogix 500 Copyright  2008 Modern Media modernmediaonline.com

Remember that the first slot in an SLC 500 rack is Slot 0. That means a card that is installed in the 6th physical slot is addressed as Slot 5. Allen-Bradley PLC slots, like many computers, always start with 0. By the way, don’t get the capital “O’s” confused with zeroes. RUNG - A section of the PLC ladder program that terminates in an output function of some type. Just like in an electrical ladder diagram, a rung has some type of output that is turned on or turned off by the preceding entities in the rung. The first rung in a ladder program is always 0000. HARDWIRED INPUT - a physical connection to the PLC from an input device (switch or sensor, etc.). Allen-Bradley uses the capital letter “I” to designate a hardwired input. An address that describes an input on an SLC 500 is I:4/0. Similar to the output structure,

I:4/0 means that it is a physical input. I:4/0 means that it uses Slot 4 (the 5th slot in the rack). I:4/0 means that it is the first input on the card. Don’t get the capital “I’s” confused with ones. HARDWIRED OUTPUT - a physical connection from the PLC to an output device (relay or pilot light, etc.) As was said above, an address that references an output of an SLC 500 is O:5/0. INTERNAL COIL This is a programmable bit used to simulate a relay within the PLC. The internal coil has no connection to the outside world. It does not connect to an output card. Internal coils are used to store information. The “contacts” of this “relay” can then be used multiple times in other parts of the program. In RSLogix, the “B3” (binary) file is commonly used for all the internal coils. There are many other words in other files that have bits you can use as internal coils, but we are going to stick with the B3 file for our application.

B3:0/0 means that it references an internal Binary file B3:0/0 means that it uses the first word in the table B3:0/0 means that it is the first bit in the word. 12 PLC Programming with RSLogix 500 How to Program an Allen-Bradley SLC 500 with Rockwell Automation’s RSLogix 500 Copyright  2008 Modern Media modernmediaonline.com

Note that, unlike the Output and Input files, you have to use the file number in the address. In this case, the default file number is 3. TIMER A timer is a programmable instruction that lets you turn on or turn off bits after a preset time. The two primary types of timers are TON for “timer on delay” and TOF for “timer off delay”. Timers in A-B SLC and MicroLogix processors use file 4 for their timers.

T4:0 means that it references an internal Timer file T4:0 means that it uses the first timer in the table The address T4:0 simply refers to the timer. Each timer has bits that turn on after the timing function is complete. You can address this bit by simply putting a “/DN” after the timer address. DN stands for “done”. For example, if timer T4:0 is a TON (timer on delay), then the bit T4:0/DN will turn on after the timer has reached its preset value. COUNTER A counter is a programmable instruction that lets you turn on or turn off bits after a preset count has been reached. There are different types of counters available in the RSLogix, but the CTU (counter up) instruction covers everything we will talk about here. Counters in A-B SLC and MicroLogix processors use file 5.

C5:0 means that it references an internal Counter file C5:0 means that it uses the first counter in the table The address C5:0 simply refers to the counter. Each counter has bits that turn on after the counting function is complete. You can address this bit by simply putting a “/DN” after the counter address. DN stands for “done”. For example, if counter C5:0 is a CTU (counter up), then the bit C5:0/DN will turn on after the counter has reached its preset value.

13 PLC Programming with RSLogix 500 How to Program an Allen-Bradley SLC 500 with Rockwell Automation’s RSLogix 500 Copyright  2008 Modern Media modernmediaonline.com

--] [-- Normally Open Contact When used with a hardwired input, this instruction is off until there is a voltage applied to the input. The bit address then goes high, or on, and the instruction becomes “true.” It works the same way when it has the same address as an internal coil, except that the coil must be turned on by logic in the program. Allen-Bradley calls these normally open contacts “XIC”, or “eXamine If Closed” instruction. An XIC instruction can reference a hardwired input, a hardwired output, an internal coil or a timer done bit, among others. --]/[-- Normally Closed Contact This is an inverted normally open contact. When used with a hardwired input, this instruction is "true" until there is a voltage applied to the input. It then goes low, or off, and becomes “false.” It also can be used with an internal coil, becoming true when the coil is off and becoming false when the coil is on. Allen-Bradley calls these normally closed contacts “XIO”, or “eXamine If Open” instructions. -( )- Output Coil When used with a hardwired output, this function is off until the logic in the program allows it to turn on. It then becomes “true”, and will energize the device that is wired to the respective output. If it is used as an internal coil, it will toggle the instructions associated with it. That is, it will close a normally open instruction and open a normally closed instruction. Allen-Bradley calls these outputs “OTE”, or “OutpuT Energize”. An OTE may be used with a hardwired output or an internal coil. TRUE - An indication the a bit is “on”. If you press a pushbutton switch that is wired to an input, then the bit is said to be true. Also, if the logic in a rung turns on the output of the rung, then the rung is said to be true. FALSE - Without stating the obvious, this is the opposite of true.

14 PLC Programming with RSLogix 500 How to Program an Allen-Bradley SLC 500 with Rockwell Automation’s RSLogix 500 Copyright  2008 Modern Media modernmediaonline.com

OK, that was a lot to cover and for you to understand – don’t worry, this will start getting easier.

Equivalent Logic Suppose we want to use a PLC to operate a pilot light. In its elementary form, PLC logic is very similar to the hard-wired logic you would find in an electrical ladder diagram. For example, if you wanted to turn on a light with a momentary pushbutton, you would wire it like the circuit below. When you press PB1, the pilot light PL1 lights up. H N | PILOT | | LIGHT | | PB1 PL1 | |---] [---------------------------------------(L)----| | | | Now let's do the same thing in an SLC. To duplicate the hardwired circuit on a PLC, you would wire the switch PB1 to input I:4/0 and wire the light PL1 to output O:5/0. The I/O (hardwired inputs and outputs) is set up like this: - There is a “PB1” pushbutton switch wired to I:4/0 of the PLC. - There is a “PL1” pilot light wired to O:5/0 of the PLC. In RSLogix 500, the screen would look like this.

Now let’s examine the sequence of events. When you first turn on the PLC, the PB1 pushbutton is off, or false. Therefore, the PL1 output is off. Pressing PB1 will make I:4/0 true, O:5/0 will come on and the light will be energized. It will stay on only as long as you hold the button in. 15 PLC Programming with RSLogix 500 How to Program an Allen-Bradley SLC 500 with Rockwell Automation’s RSLogix 500 Copyright  2008 Modern Media modernmediaonline.com

Just like electrical current has to flow through the switch to turn on the light in the hardwired circuit, the logic has to "flow" through the normally open instruction (which is “closed” when you press the switch) of I:4/0 to energize the output that turns on PL1. The green highlight indicates the bit, or address, is “on” or “true”.

One nice feature of Allen-Bradley PLCs is that you can document each bit in the program. In the example above, “INPUT1” is somewhat meaningless on its own. After you add the descriptive text “Start Motor PB1”, things make more sense.

Scan Time One critical difference between a PLC program and the equivalent electrical circuit is the issue of scanning. It works like this: The PLC looks at the state of the inputs, and stores that information in a temporary buffer. Then, it ignores what is happening electrically at the inputs. The PLC will use the information in the temporary buffer to execute the logic in the program. It will solve the logic from top to bottom, determining the truth of each rung, and turn on or turn off the appropriate addresses in the temporary buffer. When it reaches the last rung in the program, the PLC will use the data in the temporary buffer to turn on or turn off the corresponding outputs. The scan cycle is complete, and the PLC will once again look at the inputs. The amount of time this takes is called scan time, and is measured in milliseconds. Stated more simply, the PLC reads the inputs, performs the logic and adjusts the outputs as needed. Here’s the difference: An electrical circuit has events occurring simultaneously – a PLC performs its logic in steps. The very best way to learn a programming language is to see a real world application of a working program. You can see how things are done and refer to the program in the future as you write or edit your own programs.

16 PLC Programming with RSLogix 500 How to Program an Allen-Bradley SLC 500 with Rockwell Automation’s RSLogix 500 Copyright  2008 Modern Media modernmediaonline.com

Project Scope We will use a batching operation as an example. Batching, as you may know, is the term that describes the mixing of assorted ingredients to make a finished product. There are techniques that are common to batching, whether you are making soap or cake mix. We are going to write a program that mixes a hypothetical window cleaner. Someone has to define the batching procedure. Usually, this is done by a process engineer or a chemical engineer. If the job of defining the project is done well, a document called a Project Scope (or something similar) is generated. It is extremely important that you clearly understand the entire process that is defined in the scope. If you have any questions or concerns, you need to resolve those before you begin programming. If you don’t, then the responsibility of errors and omissions, and perhaps the blame, may be placed on you. If you bring up questions that result in changes to the defined sequence of operations, ask the originator to revise the Project Scope. In fact, it is not uncommon for a Project Scope to undergo a number of revisions. If there is a change that is not documented in the scope, you should document it by getting an email from the originator that explains the change. If nothing else, you want to make sure you understand what the change involves. For our project, the project scope is as follows.

17 PLC Programming with RSLogix 500 How to Program an Allen-Bradley SLC 500 with Rockwell Automation’s RSLogix 500 Copyright  2008 Modern Media modernmediaonline.com

Hyper-Glass Cleaner Batching Project Scope Goal The goal of this project is to install a new automated batching system for mixing HyperGlass Cleaner. Overview

Three ingredients (city water, ingredient QR and ingredient KM) are added in specified amounts by weight to the Mixing Tank. After all the ingredients have been added to the Mixing Tank, the mixture is blended by running the agitator for a given time. When the blending time is complete, the finished product is pumped to the Filling Lines for bottling and final packaging. 18 PLC Programming with RSLogix 500 How to Program an Allen-Bradley SLC 500 with Rockwell Automation’s RSLogix 500 Copyright  2008 Modern Media modernmediaonline.com

System Components Component Valve AV-CW Limit Switch LS-CW1 Limit Switch LS-CW2 Pump PUMP-QR Valve AV-QR Limit Switch LS-QR1 Limit Switch LS-QR2 Pump PUMP-KM Valve AV-KM Limit Switch LS-KM1 Limit Switch LS-KM2 Scales Agitator MTR-MTA Pump PUMP-MT Valve AV-MT Limit Switch LS-MT1 Limit Switch LS-MT2 Ultrasonic Level Sensor ULS-1

Function Supplies city water to the Mixing Tank Indicates when valve AV-CW is closed Indicates when valve AV-CW is open Pumps ingredient QR to the Mixing Tank Supplies QR to the Mixing Tank Indicates when valve AV-QR is closed Indicates when valve AV-QR is open Pumps ingredient KM to the Mixing Tank Supplies KM to the Mixing Tank Indicates when valve AV-KM is closed Indicates when valve AV-KM is open Provides the current weight of the ingredients in the tank to the PLC Blends the ingredients in the Mixing Tank Pumps ingredient MT from the Mixing Tank Supplies the finished product to the Filling Lines Indicates when valve AV-MT is closed Indicates when valve AV-MT is open Indicates the level in the Mixing tank

19 PLC Programming with RSLogix 500 How to Program an Allen-Bradley SLC 500 with Rockwell Automation’s RSLogix 500 Copyright  2008 Modern Media modernmediaonline.com

Operator Panel Layout

20 PLC Programming with RSLogix 500 How to Program an Allen-Bradley SLC 500 with Rockwell Automation’s RSLogix 500 Copyright  2008 Modern Media modernmediaonline.com

Operator Panel Components Component SYSTEM READY pilot light PL1 SYSTEM FAULT pilot light PL2 START BATCH pushbutton switch PB1 STOP BATCH pushbutton switch PB2 ADDING WATER pilot light PL3 ADDING QR pilot light PL4 ADDING KM pilot light PL5 BLENDING pilot light PL6 PUMPING TO LINES pilot light PL7 E-STOP PB3

Function Indicates the system is ready for batching Indicates the system has a fault and is stopped Starts a new batch Stops the batching process Indicates the system adding water to the Mixing Tank Indicates the system adding ingredient QR to the Mixing Tank Indicates the system adding ingredient KM to the Mixing Tank Indicates the system is blending the ingredients Indicates the system is pumping the batch to the Filling Lines Immediately stops the entire system

Electrical Specifications The Ultrasonic Level Sensor ULS-1 provides a 0-10VDC signal to the PLC. The Scales provide a 0-10VDC signal to the PLC. All other input signals are 120VAC. All output signals are 120VAC. A “dry contact” type of output module is required. Detailed Sequence of Operations To begin a new batch, the operator will verify that the “SYSTEM READY” pilot light is on and that the Mixing Tank is ready to receive ingredients. The operator will then press the “START BATCH” pushbutton to begin the batching process. No further operator input is required. The “SYSTEM READY” pilot light will turn off. Automatic valve AV-CW will open. The “ADDING WATER” pilot light will illuminate. The state of AV-CW will be verified by limit switch LS-CW2. If LS-CW2 is not made within 2 seconds after the valve was told to open, a fault will be generated and the system will shut down. The pilot light “SYSTEM FAULT” PL2 will illuminate indicating that a fault has occurred. 21 PLC Programming with RSLogix 500 How to Program an Allen-Bradley SLC 500 with Rockwell Automation’s RSLogix 500 Copyright  2008 Modern Media modernmediaonline.com

Valve AV-CW will remain open until 1275 lbs. of City Water is in the Mixing Tank. Valve AV-CV will close. LS-CW1 will verify that the valve is closed within 2 seconds after the valve was told to close. If the valve closure is not verified within 2 seconds, a fault will be generated, the system will shut down and PL2 will illuminate. All valves and their respective limit switches will work in the manner described above. After the City Water has been added and LS-CW1 indicates that valve AV-CW is closed, the “ADDING WATER” pilot light will turn off. Valve AV-QR will be opened. The “ADDING QR” pilot light will illuminate. After the valve position has been verified by LS-QR2, PUMP-QR will pump 390 lbs. of ingredient QR into the Mixing Tank. After the ingredient QR has been added to the Mixing Tank, valve AV-QR will close and The “ADDING QR” pilot light will turn off. After LS-QR1 indicates the valve has been closed, valve AV-KM will open. The “ADDING KM” pilot light will illuminate. After the valve position has been verified by LSKM2, PUMP-KM will pump 173 lbs. of ingredient KM into the mixing tank. After the ingredient KM has been added to the Mixing Tank, valve AV-KM will close. The “ADDING KM” pilot light will turn off. After LS-KM1 indicates the valve has been closed, the agitator motor MTR-MTA will start. The “BLENDING” pilot light will illuminate. The agitator will run for 3 minutes. After the agitator is finished, The “BLENDING” pilot light will turn off and valve AV-MT will open. After LS-MT1 indicates the valve is open, the “PUMPING TO LINES” pilot light will illuminate. PUMP-MT will pump the entire batch to the filling lines. When the Ultrasonic Level Sensor ULS-1 indicates that the tank is empty, PUMP-MT will turn off, valve AV-MT will close and the batching cycle is complete. The “PUMPING TO LINES” pilot light will turn off and the “SYSTEM READY” pilot light will illuminate. During every phase of the batching process, the liquid level must be monitored by the PLC. If the level rises to greater than 95% of that Mixing tank’s capacity, the system will generate a fault and the batching process must be halted. The operator may press the “E-STOP” pushbutton PB3 to stop the process at any time. 22 PLC Programming with RSLogix 500 How to Program an Allen-Bradley SLC 500 with Rockwell Automation’s RSLogix 500 Copyright  2008 Modern Media modernmediaonline.com

END OF HYPER-GLASS CLEANER BATCHING PROJECT SCOPE

Summarizing the Scope So, what did we get from the scope? Let’s summarize: First, 1275 lbs. of water will be added to the Mixing Tank. Then, 390 lbs. of QR will be added. The last ingredient is KM, of which we will add 173 lbs. After all the ingredients are in the Mixing Tank, we have to blend it for 3 minutes. After the batch is blended, we will the pump the finished product in the tank to the filling lines. We have to make sure all the valves open or close in less than 2 seconds. If they do not, then we need to shut down the process. We need to turn on the appropriate pilot lights to indicate what stage the batching process is in. We need to make sure the level in the Mixing Tank doesn’t get too high. If it does, we must shut down everything. We need to make sure that the respective valves for the pumps are open before we turn on the pumps.

Which PLC? There are certainly a number of factors that will determine which PLC you need. Without getting into all of those, let’s just say that an SLC 5/03 has plenty of processing power for this project and the cost is reasonable, so we will use one. Before you can determine what modules, rack or power supply you need to buy, you will have to know what your I/O requirements are. This involves the very critical step of laying out your I/O. 23 PLC Programming with RSLogix 500 How to Program an Allen-Bradley SLC 500 with Rockwell Automation’s RSLogix 500 Copyright  2008 Modern Media modernmediaonline.com

A bit of advice here: Don’t skimp on this step. Make sure the I/O is right before you begin programming. A mistake or omission here will cost you ten-fold further down the road.

Lay Out The I/O Now we need to layout the I/O. This will tell us the addresses for the I/O points, what PLC modules we need and how the PLC modules need to be wired. There are three types of signals in the batching system: 120VAC digital inputs (limit switches and pushbutton switches) 120VAC digital outputs1 (valves, motors and pilot lights) and analog 0-10VDC inputs. List all of the components in the system that are connected to the PLC. Categorize each component according its type (digital input, digital output or analog 0-10VDC). It is best to do this in an Excel spreadsheet. I have provided one for this project – it is called IO_List.xls and is included in the files you downloaded. Try to keep associated devices together. For example, the “ADDING WATER” pilot light should be near Valve AV-CW. This will make the electrical prints easier to read and also help to keep the PLC program organized. Notice the “Descriptor” column. This is a statement providing a shorthand description of the device when the associated input is on, or true. We will use these descriptors in the actual PLC program. Descriptors look like this in RSLogix 500.

I can’t stress how important it is to get the verbiage right in a descriptor. For example, let’s look at LS-CW1. This particular limit switch is normally open, but held closed when the valve is closed. When the limit switch is closed, the input to the PLC will be on, or true.

1

Technically, the valves themselves are not 120VAC devices, but in this case, the solenoids that subsequently drive the valves are. Likewise, the motors that run the pumps and the agitators may not be 120VAC, but the control circuitry that operates the motors is 120VAC. 24 PLC Programming with RSLogix 500 How to Program an Allen-Bradley SLC 500 with Rockwell Automation’s RSLogix 500 Copyright  2008 Modern Media modernmediaonline.com

If we used the descriptor Limit Switch LS-CW1 that wouldn’t tell us too much without referring to the prints. Plus, it is a little redundant, as we know it is a limit switch based on the “LS” prefix in the device name. If, however, we use the descriptor City Water Valve AV-CW Closed LS-CW1 then that tells us immediately, without referring to the prints, that the City Water valve is closed as indicated by the limit switch LS-CW1. After you go online with a PLC, if an input is on, the symbol for the bit is highlighted. You can quickly realize the descriptor statement is currently true, as shown below.

Now we must determine what input and output modules we need. The Project Scope said that the Scales and the Ultrasonic Level Sensor provide 0-10VDC signals. We can use an Allen-Bradley 1746-NI4 Analog 4 channel Input Module. Make sure that the DIP switch on the module is set for 0-10VDC (the same module can be configured to read 4-20mA signals).

This is a good time to call your local Allen-Bradley representative and have him assist you in selecting the parts you need. He can work directly from your I/O listing and probably save you a bunch of time.

For the inputs, we can use the 1746-IA16 120VAC Input module. Since 11 inputs are needed for the system, this card will provide 5 spares. You might recall from the Project Scope that contact output modules are required. We will use the 1746-OW16 16-output relay module here. However, since 15 outputs are 25 PLC Programming with RSLogix 500 How to Program an Allen-Bradley SLC 500 with Rockwell Automation’s RSLogix 500 Copyright  2008 Modern Media modernmediaonline.com

required by the system, that only leaves us one spare. It is best to buy and install two modules. Now we can see that four modules will provide the I/O we need to operate the system. The next part we need to determine is the rack. SLC racks come with 4, 7, 10 or 13 slots. Since the processor consumes one slot, the best choice is the 1746-A7 7-slot rack. That will give us two spare slots. The final choice is the rack power supply. RSLogix will help you determine what power supply is needed, but it would be best to consult with your A-B rep on this – again, save time and hassles.

Laying Out The Modules In The Rack The processor must go in Slot 0. It seems logical to put the analog card in the next slot. Most engineers like to put the output cards to the far right, so we will put the OW16s in Slot 6 and Slot 7. That leaves a gap of three slots in the middle of the rack. Since there is a good chance that additional analog card might be needed in the future, we will put the remaining IA16 in Slot 5, next to the outputs. The bottom line here is that, with the exception of the processor, it really does not matter where you place the modules. It is more a matter of personal taste, and what layout you think will be easiest to troubleshoot while allowing for future expansion.

26 PLC Programming with RSLogix 500 How to Program an Allen-Bradley SLC 500 with Rockwell Automation’s RSLogix 500 Copyright  2008 Modern Media modernmediaonline.com

Assigning I/O Addresses Here is the final layout for the cards in the rack: Slot 0 – SLC 5/03 Slot 1 – 1746-NI4 Analog 4 Channel Input Module Slot 2 – empty Slot 3 – empty Slot 4 – 1746-IA16 120VAC Input Module Slot 5 – 1746-OW16 Relay Output Module Slot 6 – 1746-OW16 Relay Output Module Look at the I/O List spreadsheet. The first address we need to assign is the input for the Scales.

Analog Inputs Addressing some analog modules is a little different from addressing digital modules. The NI4 has four inputs and uses one word for each input. The first input starts with 0 and the module is in Slot 1, so the address for the first input is I:1.0.

I:1.0 means that it is a physical input I:1.0 means that it uses Slot 1 (the 2nd slot) in the rack I:1.0 means that it is the first input on the card. The Ultrasonic Level Sensor uses the second input. Its address is I:1.1. The address for the third input is I:1.2. The fourth input is I:1.3. Since we don’t need those for this project, they are labeled as spares. The analog inputs for this project are as follows: Component Scales Ultrasonic Level Sensor ULS-1 spare spare

Signal/Module Type 0-10VDC Input 0-10VDC Input

Slot 1 1 1 1

Address I:1.0 I:1.1 I:1.2 I:1.3 27

PLC Programming with RSLogix 500 How to Program an Allen-Bradley SLC 500 with Rockwell Automation’s RSLogix 500 Copyright  2008 Modern Media modernmediaonline.com

Digital Inputs Our first digital input starts in Slot 4. Therefore, our first input will be I:4/0.

I:4/0 means that it is a physical input I:4/0 means that it uses Slot 4 in the rack I:4/0 means that it is the first input on the card. Don’t confuse capital “I” with “1”. As a side note, RSLogix 500 lets you display the same address in a couple of different ways. You can display the first bit in Slot 4 as: I:4/0 (known as slot/bit) or I:4.0/0 (known as slot word/bit) This is configurable in RSLogix. We will see how to do that in a few moments. Most people prefer the slot/bit method of displaying I/O addresses, so that is what we will use. The digital inputs for this project are as follows: Component START BATCH pushbutton switch PB1 STOP BATCH pushbutton switch PB2 Limit Switch LS-CW1 Limit Switch LS-CW2 Limit Switch LS-QR1 Limit Switch LS-QR2 Limit Switch LS-KM1 Limit Switch LS-KM2 Limit Switch LS-MT1 Limit Switch LS-MT2 spare spare spare spare spare E-STOP PB3

Signal/Module Type 120VAC Input 120VAC Input 120VAC Input 120VAC Input 120VAC Input 120VAC Input 120VAC Input 120VAC Input 120VAC Input 120VAC Input 120VAC Input 120VAC Input 120VAC Input 120VAC Input 120VAC Input 120VAC Input

Slot 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4

Address I:4/0 I:4/1 I:4/2 I:4/3 I:4/4 I:4/5 I:4/6 I:4/7 I:4/8 I:4/9 I:4/10 I:4/11 I:4/12 I:4/13 I:4/14 I:4/15 28

PLC Programming with RSLogix 500 How to Program an Allen-Bradley SLC 500 with Rockwell Automation’s RSLogix 500 Copyright  2008 Modern Media modernmediaonline.com

Digital Outputs Our first digital output is in Slot 5. That makes the first output O:5/0.

O:5/0 means that it is a physical output O:5/0 means that it uses Slot 5 in the rack O:5/0 means that it is the first output on the card. Don’t confuse capital “O” with “0”. In our project, the first output is for the SYSTEM READY pilot light PL1. Its address is O:5/0. The digital outputs for this project are as follows: Component SYSTEM READY pilot light PL1 Valve AV-CW ADDING WATER pilot light PL3 Valve AV-QR Pump PUMP-QR ADDING QR pilot light PL4 Valve AV- KM Pump PUMP-KM ADDING KM pilot light PL4 Agitator MTR-MTA BLENDING pilot light PL6 Pump PUMP-MT PUMPING TO LINES pilot light PL6 Valve AV-MT spare SYSTEM FAULT pilot light PL2

Signal/Module Type 120VAC Output 120VAC Output 120VAC Output 120VAC Output 120VAC Output 120VAC Output 120VAC Output 120VAC Output 120VAC Output 120VAC Output 120VAC Output 120VAC Output 120VAC Output 120VAC Output 120VAC Output 120VAC Output

Slot 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5

Address O:5/0 O:5/1 O:5/2 O:5/3 O:5/4 O:5/5 O:5/6 O:5/7 O:5/8 O:5/9 O:5/10 O:5/11 O:5/12 O:5/13 O:5/14 O:5/15

A final note about the I/O list – take the time to do it right and keep it updated as the project progresses.

29 PLC Programming with RSLogix 500 How to Program an Allen-Bradley SLC 500 with Rockwell Automation’s RSLogix 500 Copyright  2008 Modern Media modernmediaonline.com

Installing RSLogix There are a number of versions of RSLogix that are used with the many PLCs Rockwell offers. We are going to reference RSLogix 500 in this book, as that is the software used to program the SLC 500 PLCs. Most Rockwell software uses a copy protection scheme that involves the use of an “activation file”. RSLogix 500 uses this. You can install the software, but functions will be limited without the activation file.. Activation files are first installed from the master disk supplied by Rockwell. They can be moved from computer to computer, or back to the original master disk. The idea is that Rockwell knows that hardware changes, so that if you want to replace an old computer that you use for programming, you can move the activation file from the old computer to your new one without buying a new activation file. An alternative is to download the RSLogix Starter Kit. This software applies only to the MicroLogix series, but it is very similar to the software used to program the SLCs.

Installing RSLogix 500 The installation of the software is straightforward. Put the disk in the drive and follow the prompts. The only catch is that it will ask you for a serial number. Though any 10-digit number will work, you should use the number assigned to your company by Rockwell. This is the number that Rockwell Technical Support will reference if you call them with a question.

30 PLC Programming with RSLogix 500 How to Program an Allen-Bradley SLC 500 with Rockwell Automation’s RSLogix 500 Copyright  2008 Modern Media modernmediaonline.com

Running RSLogix To run RSLogix, click: Start > All Programs > Rockwell Software > RSLogix 500 English > RSLogix 500 English

A quick side note about conventions used in this book: We are going to use the format shown above to indicate what menu items you should click on as you navigate the menus and sub-menus. For example, the line above means: Click on “Start”. Click on “All Programs”. Click on “Rockwell Software”. Click on “RSLogix 500 English”. Click on “RSLogix 500 English”.

31 PLC Programming with RSLogix 500 How to Program an Allen-Bradley SLC 500 with Rockwell Automation’s RSLogix 500 Copyright  2008 Modern Media modernmediaonline.com

You will see this on your monitor.

Now choose File > New

In the Processor Name field, type in “BATCHING”.

32 PLC Programming with RSLogix 500 How to Program an Allen-Bradley SLC 500 with Rockwell Automation’s RSLogix 500 Copyright  2008 Modern Media modernmediaonline.com

Scroll down in the window and select “1747-L532C/D 5/03 CPU – 16K Mem. OS302”.

33 PLC Programming with RSLogix 500 How to Program an Allen-Bradley SLC 500 with Rockwell Automation’s RSLogix 500 Copyright  2008 Modern Media modernmediaonline.com

Click “OK” and this screen will appear.

On the left, you see an explorer-type menu. This is called the Project tree. All of these folders and files allow you to configure or view properties of the PLC or data files within the PLC.

34 PLC Programming with RSLogix 500 How to Program an Allen-Bradley SLC 500 with Rockwell Automation’s RSLogix 500 Copyright  2008 Modern Media modernmediaonline.com

The first thing we need to do is configure the I/O. Double-click on “IO Configuration”. In the first “Racks” drop-down menu, choose “1746-A7 7-Slot Rack”.

Tip: If the windows on the main screen are rearranged accidentally, choose Window > Arrange > Default Project > OK

Now, we need to define what and the normal view will be restored. I/O modules we are using. The box on the left shows the 7 slots that are available in our rack. Slot 0 (the first slot) is used by the processor. In referring to our I/O spreadsheet, Slot 1 is reserved for the analog input module. In the Current Cards Available window to the right, scroll down until you find “1746-Ni4 Analog 4 Channel Input Module”. Double-click on it and you will see that it has been moved to the window on the left and now occupies Slot 1. Again, looking at our I/O spreadsheet, we see that Slots 2 and 3 are not used. Click on Slot 4 so that it is highlighted. In the Current Cards Available window, scroll until you find “1746-I*16 Any 16pt Discrete Input Module”. Double-click on it and it is shown in Slot 4. Make sure Slot 5 is highlighted and find “1746-O*16 Any16pt Output Module”. Doubleclick on it so that it shows up in Slot 5. Double-click on it again and it will appear in Slot 6. If you want to remove a card, highlight the card and press the “Delete” key,

35 PLC Programming with RSLogix 500 How to Program an Allen-Bradley SLC 500 with Rockwell Automation’s RSLogix 500 Copyright  2008 Modern Media modernmediaonline.com

When you are finished, your configuration should look like this:

The “Power Supply” button will help you select the right power supply for the rack based on the modules you have specified, but it is best to contact your Rockwell representative to help you with this. If you are online for the first time with a PLC, the “Read IO Config” button will tell you how the PLC’s I/O is configured. The “Adv Config” button allows you to perform advanced configuration functions for each card. In this case with our modules, there is no need to change any of the default values. When you are done with the I/O configuration, close the window. Your settings will be saved and you will see the main programming screen.

Configuring Colors, Fonts and Address Display This is something that you can certainly configure to your own liking. However, I prefer to change the defaults as follows to make the display easier to read when I am online. 36 PLC Programming with RSLogix 500 How to Program an Allen-Bradley SLC 500 with Rockwell Automation’s RSLogix 500 Copyright  2008 Modern Media modernmediaonline.com

Select View > Properties > Colors

In the “Set Colors for:” window, click on “Descriptions”. Choose white as a background color. Select the “Fonts” tab. Depending on your monitor, you may prefer something else, but I like Arial. Select the font size of your choice and click “OK”. Select the “Address Display” tab. Choose “Single Line” for “Bit Address Format”. Choose “Word/Bit” for “Binary Bit Display Mode”. Choose “Slot/Bit” for “I/O Bit Display Mode”.

Adding Descriptors To Your I/O A descriptor is the text that is associated with any instruction, such as an XIO, XIC, timer or counter. These are essential when you are writing or trouble-shooting a program. In RSLogix, find the output file O0 – OUTPUT in the Data Files folder and double-click on it. The screen below will appear.

37 PLC Programming with RSLogix 500 How to Program an Allen-Bradley SLC 500 with Rockwell Automation’s RSLogix 500 Copyright  2008 Modern Media modernmediaonline.com

Scrolling to the right or stretching out the window will reveal what type of card is configured for each slot. Output O:5/0 is highlighted, so you can double click on the “Desc:” box to type in the description.

However, since you did your work in advance, there is an easier and more accurate method. Open your I/O List spreadsheet. Copy the descriptor for the spreadsheet for O:5/0. You may need to put a return in to get the device name to appear by itself on the bottom line. Click “OK”. Now click on the next position to the left in the Data File. This is output O:5/1, and is indicated in the field just below the scroll bar. Double-click on the “Desc:” field and copy and paste the descriptor for O:5/1 from your spreadsheet into the box. Again, you may have to insert a hard return here or there to get it to appear the way you would like. Continue in this manner until you have entered all the descriptions for the outputs. Close the window.

38 PLC Programming with RSLogix 500 How to Program an Allen-Bradley SLC 500 with Rockwell Automation’s RSLogix 500 Copyright  2008 Modern Media modernmediaonline.com

Now find the input file I1 – INPUT in the Data Files folder and double-click on it.

This looks a little different from the output file. It is because we have an analog input card. Again, scrolling to the right or stretching out the window will reveal what type of card is configured for each slot. The first line showing address I:1.0 is for the first channel of the Analog NI4 card. In our case, this is where the Scales for the Mixing Tank will be wired. Since it is a word we will be seeing, and not just one bit, we want to add the descriptor to the entire word. In the “Offset” column, click on “I:1.0”. The whole line will be highlighted. Now double-click on the “Desc:” field and paste the description from the spreadsheet for the Scales. Click “OK”. Click on “I:1.1” to add the description for the Ultrasonic Level Sensor.

It is a good idea to save your work frequently. This is done in RSLogix like it is in any other Windows program (CTRLS, or File > Save or

).

We are not using channels 3 and 4, so we can go to the discrete inputs. Click on the “0” in the lower right of the table so that I:4/0 shows up in the box. Add the descriptor just like you did for the outputs. Continue until you have all the inputs labeled. Close the window. You can enter descriptors for Binary (B3) files, Timer (T4) files, Counters (C5) and so in the same way. If you know how these files are going to be laid out then it is a good idea 39 PLC Programming with RSLogix 500 How to Program an Allen-Bradley SLC 500 with Rockwell Automation’s RSLogix 500 Copyright  2008 Modern Media modernmediaonline.com

to add descriptors now. In our case, we will add descriptors to these bits and files as we program.

Writing the Program Setting Up An Overall Control Rung Typically, a program will start with some kind of overall or master control rung. This rung will define a bit that must be on for the entire system to operate, and we include bits that we know must be true for the whole system to run. In this project, we certainly want the E-Stop to be part of this logic. Our E-Stop (or, emergency stop) pushbutton switch is wired in such a way that the input must be on for the system to operate.

You can also insert a rung by clicking on the rung number and pressing the “insert” key. You can select a rung and choose Edit > Insert Rung. There are a number of ways to perform many functions in RSLogix. Throughout the remainder of this book, I will use what I believe is the easiest method for you to understand and remember.

Make sure you have the default view displayed in RSLogix. It will show one rung with the (END) instruction all the way to the right. This rung cannot be deleted or edited. We need to insert a new rung. Right-click in the LAD 2 window on the rung number 0000. A menu will appear. Choose “Insert Rung”.

40 PLC Programming with RSLogix 500 How to Program an Allen-Bradley SLC 500 with Rockwell Automation’s RSLogix 500 Copyright  2008 Modern Media modernmediaonline.com

Your screen should look like this:

We want to use the E-Stop input in this rung. Find the XIC (examine if closed) button in the User menu.

tool

Click and drag it toward the new rung you just created. You will see that as you get near the rung, two red squares will appear. These are possible landing points for your instruction. Move your pointer toward the one on the left. As you get near it, the square will change color from red to green. Release the mouse button and your screen should look like this.

41 PLC Programming with RSLogix 500 How to Program an Allen-Bradley SLC 500 with Rockwell Automation’s RSLogix 500 Copyright  2008 Modern Media modernmediaonline.com

Press the enter key on your keyboard. Type in the address of the E-Stop pushbutton input, which is I:4/15. Your screen now looks like this.

Notice how the instruction descriptor appeared automatically. Remember that we want to create the logic for a bit that must be on if the system is to run. We will use an internal bit from the B3 file. Click and drag the OTE (output energize) tool button the new rung. Place it on the marker at the far right.

from the User menu down to

Press enter. Type the address B3:0/0 and press enter. This is the first bit in the B3 file, and since this bit has a lot of importance in our program, that is appropriate. The address description box appears automatically. Type “System Enable” into the box. We know from the Project Scope that the system must stop if there is a fault. We are not sure of the details of all those faults yet, but we do know that we will summarize those faults somewhere in the program. It will result in a bit. We will use the address B3:0/1 for that bit. We also know that we want the “System Enable” to be on if we do not have a fault. Bear with me here and it will make sense. Click and drag the XIO (examine if open) tool button from the User menu down to the new rung. Place it just to the right of the Estop input. Press enter and type B3:0/1. Press enter and type “System Fault” in the descriptor box.

42 PLC Programming with RSLogix 500 How to Program an Allen-Bradley SLC 500 with Rockwell Automation’s RSLogix 500 Copyright  2008 Modern Media modernmediaonline.com

It should look like this:

Let’s see what we have. The logic of the rung works just like an electrical circuit. If the E-Stop is cleared and there is not a System Fault, the System Enable bit will be on. That is exactly what we want. We will work out the fault logic later. Notice that the System Fault bit is highlighted. That means the XIO instruction is true; that is, there is currently no system fault. The last thing we need to do is verify the rung. Right-click on the rung number and choose “Verify Rung”. Notice that the lower case “e” will disappear.

Starting a Batch Cycle The Project Scope said that the operator may start a batch by pressing the “Start Batch” pushbutton on his console. Let’s start with that input. Right-click on the last rung and choose “Insert Rung”. Click and drag the XIC (examine if closed) tool button address I:4/0.

from the User menu to the left side of the new rung. Enter the

Click and drag the OTE (output energize) tool button from the User menu down to the new rung. Place it on the marker at the far right. We are creating a new bit that indicates the system is currently batching. Enter the address B3:0/2. Label this bit “System Batching”.

43 PLC Programming with RSLogix 500 How to Program an Allen-Bradley SLC 500 with Rockwell Automation’s RSLogix 500 Copyright  2008 Modern Media modernmediaonline.com

If the operator chooses, he may stop the batch. We will make use of the “Stop Batch” pushbutton. Click and drag the XIO (examine if open) tool button menu down to the new rung. Enter the address I:4/1.

from the User

We don’t want the operator to be able to start a batch if the System Enable bit is not on. We will add that by dragging the XIC (examine if closed) tool button of the new rung. Enter the address B3:0/0.

to the left side

This rung will work much like a traditional motor starter circuit that uses a contact from the motor starter wired in parallel with the start button to hold in the coil. In the PLC, the “contact” is an XIO with the same address as the “coil”, which is B3:0/2. We need to “wire the contact” in parallel with the start button. We do this with a branch instruction. Drag the Branch tool button and place it on the marker between the System Enable bit and the Start Batch bit.

44 PLC Programming with RSLogix 500 How to Program an Allen-Bradley SLC 500 with Rockwell Automation’s RSLogix 500 Copyright  2008 Modern Media modernmediaonline.com

It will look like this.

We want the branch to go around the Start Batch bit. Now click and drag the right side of the branch to marker just to the right of the Start Batch bit.

45 PLC Programming with RSLogix 500 How to Program an Allen-Bradley SLC 500 with Rockwell Automation’s RSLogix 500 Copyright  2008 Modern Media modernmediaonline.com

Release the mouse button and the branch will appear around the Start Batch bit.

Click and drag the XIC (examine if closed) tool button left side of the new branch. Type in the address B3:0/2.

from the User menu to the

46 PLC Programming with RSLogix 500 How to Program an Allen-Bradley SLC 500 with Rockwell Automation’s RSLogix 500 Copyright  2008 Modern Media modernmediaonline.com

This is called a latching rung. If the System Enable bit is on, the System Batching bit can be latched by momentarily pressing the Start Batch pushbutton. The System Batching bit will stay on and the rung will remain latched until the Stop Batch pushbutton is pressed or the System Enable bit goes off. Thinking ahead, though, we know that the system will stop the batch automatically after it has pumped all the finished product to the filling lines. We are not sure how we will know that yet, but we know we need a bit to unlatch the rung. Click and drag the XIO (examine if open) tool button from the User menu down to the marker just in front of the System Batching OTE instruction. Address it as B3:0/3 and type in the descriptor “Batch Complete”. Right-click on the rung number and verify the rung. It should appear like this.

47 PLC Programming with RSLogix 500 How to Program an Allen-Bradley SLC 500 with Rockwell Automation’s RSLogix 500 Copyright  2008 Modern Media modernmediaonline.com

Batching Steps As you recall from the project scope, there are a number of steps needed to create the finished product. They are: 1. Adding City water 2. Adding chemical QR 3. Adding chemical KM 4. Blending the mixture with the agitator 5. Pumping the finished product to the filling lines.

Step 1 – Adding City Water We need to initiate Step 1. Before we do that, thought, we need to add another permissive bit. We will call that bit “System Ready”. We know that if the system is enabled but not currently batching, it is ready to begin a batch. We need insert a new rung and create a “System Batching” and “System Ready” bit. Insert a new rung and program it as shown in Rung 0002. You can see how Rung 0002 should look in the picture below. The “System Ready” bit will be on when the system is enabled, but not batching.

48 PLC Programming with RSLogix 500 How to Program an Allen-Bradley SLC 500 with Rockwell Automation’s RSLogix 500 Copyright  2008 Modern Media modernmediaonline.com

To actually initiate the batch and hold the batch in Step 1, we are going to use the Output Latch (OTL) instruction. This instruction works in conjunction with the Output Unlatch (OTU) instruction. The instructions will work on the same bit address, but are typically found on different rungs. The batch will be started when the operator pushes the Start Batch button. We will latch that bit and label it Step 1. As a side note, I am going to skip a few addresses in the B3 file. It is always a good idea to leave a gap here and there in the event that you need to add a bit later. It doesn’t affect the operation of the program, but it makes the data files more organized and easier to troubleshoot. Insert a new rung at the bottom of the ladder. We need an XIC for the System Ready bit and an XIC for the Start Batch pushbutton at the beginning of the new rung. Click and drag the XIC (examine if closed) tool button from the User menu to the left side of the new branch. Type in the address B3:0/2 and press enter. To save some typing, you can copy and paste instructions. Highlight the Start Batch instruction in Rung 0002. Press CTRL-C. Click on the rung number for Rung 0004. Press CTRL-V. The instruction is duplicated on Rung 0003. Copy and paste bit in the same way Click and drag the OTL (output latch) tool button from the User menu to the right side of the new branch. Type in the address B3:0/10 and add the descriptor “Batch Step 1”.

49 PLC Programming with RSLogix 500 How to Program an Allen-Bradley SLC 500 with Rockwell Automation’s RSLogix 500 Copyright  2008 Modern Media modernmediaonline.com

However, what if the button is pressed if the system is already batching and in another step? To prevent that from happening, we will make sure that the only way the system can enter Step 1 is if it is not in another step already. Add a series of XIO instructions. Address them from B3:0/11 to B3:0/14. Type in the appropriate descriptors. Verify the rung. You can see how RSLogix handles rungs that are too long to be displayed on one side. You can compensate for this by maximizing the LAD 2 window, or stretching it to the left. Remember that if you want to return to the default view, choose Window > Arrange > Default Project.

50 PLC Programming with RSLogix 500 How to Program an Allen-Bradley SLC 500 with Rockwell Automation’s RSLogix 500 Copyright  2008 Modern Media modernmediaonline.com

You may wonder why we chose not to use the OTL output latch instruction in Rung 0001. Many times, it is a matter of personal choice; sometimes a “traditional” latch rung is better than using an OTL. In Rung 0001, we were able to keep all the logic affecting the System Batching bit on one rung. This makes it easier to read and a little more condensed. Some people view a traditional latch as a bit safer. It’s your call, though.

Analog Inputs Before we continue with Step 1, we need to program the Mixing Tank Scales and the Ultrasonic Level Sensor. Since the logic associated with these devices is not necessary tied to Step 1, but common to the entire program, let’s put them in a sub-routine.

51 PLC Programming with RSLogix 500 How to Program an Allen-Bradley SLC 500 with Rockwell Automation’s RSLogix 500 Copyright  2008 Modern Media modernmediaonline.com

We do this by right-clicking on “Program Files” in the Project menu on the left and choosing “New”. The Name is limited to 11 characters, so we will call it ANALOG. The description will be “Mixing Tank Scales and Level Sensor”. Click OK.

That reminds us that we did not name LAD 2. Let’s do that right now. Right-click on LAD 2 and choose Rename. We will call it MAIN. LAD 2 is, by default, the program that will run when the SLC is first powered up. Like subroutines in other programs like Visual Basic or C, we need to tell the main program to execute the sub-routine. We need to put a JSR (jump to subroutine) instruction in LAD 2. In this case, it really doesn’t matter where it is placed, but putting it at the top makes sense. Insert a rung at the top of the ladder. In the Instruction menu, click on the right arrow until the “Program Control” tab is shown. Click on the tab. Drag the Jump to Subroutine (JSR) tool button to your new rung. Type in a “3” to tell the instruction to go to LAD 3. Add the descriptor “Mixing Tank Scales and Level Sensor”. Verify the rung. In the Project menu, double-click on LAD 3 – ANALOG. This opens the new ladder file you just created. Insert a new rung.

52 PLC Programming with RSLogix 500 How to Program an Allen-Bradley SLC 500 with Rockwell Automation’s RSLogix 500 Copyright  2008 Modern Media modernmediaonline.com

We are going to enter an instruction in a new way. Double-click on 0000 for Rung 0000. This opens up the ASCII editor.

Type SCP in the box and press enter. SCP stands for “Scale with Parameters”. It allows you to take an analog input from a sensor and scale it to the output units you want. Before we start scaling, let’s take a moment to see how the Allen-Bradley NI4 converts a 0-10VDC signal to a number. The NI4 is an analog-to-digital processor that takes the 0-10VDC signal and converts it to a number between 0 and 16384. The NI4 will yield a number from 0 to 16384 that is directly proportional to the 0 to 10VDC signal that is applied at the input. In other words, zero volts on the input of the NI4 means that the NI4 will provide 0 as a value to the PLC. Ten volts on the input will yield 16384. Five volts on the input will yield half of 16384, or 8192, and so on.

53 PLC Programming with RSLogix 500 How to Program an Allen-Bradley SLC 500 with Rockwell Automation’s RSLogix 500 Copyright  2008 Modern Media modernmediaonline.com

The SCP instruction starts out looking like this.

Each of the six parameters (Input, Input Min., Input Max., Scaled Min., Scaled Max. and Output) has two fields associated with them. Each field is currently filled with a question mark. The first field is a value that you assign. The second field is the actual value returned by the processor.

Setting up an SCP to calculate Tank Weight The Input parameter is the value that will be scaled. Let’s use this SCP instruction for the Scales. The input we will use is the address we assigned to the analog input card; that is, I:1.0. The Input Min parameter is the value that is read by the analog card when there is no liquid in the tank. With our scales, this value is 0. The Input Max is the value that is read by the card when the tank is full. Our Mixing tank weighs 2000 lbs. when it is full of liquid. We measured the voltage that the Scale put out when the tank was full and found it to be 10 volts. So, in this case, 2000 lbs. in the tank equals 10 volts, which means the NI4 will read out 16384 when the tank has 2000 lbs. of liquid in it. The Scaled Min parameter is the lowest value you want the SCP to calculate in the units you want. In this case, it is 0, and we are using pounds as our units. 54 PLC Programming with RSLogix 500 How to Program an Allen-Bradley SLC 500 with Rockwell Automation’s RSLogix 500 Copyright  2008 Modern Media modernmediaonline.com

The Scaled Max parameter is the highest value you want the SCP to calculate. For the Scales in our project, it is 2000. The Output parameter is typically an address where you want to store the result of the SCP. We are going to put it in the N7 file (integer). We will store it specifically in N7:0. Here is how the SCP instruction for our Scales looks.

Admittedly, the numbers rarely work out like this, but for simplicity’s sake, I made them easy to work with. The real beauty of the SCP is apparent after you go online. Let’s say that you couldn’t really calibrate the scales previously by using voltmeter. After you go online, and you are getting live data from the SCP instruction, you can visually verify that the tank is empty. Hoverer, you are reading 133 from the NI4. You simply enter 133 as the Input Min parameter. When the tank is full, you see that the reading is 14733. Enter 14733 as the Input Max parameter and the SCP will calculate the rest for you. The important thing to remember is that the value in N7:0 is the actual weight of the tank in pounds. We will use that when we program the setpoint logic. 55 PLC Programming with RSLogix 500 How to Program an Allen-Bradley SLC 500 with Rockwell Automation’s RSLogix 500 Copyright  2008 Modern Media modernmediaonline.com

Setting Up An SCP To Calculate Tank Level First, let’s insert a new rung and create an SCP the same way we did the first time. This time, the Input will be I:1.1 The Input Min will be 0. The Input Max will be 16384. The Scaled Min is 0. The Scaled Max is 100. We want to read the level of the tank as a percent of full. The Output is stored in N7:1, with the descriptor “Liquid Level of Mixing Tank (%)”. It looks like this.

There is one more rung we need to add to this ladder file. Do you remember the JSR instruction we used to get the program here? We have to tell it to go back.

56 PLC Programming with RSLogix 500 How to Program an Allen-Bradley SLC 500 with Rockwell Automation’s RSLogix 500 Copyright  2008 Modern Media modernmediaonline.com

Insert a new rung and the RET (return) instruction.

Back to Batching – Step 1 Click on the “Main” tab at the bottom on the Ladder window to return to the LAD 2 – MAIN file. Now that we have our Scales working, we can add some water. Insert a new rung at the bottom of the ladder. We will open the city water valve in this rung, so we want to make sure that it is still safe and desirable to open the valve. That is, make sure that there are no faults, the E-Stop button has not been pressed and the Stop Batch pushbutton has not been pressed. Using an XIC with the System Batching bit will confirm all of that. Insert an XIC with the address B3:0/2. Since we only want to open this valve and add city water in Step 1, insert an XIC with the address B3:0/10. Insert an OTE for the city water valve (O:5/1). Remember that we want to put 1275 lbs. of water in the Mixing Tank. We will use the LEQ (Less than or Equal To) instruction to accomplish that. 57 PLC Programming with RSLogix 500 How to Program an Allen-Bradley SLC 500 with Rockwell Automation’s RSLogix 500 Copyright  2008 Modern Media modernmediaonline.com

Select the “Compare” tab on the instruction tool menu. Click and drag the LEQ tool button

to the marker just to the left of the OTE.

Source A in the instruction is the Tank Weight, which is N7:0. Enter that address. Source B is our setpoint, which as you recall from the Project Scope is 1275 lbs. Enter 1275 for Source B. The LEQ instruction will remain true as long as the tank weight does not exceed 1275 lbs.

After the correct amount of city water has been added, we need to proceed to Step 2.

58 PLC Programming with RSLogix 500 How to Program an Allen-Bradley SLC 500 with Rockwell Automation’s RSLogix 500 Copyright  2008 Modern Media modernmediaonline.com

We will make use of the fact that we know the system is currently in Step 1, but the Mixing Tank has enough water (1275 lbs) to go to the next step.

We will use the OTU (Output Unlatch) instruction to turn off the bit we latched in Rung 0004. Rung 0006 works like this: The XIC instruction B3:0/10 Batch Step 1 is on. The Mixing Tank weight has reached the setpoint of 1275, so the GEQ (Greater Than or Equal To) instruction is also true. As a result, the bit B3:0/10 Batch Step 1 is unlatched (turned off) and B3:0/11 Batch Step 2 is latched (turned on).

59 PLC Programming with RSLogix 500 How to Program an Allen-Bradley SLC 500 with Rockwell Automation’s RSLogix 500 Copyright  2008 Modern Media modernmediaonline.com

Step 2 – Adding Chemical KM Step 2 will be similar to Step 1, so rather than creating new rungs from scratch, we are going to copy and paste the rungs from Step 1. Click on the rung number for Rung 0005. Hold the SHIFT key and click on the rung number for Rung 0006. Both rungs will be highlighted in red.

60 PLC Programming with RSLogix 500 How to Program an Allen-Bradley SLC 500 with Rockwell Automation’s RSLogix 500 Copyright  2008 Modern Media modernmediaonline.com

Press CTRL-C. Click on Rung 0007. Press CTRL-V. You now have new rungs, 0007 and 0008.

We will start with rung 0007. Change B3:0/10 to B3:0/11. We will be looking for a setpoint of 1275 + 390, since there is already 1275 lbs. of water in the Mixing Tank and we need to add 390 lbs. of QR. Change Source B in the LEQ instruction to 1665. Refer to your I/O list spreadsheet and note that the QR automatic valve is addressed as O:5/3. Change the OTE from O:5/1 to O:5/3. In Rung 0008, change B3:0/10 to B3:0/11. Change Source B in the GEQ instruction to 1665. 61 PLC Programming with RSLogix 500 How to Program an Allen-Bradley SLC 500 with Rockwell Automation’s RSLogix 500 Copyright  2008 Modern Media modernmediaonline.com

Change the OTU (Output Unlatch) instruction from B3:0/10 to B3:0/11. Change the OTL (Output Latch) instruction from B3:0/11 to B3:0/12. It should look like this.

There is a major process difference between adding City Water and adding QR – the QR chemical needs to be pumped. First, we want to make sure the valve is being instructed to open, so we will use an XIC from pump AV-QR in the logic. Next, we will wait to turn on the pump until the valve is verified to be open by limit switch LS-QR2. As a failsafe, we will look at limit switch LSQR1 to make sure it is not indicating the valve is closed. Right-click on Rung 0008 and choose “Insert Rung”. So that you can learn a bit more about ASCII editing, we will construct the entire rung from the ASCII command line.

62 PLC Programming with RSLogix 500 How to Program an Allen-Bradley SLC 500 with Rockwell Automation’s RSLogix 500 Copyright  2008 Modern Media modernmediaonline.com

Double-click on Rung 0008. The ASCII string input box appears. Type in the following string: XIC O:5.0/3 XIO I:4.0/4 XIC I:4.0/5 OTE O:5.0/4

63 PLC Programming with RSLogix 500 How to Program an Allen-Bradley SLC 500 with Rockwell Automation’s RSLogix 500 Copyright  2008 Modern Media modernmediaonline.com

Press enter and the instructions appear.

Verify the rungs.

Step 3 – Adding Chemical KM Step 3 will have the same logic as Step 2, so will cut and paste to create new rungs. Click on Rung 0007, hold down the SHIFT key and click on Rung 0009 to select the new rungs. Press CTRL-C. Click on the last rung and press CTRL-V. We will be looking for a setpoint of 1665 + 173, since there is already 1665 lbs. of water in the Mixing Tank and we need to add 173 lbs. of KM. Change Source B in the LEQ instruction to 1838. Change Source B in the GEQ instruction to 1838. Change the latch and unlatch outputs to increment the system to Step 4. 64 PLC Programming with RSLogix 500 How to Program an Allen-Bradley SLC 500 with Rockwell Automation’s RSLogix 500 Copyright  2008 Modern Media modernmediaonline.com

It should look like this after you have made the changes and verified the rungs.

Step 4 – Blending After all the ingredients are in the Mixing Tank, we have to run the Agitator for 3 minutes. We will set up a timer to run for 3 minutes. When the timer is done, we will increment the system to Step 5. That will turn off the Agitator. Start by inserting a new rung at the bottom. Insert an XIC instruction with the address of B3:0/2. Insert an XIC instruction with the address B3:0/13.

65 PLC Programming with RSLogix 500 How to Program an Allen-Bradley SLC 500 with Rockwell Automation’s RSLogix 500 Copyright  2008 Modern Media modernmediaonline.com

Click the “Timer/Counter” tab on the instruction tool menu. Click and drag the TON tool button

down to the right side of the new rung.

This type of timer is called a Timer On Delay. As soon as the instructions preceding it are true, it will begin timing. The Enable bit (EN) will turn on. After it reaches its Preset value, the Done bit (DN) will turn on. First, we have to assign an address to the timer. All timers in RSLogix 500 use the T4 data file. They start with 0 and continue up until they reach they end of the data file. We will address this timer as T4:0. Press enter and type T4:0. Type “Agitator Run Time” for the descriptor. There are a number of time bases available that interact with the preset and accumulated values. To find the total time that a timer will be timing, multiply the time base by the preset value. We want to time for 3 minutes, or 180 seconds, so we will choose a Time Base of 1.0 and enter a preset of 180. Select a Time Base of 1.0. Double-click on the Preset field and type 180. Press enter. Leave the accumulated value at 0, as this will be changed as the timer begins timing. The completed rung looks like this.

66 PLC Programming with RSLogix 500 How to Program an Allen-Bradley SLC 500 with Rockwell Automation’s RSLogix 500 Copyright  2008 Modern Media modernmediaonline.com

To run the Agitator, insert a new rung at the bottom. Click on the “User” tab of the tool button menu and drag an XIC instruction to the first marker of the new rung. We will use the Enable bit (EN) of the timer for the address. To assign a timer’s enable bit, simply add the suffix /EN to the address. For this instruction, the address is T4:0/EN. Now add an OTE instruction with the agitator motor’s address, which is O:5/9. The enable bit of a timer is on only when the timer is enabled. In Rung 0013, for example, if the System Batching bit turns off, or the Batch Step 4 bit turns off, the timer will no longer be enabled. Consequently, its enable bit, T4:0/EN will turn off.

67 PLC Programming with RSLogix 500 How to Program an Allen-Bradley SLC 500 with Rockwell Automation’s RSLogix 500 Copyright  2008 Modern Media modernmediaonline.com

We will turn off the timer by incrementing the system to the next step when the timer is done.

68 PLC Programming with RSLogix 500 How to Program an Allen-Bradley SLC 500 with Rockwell Automation’s RSLogix 500 Copyright  2008 Modern Media modernmediaonline.com

Insert a new rung at the bottom and drag an XIC to the first marker. We will assign the Done bit (DN) of the timer to this instruction. It is formatted just like the Enable bit, except you use /DN as the suffix. Address this instruction as T4:0/DN. We will use the same method to increment the system to Step 5 that we have used previously. Drag an OTU instruction to the last marker in the rung. Address the instruction to be Step 4, which is B3:0/13. Insert a new branch around the OTU by dragging a Branch tool button to the marker in front of the output. Grab the right leg of the branch and move it to the marker after the output. Insert an OTL instruction on the bottom of the branch and address it as B3:0/14. Verify the rungs.

69 PLC Programming with RSLogix 500 How to Program an Allen-Bradley SLC 500 with Rockwell Automation’s RSLogix 500 Copyright  2008 Modern Media modernmediaonline.com

Now, when the timer is done and T4:0/DN turns on, it will unlatch Step 4 and start Step 5.

Step 5 – Pump to Filling Lines Since this step involves a pump, it will be similar to Step 3. Let’s save ourselves some typing and copy all of Step 3. Click on Rung 0010. Hold down the SHIFT key and click on Rung 0012. Press CTRL-C. Click on Rung 0016 (the last rung). Press CTRL-V. In Rung 0016, change B3:0/12 to B3:0/14. Change the address of the output instruction to O:5/13. We want to pump until the Mixing tank is empty. We will use the Ultrasonic Level Sensor to determine if the tank has liquid in it. We will use a GEQ instruction to accomplish this. Double-click on the “LEQ” text in the LEQ instruction. Type GEQ (for Greater than or equal to) in that space. Change Source A of the instruction to N7:1. This is the address of the scaled level sensor. We may be tempted to put a value of 0 into Source B, but that could be risky. First, pumping the tank dry might be hard on the pump. Second, because of drift in the level sensor, we might never get a reading of zero in some instances. The Process engineers have told us that emptying the tank to 3% is desirable. Put a 3 in for the value of Source B. Change Rung 0017 to show the correct valve, limit switches and pump addresses. Since this is the last step in the batching process, we will use Rung 0018 to increment out of Step 5 and complete the batching cycle. Change the first XIC in Rung 0018 to B3:0/14. Copy the GEQ instruction from Rung 0016. Click on the instruction, press CTRL-C and click on the GEQ instruction in Rung 0018. Press CTRL-V. 70 PLC Programming with RSLogix 500 How to Program an Allen-Bradley SLC 500 with Rockwell Automation’s RSLogix 500 Copyright  2008 Modern Media modernmediaonline.com

Delete the other GEQ from Rung 0018 (the one that references the tank weight). Change the remaining GEQ in Rung 0018 to a LEQ. Change B3:0/12 to B3:0/14. Right-click on the OTL (L) instruction in the bottom branch. Choose “Change Instruction Type” and make it an OTE. Change the address to B3:0/3. This is the “Batch Complete” bit. Verify all the rungs and it should look like this.

When the system enters Step 5, the Mixing Tank will be nearly full. The GEQ instruction will be true and open the Mixing Tank valve. When the valve has been opened and verified by the limit switches, the pump will run. 71 PLC Programming with RSLogix 500 How to Program an Allen-Bradley SLC 500 with Rockwell Automation’s RSLogix 500 Copyright  2008 Modern Media modernmediaonline.com

When the level in the tank drops to 3%, the valve will close and the Mixing Tank pump will stop. Simultaneously, the Batch Step 5 bit will be unlatched and the Batch Complete OTE instruction will be turned on. It will trip the latch in Rung 0002 and turn off the System Batching bit. The system returns to its idle state and is ready to begin a new batch.

Faults The program may be complete in an operational sense, but we need to add the logic to detect faults. Let’s create a new ladder file to do that. Right-click on “Program Files” in the Project menu and choose “New”. Name the file “FAULTS” and enter “System Faults” as the description. Double-click on the new ladder file.

Valve Position Faults We were told in the Project Scope that the valve position must be verified by the limit switches within 2 seconds. We will use an individual timer for each valve to accomplish this.

72 PLC Programming with RSLogix 500 How to Program an Allen-Bradley SLC 500 with Rockwell Automation’s RSLogix 500 Copyright  2008 Modern Media modernmediaonline.com

Type in the logic as shown below.

We must accommodate the two conditions that indicate a fault. The first is that the valve was told to open, but did not open. The second fault condition is that the valve was told to close, but did not close. Remember that the limit switches on the valves are electrically normally open and will be physically held closed by the valve when it is in position. When the valve is closed, we should get a signal to the input I:4/2 when limit switch LSCW1 is activated by the valve. When the valve is open, we should not get a signal to the input I:4/2, as limit switch LSCW1 is not activated by the valve. 73 PLC Programming with RSLogix 500 How to Program an Allen-Bradley SLC 500 with Rockwell Automation’s RSLogix 500 Copyright  2008 Modern Media modernmediaonline.com

Conversely, when the valve is open, we should get a signal to the input I:4/3 when limit switch LS-CW2 is activated by the valve. When the valve is closed, we should not get a signal to the input I:4/3, as limit switch LS-CW2 is not activated by the valve. That is why we use the XIO (examine if open) instruction. We want to know if we do not get a signal from the limit switches when we should. An XIO instruction used on an input will always be true if there is no signal on the input. Let’s look at how it handles the first fault condition (the valve was told to open, but did not open). The City Water valve output (O:5/1) is on but the limit switch LS-CW2 is open. That means the XIO instruction for LS-CW2 in Rung 0000 is true. This creates an undesirable condition and the timer will begin timing.

74 PLC Programming with RSLogix 500 How to Program an Allen-Bradley SLC 500 with Rockwell Automation’s RSLogix 500 Copyright  2008 Modern Media modernmediaonline.com

The screenshot below shows what the state of the instructions would be after 1 second of the valve being instructed to open, but LS-CW2 not yet being activated.

You can see that the City Water valve is being told to open, as O:5/1 is highlighted. You can also see that LS-CW2 says that the City Water valve is not open, as it is also highlighted. The timer has begun timing and has reached, or accumulated, 1 second. If the timer reaches 2 seconds, the timer done bit T4:1/DN will come on and turn on the System Fault bit B3:0/1 in Rung 0001. Since we used the System Fault bit B3:0/1 in Rung 0001 of the MAIN ladder, this will cause the “System Enable” bit to turn off. Consequently, Rung 0003 of the MAIN ladder will become false and the system will stop batching. Let’s look at the other condition; that is, the valve was told to close, but did not close. 75 PLC Programming with RSLogix 500 How to Program an Allen-Bradley SLC 500 with Rockwell Automation’s RSLogix 500 Copyright  2008 Modern Media modernmediaonline.com

That is what is accomplished in the branch in Rung 0001. If the valve output (O:5/1) is not on but the limit switch is not activated, then the timer will begin and generate a fault. Sometimes it gets confusing when you are working with the XIO instruction logic is inverted and you have to flip some things around in your head.

. The

The logic we have used here to detect a valve fault is fairly standard and its use is widespread. The nice part about this logic is that it is pretty easy to troubleshoot. You can physically look at the valve to see if it is open or closed. Then, you can look at the input you are receiving from the limit switch. If you are getting a fault when you should not, then just invert the instruction for the limit switch. Change it from an XIO to an XIC, or vice versa. Let’s create the fault timers for the remaining valves. This is the screenshot for the QR valve and KM valve fault logic.

76 PLC Programming with RSLogix 500 How to Program an Allen-Bradley SLC 500 with Rockwell Automation’s RSLogix 500 Copyright  2008 Modern Media modernmediaonline.com

This is the screenshot for the Mixing Tank valve fault logic.

77 PLC Programming with RSLogix 500 How to Program an Allen-Bradley SLC 500 with Rockwell Automation’s RSLogix 500 Copyright  2008 Modern Media modernmediaonline.com

Notice how the System Fault rung has grown.

78 PLC Programming with RSLogix 500 How to Program an Allen-Bradley SLC 500 with Rockwell Automation’s RSLogix 500 Copyright  2008 Modern Media modernmediaonline.com

To complete our fault logic, we need to add the Liquid High Level alarm. We can achieve this with one GRT instruction in the System Fault rung. It is agreed that if the liquid level reaches 95% of the tank’s capacity, it will fault.

79 PLC Programming with RSLogix 500 How to Program an Allen-Bradley SLC 500 with Rockwell Automation’s RSLogix 500 Copyright  2008 Modern Media modernmediaonline.com

Adding a return (RET) instruction completes the ladder.

Don’t forget to add a JSR instruction to the main ladder.

80 PLC Programming with RSLogix 500 How to Program an Allen-Bradley SLC 500 with Rockwell Automation’s RSLogix 500 Copyright  2008 Modern Media modernmediaonline.com

Console Status Indicators – Pilot Lights I have held off putting the logic in for the Pilot Lights in an effort to keep the text as simple as possible. Now that you understand how the system operates, we can go back through the program and add the pilot lights. The first is the System ready PL1 pilot light. Find Rung 0003 in the MAIN ladder. Clicking twice on the rung number will open the rung for editing. Insert a branch around the B3:0/4 System Ready output. Put an OTE instruction on the bottom rung of the new branch and address it O:5/0. With this logic, the light will come on when the System ready bit is on.

We will add the remaining pilot lights in a similar fashion.

81 PLC Programming with RSLogix 500 How to Program an Allen-Bradley SLC 500 with Rockwell Automation’s RSLogix 500 Copyright  2008 Modern Media modernmediaonline.com

Adding water

Adding QR

82 PLC Programming with RSLogix 500 How to Program an Allen-Bradley SLC 500 with Rockwell Automation’s RSLogix 500 Copyright  2008 Modern Media modernmediaonline.com

Adding KM

Blending

83 PLC Programming with RSLogix 500 How to Program an Allen-Bradley SLC 500 with Rockwell Automation’s RSLogix 500 Copyright  2008 Modern Media modernmediaonline.com

Pumping to Lines

System Fault We need to add a little logic to the System Fault pilot light. This light needs to stay on after it detects a fault; otherwise, the system will stop and the operator won’t know there was a fault. We are using the STOP BATCH pushbutton to reset the fault light.

84 PLC Programming with RSLogix 500 How to Program an Allen-Bradley SLC 500 with Rockwell Automation’s RSLogix 500 Copyright  2008 Modern Media modernmediaonline.com

Adding Rung Comments A good rung comment explains in plain language what the rung is supposed to do. These are very valuable. First, it is a way to double-check your own work. I have been surprised at the number of times I have found a mistake in my logic as I was writing the rung comments! Second, it helps a person who is unfamiliar with the program quickly learn how the program is supposed to work. Finally, it adds value to your finished program. A well-documented program is worth more money to a client (or your company) than a program that is not documented. They can even get you out of a jam. If you have to troubleshoot a system 6 months after you first programmed it, I can guarantee that you will not remember every reason for every line of code you wrote. If you have written code in some other language before, you certainly can understand the value of documenting your work. The default for RSLogix is to attach the rung comment to the rung number. This is fine until a rung is inserted above that rung. It is a much better practice to set the rung comment to be attached to the Output Address.

85 PLC Programming with RSLogix 500 How to Program an Allen-Bradley SLC 500 with Rockwell Automation’s RSLogix 500 Copyright  2008 Modern Media modernmediaonline.com

Choose Tools > Options... > System Preferences

and select “Output Address” for “Default Rung Comment/Page Title Attachment”.

86 PLC Programming with RSLogix 500 How to Program an Allen-Bradley SLC 500 with Rockwell Automation’s RSLogix 500 Copyright  2008 Modern Media modernmediaonline.com

Let’s use a rung from our program as an example.

Right-click on the rung number 0008 and choose “Edit Comment”. This box will appear.

Make sure the “Attach To” selection shows “Output Address”. 87 PLC Programming with RSLogix 500 How to Program an Allen-Bradley SLC 500 with Rockwell Automation’s RSLogix 500 Copyright  2008 Modern Media modernmediaonline.com

Type this in the Rung Comment field: Run QR pump PUMP-QR after the QR valve is opened and the valve position is verified by both valve limit switches. Turn on the "Adding QR" pilot light.

Notice that you don’t have to put details such as PLC addresses in the rung comment – just document the concept of the rung.

88 PLC Programming with RSLogix 500 How to Program an Allen-Bradley SLC 500 with Rockwell Automation’s RSLogix 500 Copyright  2008 Modern Media modernmediaonline.com

Expanding the Data tables Before we go online and download the program, we should expand our data tables in case we need to add a timer or a new integer after we go online. RSLogix 500 only allows you to expand data tables if you are off line in program mode. This means the process system must be shut down. Let’s start with the B3 file. Right click on the B3-BINARY file in the Project tree. Choose “Properties”. It will initially show 1 element, which means we have one word of 16 bits. That means that we will only be able to use bits up to B3:15.

Change the number of elements to 4. This will give us 48 bits to work with; that should be plenty for this project, and we still have more than enough memory in the PLC. 89 PLC Programming with RSLogix 500 How to Program an Allen-Bradley SLC 500 with Rockwell Automation’s RSLogix 500 Copyright  2008 Modern Media modernmediaonline.com

We will do the same with the Timers. In the case of timers, counters, integers and floating point decimals, 1 element means 1 word. That is, if we want to be able to use 16 timers, we have to make sure the data table contains 16 elements.

You will notice that 16 elements gives us 16 timers (T4:0 ~ T4:15).

90 PLC Programming with RSLogix 500 How to Program an Allen-Bradley SLC 500 with Rockwell Automation’s RSLogix 500 Copyright  2008 Modern Media modernmediaonline.com

Do the same with the C5 counter file. We don’t have any counters in the program yet, but we might need one or two before we are done.

91 PLC Programming with RSLogix 500 How to Program an Allen-Bradley SLC 500 with Rockwell Automation’s RSLogix 500 Copyright  2008 Modern Media modernmediaonline.com

Do the same with the N7 integer file.

92 PLC Programming with RSLogix 500 How to Program an Allen-Bradley SLC 500 with Rockwell Automation’s RSLogix 500 Copyright  2008 Modern Media modernmediaonline.com

Connecting To The SLC And Going Online You have written your program and now you are ready to download, or send, the Batching program to the computer. First, backup up your original file and put it in a safe place.

WARNING There are dangerous voltages present on terminals of the PLC. Follow all warnings and instructions from the Allen-Bradley manual for connecting power to the PLC. If you are not familiar with hazards and the potential dangers of these voltages STOP RIGHT NOW. Consult a trained professional who is able to assist you.

Check the serial port settings of your computer in Control Panel. Make sure the baud rate (or bits per second) of your COM port is set as high as possible 57600 should work there.

Allen-Bradley provides a cable to connect the serial port of your computer to the 9-pin serial port on the SLC 500 processor. Connect the cable and turn power on to the PLC. Turn the key operated switch on the processor to the center position PROG (program). If you do not have RSLinx installed, you will have to do that now. After you install RSLinx, you will have to configure it for your computer and your PLC. To do that, Choose Start > Programs > Rockwell Software > RSLinx > RSLinx

In the Notification are of your Taskbar (the lower right of your Windows screen) that looks like this.

The one on the left is the RSLinx Communications Service. The other one is for the RSI Directory Service. 93 PLC Programming with RSLogix 500 How to Program an Allen-Bradley SLC 500 with Rockwell Automation’s RSLogix 500 Copyright  2008 Modern Media modernmediaonline.com

Click on the left one, appear.

the RSLinx Communications Service. The RSLinx screen will

Choose Communications > Configure Drivers

94 PLC Programming with RSLogix 500 How to Program an Allen-Bradley SLC 500 with Rockwell Automation’s RSLogix 500 Copyright  2008 Modern Media modernmediaonline.com

The driver screen appears.

Choose RS-232 DF1 devices from the “Available Driver Types” drop-down menu. Click “Add New”.

Click “OK”.

95 PLC Programming with RSLogix 500 How to Program an Allen-Bradley SLC 500 with Rockwell Automation’s RSLogix 500 Copyright  2008 Modern Media modernmediaonline.com

You probably have your cable connected to COM1 of your computer. Click “AutoConfigure”.

96 PLC Programming with RSLogix 500 How to Program an Allen-Bradley SLC 500 with Rockwell Automation’s RSLogix 500 Copyright  2008 Modern Media modernmediaonline.com

In the box to the right of the “Auto-Configure” button, you should see a message that says “Auto Configuration Successful”. In addition, the “Device:” box should show “SLCCH0/Micro/PanelView”.

97 PLC Programming with RSLogix 500 How to Program an Allen-Bradley SLC 500 with Rockwell Automation’s RSLogix 500 Copyright  2008 Modern Media modernmediaonline.com

Click “OK”. You should see a screen like this.

Click “Close”. You may close the RSLinx screen – RSLinx will still run, as indicated by the icon in the Notification area of your taskbar. Open RSLogix.

98 PLC Programming with RSLogix 500 How to Program an Allen-Bradley SLC 500 with Rockwell Automation’s RSLogix 500 Copyright  2008 Modern Media modernmediaonline.com

Choose Comms > System Comm… from the menu. You will see a screen like this. You may have to maximize the screen and resize the panels to get the right view.

In the explorer panel on the left, click on the “+” next to “AB_DF1-1, DH-485”. You should see animation in the icon, as the tiny blue square moves around the little network symbol. The computer icon for address 00 indicates your computer. The icon for address 01 indicated the PLC. In our case, it is an SLC-5/03.

99 PLC Programming with RSLogix 500 How to Program an Allen-Bradley SLC 500 with Rockwell Automation’s RSLogix 500 Copyright  2008 Modern Media modernmediaonline.com

Select the SLC in the left window and click “OK”. The communications window will close. In the RSLogix 500 main screen, choose File. Select your program from the Recent File List (it is probably 1). Choose “Controller Properties” from the Project tree. Click on the “Controller Communications” tab.

Click on the “Driver” dropdown box and select “AB_DF-1-1”.

100 PLC Programming with RSLogix 500 How to Program an Allen-Bradley SLC 500 with Rockwell Automation’s RSLogix 500 Copyright  2008 Modern Media modernmediaonline.com

Click “Apply” then “OK”. Choose Comms > Download You should get a screen similar to this.

Choose “Yes”. The program will begin downloading.

101 PLC Programming with RSLogix 500 How to Program an Allen-Bradley SLC 500 with Rockwell Automation’s RSLogix 500 Copyright  2008 Modern Media modernmediaonline.com

Since we are downloading a new configuration, this screen will appear.

Choose “Apply”. The program is now in the PLC.

Sometimes it is necessary to cycle power on your computer. Making the first connection to a PLC can be tricky. Prepare yourself by having the phone number for your Rockwell rep handy.

102 PLC Programming with RSLogix 500 How to Program an Allen-Bradley SLC 500 with Rockwell Automation’s RSLogix 500 Copyright  2008 Modern Media modernmediaonline.com

If things go well, you may be able to go online right away. Choose Comms > Go Online

Choose “Browse” and find the folder where you file is located. Click “OK”. The file name will show in the bottom box. Click on it to select it, then click “Upload Use File”.

103 PLC Programming with RSLogix 500 How to Program an Allen-Bradley SLC 500 with Rockwell Automation’s RSLogix 500 Copyright  2008 Modern Media modernmediaonline.com

You may need to change the Baud Rate of the PLC. Click “Channel Configuration” in the Project tree and click on the “Chan. 0 – System” tab. Choose “19200” from the Baud dropdown menu. Click “Apply” and “OK”.

Tip: In Allen-Bradley PLC vernacular, upload means get the program from the PLC and load it in RSLogix on your computer. Download means send the program from RSLogix on your computer to the PLC. 104 PLC Programming with RSLogix 500 How to Program an Allen-Bradley SLC 500 with Rockwell Automation’s RSLogix 500 Copyright  2008 Modern Media modernmediaonline.com

You will now see a screen like this. Notice that the ladder icon is animated to indicate you are online.

105 PLC Programming with RSLogix 500 How to Program an Allen-Bradley SLC 500 with Rockwell Automation’s RSLogix 500 Copyright  2008 Modern Media modernmediaonline.com

R u n Mo de Before you go into Run Mode, make sure that the E-stop button works properly. I have not included wiring diagrams in this book, but most codes state that all control power is removed if the E-Stop button is pressed. NFPA 79 Electrical Standard for Industrial Machinery states the following: “9.2.2* Stop Functions. The three categories of stop functions shall be as follows: (1) Category 0 is an uncontrolled stop by immediately removing power to the machine actuators . . . 9.2.5.4.1 Emergency Stop. Emergency stop functions provided in accordance with 9.2.5.3 shall be designed to be initiated by a single human action. 9.2.5.4.1.1 In addition to the requirements for stop, the emergency stop shall have the following requirements: (1) It shall override all other functions and operations in all modes. (2) Power to the machine actuators, which causes a hazardous condition(s), shall be removed as quickly as possible without creating other hazards . . . (3) Reset of an emergency stop circuit shall not initiate a restart.” (National Fire Protection Association, 79-22, 79-23) Make sure you follow your company’s start-up procedures as you begin testing the system.

Test your E-Stop circuit thoroughly, even if you are working on a system that has been running for months or years. Be ready to hit the EStop button if you see a hazardous situation developing. 106 PLC Programming with RSLogix 500 How to Program an Allen-Bradley SLC 500 with Rockwell Automation’s RSLogix 500 Copyright  2008 Modern Media modernmediaonline.com

The next step is to put the processor in Run Mode. Do not enter this step lightly; you MUST keep the safety of your co-workers in mind. Look around the machine and make sure everyone is safely located. Find the mode drop-down menu in the upper left. It currently says “PROGRAM”. This means that the PLC is not currently running the program.

The key switch in the PLC has 3 positions: RUN (run mode), REM (remote run mode, meaning that the mode can be selected from RSLogix) and PROG (program mode). Carefully switch to REM. This puts the processor in remote run mode. Notice what the dropdown menu indicates.

107 PLC Programming with RSLogix 500 How to Program an Allen-Bradley SLC 500 with Rockwell Automation’s RSLogix 500 Copyright  2008 Modern Media modernmediaonline.com

Click on the dropdown and choose “Test Continuous”. This is a special mode that allows the program to run, but disables all outputs.

Scroll through the program using the scrollbar to the right in the LAD 2 – MAIN window. Looking at Rung 0003, for example, you can see that the System Enable bit B3:0/0 XIC is true, as indicated by the green highlight on the instruction. Any XIC instruction tells the PLC to look at a bit, and if the bit is ON, then the instruction is true. The system is not batching as shown by the XIO instruction used for B3:0/2. An XIO instruction tells the PLC to look at a bit, and if the bit is OFF, then the instruction is true. The XIO instruction in Rung 0003 is true because bit B3:0/2 is off. Because all of the preceding instructions before the B3:0/4 System Ready bit are true, the OTE is true. Again, it is highlighted.

108 PLC Programming with RSLogix 500 How to Program an Allen-Bradley SLC 500 with Rockwell Automation’s RSLogix 500 Copyright  2008 Modern Media modernmediaonline.com

Think of the equivalent hardwired relay circuit that would generate the same function as Rung 0003. Imagine that we have 3 relays, labeled B3:0/0, B3:0/2 and B3:0/4. We have wired a normally open contact of B3:0/0 in series to a normally closed contact of B3:0/2 and to the coil of B3:0/4. We have also wired a pilot light in parallel with the coil of our imaginary relay B3:0/4. The coil for relay B3:0/0 is energized, so the normally open contact is closed. The coil for relay B3:0/2 is not energized, so the normally closed contact of B3:0/2 remains closed. The coil of B3:0/4 is now energized. The pilot light is illuminated. Getting back to our PLC rung, you can see that the branch that contains the pilot light output shows that OTE is true also. However, since we are in TESTCONT mode, the output on the module is not electrically energized. You can look at the card and see that the LED for this output is off. Look at Rung 0007. The first two instructions look right, as the system is not batching and we are not in Batch Step 2. Neither of these is highlighted. However, the LEQ (less than or equal to) is true; Source A is 0, which is certainly less than the value of 1665 in Source B.

RSLogix does not highlight some instructions, such as an LEQ. You have to mentally compare the numbers yourself to see if the instruction is true.

109 PLC Programming with RSLogix 500 How to Program an Allen-Bradley SLC 500 with Rockwell Automation’s RSLogix 500 Copyright  2008 Modern Media modernmediaonline.com

We need to check our analog inputs. Double-click on “LAD 3 – ANALOG” in the Project tree.

There is no liquid in the tank, so our input reads 0. The SCP instruction puts a value of 0 in the output register N7:0. Rung 0001 of the analog ladder also reads correctly. Click on the “MAIN” tab at the bottom of the ladder window to return to the main ladder.

After you are convinced that all of your logic is working properly, click on the mode dropdown and select “Run”. A screen will appear asking you to verify the mode change to Run. If you choose “Yes”, the outputs on the PLC will be energized, so be ready with the E-Stop switch. Choose “Yes”.

110 PLC Programming with RSLogix 500 How to Program an Allen-Bradley SLC 500 with Rockwell Automation’s RSLogix 500 Copyright  2008 Modern Media modernmediaonline.com

The dropdown menu will now display “REMOTE RUN”.

You can look at the LED on the PLC for output O:5.0/0 and see that it is on. This output is for the System Ready pilot light. Scroll to Rung 0004. Press the Start Batch pushbutton and you should see the XIC instruction for I:4/0 highlighted. This makes the rung true, and B3:0/10 is turned on. Release the pushbutton and the rung will look like this.

Notice that even though the rung is no longer true, B3:0/10 is on. This is because it is a latch instruction and will remain on until the corresponding unlatch instruction is true. Scroll to Rung 0005. You can see that system is in Batch Step 1 and that the City Water valve is open. The pilot light is on.

111 PLC Programming with RSLogix 500 How to Program an Allen-Bradley SLC 500 with Rockwell Automation’s RSLogix 500 Copyright  2008 Modern Media modernmediaonline.com

The liquid level in the tank is rising as shown in the LEQ instruction.

The sequence continues as the specified levels for each ingredient are reached. As the ingredients are added, the tank level rises. When all the ingredients have been added, the batch is blended and set to the filling lines. The program functions as specified in the original Project Scope.

112 PLC Programming with RSLogix 500 How to Program an Allen-Bradley SLC 500 with Rockwell Automation’s RSLogix 500 Copyright  2008 Modern Media modernmediaonline.com

Editing in Run Mode As always, though, there is a change in the project procedure. There is a storage tank on the filling lines that Mixing Tank Pump PUMP-MT feeds. The Process Engineer indicates that there may be a possibility of supplying too much finished product to this tank and that it could overflow. He decides the storage tank should have a high level switch mounted in it. If the level in the storage tank gets too high, he wants you to disable the Mixing Tank pump. We still have spare inputs available. Let’s use I:4/14. It is decided that the high level switch will be wired in the failsafe mode; that is, the level switch will be closed until a high level is reach. When wired in that fashion, if the wiring to the switch fails, you will not receive a signal from the storage tank pump and the PLC will stop the Mixing Tank Pump. The system will not run until the problem is corrected. Scroll to Rung 0017. Double-click on the rung number. A column of “e’s” will appear. The rung is now open for editing. Click and drag the XIC tool button to the first marker after I:4/9. When the marker turns green, release the mouse button.

113 PLC Programming with RSLogix 500 How to Program an Allen-Bradley SLC 500 with Rockwell Automation’s RSLogix 500 Copyright  2008 Modern Media modernmediaonline.com

Type I:4/14 and press enter. Add the descriptor “Filling Line Storage Tank Ready” and click “OK”.

114 PLC Programming with RSLogix 500 How to Program an Allen-Bradley SLC 500 with Rockwell Automation’s RSLogix 500 Copyright  2008 Modern Media modernmediaonline.com

Up to this point, your changes have not been integrated into the sequence of the program. You will notice that just below the rung you are editing the original version of the rung is displayed.

To get your changes into the sequence, you must perform 3 steps: 1. Accept the current rung edits 2. Test the edits 3. Assemble the edits.

115 PLC Programming with RSLogix 500 How to Program an Allen-Bradley SLC 500 with Rockwell Automation’s RSLogix 500 Copyright  2008 Modern Media modernmediaonline.com

Make sure the rung number area is still highlighted in red. Locate the “Accept Current Rung Edit” tool in the ladder window.

By the way, if you want to cancel your current edits, click the tool to the immediate right of the “Accept Current Rung Edit” tool. This is called “Cancel Current Rung Edits” . Click on the “Accept Current Rung Edit” tool

.

The tool will be now grayed out and the “Test Edits” tool now becomes available. In addition, the “Cancel Edits” tool is available. You can click this if you want to cancel your edits.

116 PLC Programming with RSLogix 500 How to Program an Allen-Bradley SLC 500 with Rockwell Automation’s RSLogix 500 Copyright  2008 Modern Media modernmediaonline.com

The rung number area now shows a column of vertical bars and the revision rung below shows a column of vertical “R’s”.

Click on the “Test Edit” button action. Choose “Yes”.

. A dialog box will appear asking you to verify this

117 PLC Programming with RSLogix 500 How to Program an Allen-Bradley SLC 500 with Rockwell Automation’s RSLogix 500 Copyright  2008 Modern Media modernmediaonline.com

The ladder window now looks like this screenshot. The output has still not changed, but you can see that the new input for the Filling Line Storage Tank is on and is working properly.

You could still cancel your edits at this point with the “Untest Edits” tool button

.

118 PLC Programming with RSLogix 500 How to Program an Allen-Bradley SLC 500 with Rockwell Automation’s RSLogix 500 Copyright  2008 Modern Media modernmediaonline.com

The final step is to “Assemble Edits”. Locate the “Assemble Edits” tool icon

.

119 PLC Programming with RSLogix 500 How to Program an Allen-Bradley SLC 500 with Rockwell Automation’s RSLogix 500 Copyright  2008 Modern Media modernmediaonline.com

Click on the icon. A dialog box will appear asking you for confirmation. Choose “Yes”.

Your online edit is now complete. The Mixing Tank pump will not run unless it receives a signal from the Filling Line Storage tank indicating the tank is ready to receive finished product.

120 PLC Programming with RSLogix 500 How to Program an Allen-Bradley SLC 500 with Rockwell Automation’s RSLogix 500 Copyright  2008 Modern Media modernmediaonline.com

A Final Note About Our Program You may have noticed that we ignored some aspects of the system that perhaps should have been addressed. For example, in a real world system, you would probably have to make sure that the supply of ingredients QR and KM are available. If not, the pumps could run dry, and this is probably undesirable. Another nice feature of the program would be to make sure the weight in the tank is changing if we are adding an ingredient. If not, this certainly indicates some kind of problem and the system should probably be shut down. I have intentionally left out features like this for simplicity’s sake. I don’t want to overwhelm you with too many “what ifs”. The bottom line is that we fulfilled the Project Scope. This is the single most important aspect of creating a successful program. Feel free to ponder enhancements to this batching logic. Perhaps you can use those ideas on your first real-world batching program.

121 PLC Programming with RSLogix 500 How to Program an Allen-Bradley SLC 500 with Rockwell Automation’s RSLogix 500 Copyright  2008 Modern Media modernmediaonline.com

How Do I . . . ? Here is an FAQ section to address the most asked questions regarding RSLogix. How do I . . . ? Turn off Rung Comments View > Properties > Comment Display uncheck Show Rung Comments

Change The Screen Font View > Properties > Fonts

Show 3D Instructions View > Properties > Miscellaneous

Check Show 3D Instructions Edit A Rung In Run Mode (see the “Editing in Run Mode” section in this book) Double-click on the rung number Make the changes to the rung. Click “Accept Current Rung Edits” Click “Test Edits” Confirm the dialog box. Click “Assemble Edits”

.

Confirm the dialog box. Hint: instead of moving your pointer to confirm each dialog box, just press the space bar – this is much faster. 122 PLC Programming with RSLogix 500 How to Program an Allen-Bradley SLC 500 with Rockwell Automation’s RSLogix 500 Copyright  2008 Modern Media modernmediaonline.com

Cancel An Edit In Run Mode Depending on what stage of the edit you are in, click one of these icons: Cancel current rung edits Cancel Edits

.

Untest Edits

.

.

Find An Instruction In The Program When You Only Know Some Of The Descriptor Or Rung Comment Press CTRL-F. Make sure the appropriate right boxes are checked. Type the text in the “Find What:” box. Click “Find Next” or “Find All”. Go Back To The Last Rung I Was Working On Use the “Logic Trace” toolbar.

If it is not visible, choose View > Toolbars and check “Logic Trace”. You can also drag it to the ladder window and it will become free floating. Open Another Program, But Still Keep My Existing Program On Screen Just start RSLogix again. You can open a number of RSLogix windows simultaneously. Compare One Program To Another For Differences This is handy if you have two programs for the same machine and there is confusion over which is the latest revision. Choose Tools > Compare and fill in the blanks. Force An Output On A Module To Come On 123 PLC Programming with RSLogix 500 How to Program an Allen-Bradley SLC 500 with Rockwell Automation’s RSLogix 500 Copyright  2008 Modern Media modernmediaonline.com

Right-click on the output in the ladder logic. Choose “Force On”. In the Forces Disabled/Enabled drop down, choose “Enable All Forces”. This will force on the output and turn on the device that is connected to the output, no matter what the logic in the rung says. The corresponding LED on the output module will come on. Use this with caution. Force An Input On A Module To Come On This differs from forcing on an output in that you can’t force electricity to become present at an input, but the PLC will think there is. Right-click on the input in the ladder logic. Choose “Force On”. Unlike forcing an output, the corresponding LED in the input module will not come on. Find Out How Much Memory Is Left In The PLC Choose File > Summary Info > Statistics Get Help On A Specific Instruction Choose Help > SLC Instruction Help Disconnect From The PLC After All The Programming Changes Are Made Choose File > Save (save the data tables). Disconnect the interface cable.

Tips, Shortcuts and Warnings Use The Data Table To Find Unused Bits As You Write Your Program. If you are writing a large program and using many B3 file bits, it is easy to lose track of what bits are available. Right-click on an instruction and choose Goto Data Table. Click the “Usage” button and an “X” will show what addresses you have already used. This technique works with any type of file, such as timers, counters and integers.

124 PLC Programming with RSLogix 500 How to Program an Allen-Bradley SLC 500 with Rockwell Automation’s RSLogix 500 Copyright  2008 Modern Media modernmediaonline.com

The Date Attribute Of The File Is Updated Every Time You Go Online Even If You Don’t Save The Program. Keep this in mind as you track your revisions. You Cannot Add Program Files Or Expand Data Tables When You Are In Run Mode. Try to think ahead and include all the files as you write the program offline. Sometimes you don’t have the option of shutting a machine down because, for example, you have used all the timers in your T4 file and you need a new timer. Use Search And Replace With Caution. Try to avoid the “Replace All” button unless you are absolutely, positively sure that things will come out right. There is no “Undo”. It is much safer to use the “Find Next” and “Replace” buttons. That way you can evaluate each change you make. Attach Rung Comments To The Output, Not The Rung Number. The default in RSLogix is to attach comments to the rung number. Choose Tools > Options… > System Preferences and select “Output Address”. Don’t Fault The Processor In Run Mode. Make sure you don’t ask the PLC to do anything like dividing by zero. The PLC will fault and the machine will stop. This can be very embarrassing. Backup Your Files Frequently. The easiest way is to “rev” your filename every so often, at least once every 30 minutes. Choose File > Save as and put a number behind the filename. Sometimes, files are corrupted through no fault of your own. You can always go back to the previous version so that you have not lost all of your work. Disable A Rung With An AF. If you want to temporarily disable a rung, set aside a bit that you know will always be false. Label it “AF” for “always false” and use it with an XIC to temporarily disable a rung.

125 PLC Programming with RSLogix 500 How to Program an Allen-Bradley SLC 500 with Rockwell Automation’s RSLogix 500 Copyright  2008 Modern Media modernmediaonline.com

Don’t Turn Off Power To The PLC OR Your Computer During An Online Edit. There is a good chance this will corrupt your current file. Keep The Original Program In A Very Safe Place. If you need to make some changes on an existing program, upload the program from the PLC and store it on a floppy or a CD. If things go awry with your editing, you can always put the program back the way it was. Keep Track Of What You Are Doing If You Modify An Existing Program. People will want to know. Rung Comments Are Extremely Important. Not only will they explain the operation of the program to someone else, they will remind you of why you programmed the logic the way you did. Set The Date And Time. Double click on “Processor Status” in the “Project” tree. To the right, you will see the fields you need to fill in to set the date and time. You can also use these words (S:37 through S:42) in your ladder logic. Use Passwords Carefully. If you use one, don’t forget it . . . but if you do, your Rockwell rep can show you how to get around it. Find Errors After A PLC Fault. Open the “Processor Status” file in the “Project” tree and click on the “Errors” tab. Take note of the Error Description and click “Clear Major Error”. Find the logic in your code and correct it before you go back online. Make Sure Your Program Is Programmed Properly For A System Power-Up. There can be no machine motion until the operator initiates it. Set Up A Printout. Choose File > Report Options. This shows you everything you can print. If you are not careful, though, you may get hundreds of pages, many of which you don’t need. Use the “Print Preview” button to make sure you are getting only what you want.

126 PLC Programming with RSLogix 500 How to Program an Allen-Bradley SLC 500 with Rockwell Automation’s RSLogix 500 Copyright  2008 Modern Media modernmediaonline.com

Address ONS (One Shots) Individually. An ONS instruction is used to turn on a bit for one scan. The trick here is to remember that in an A-B PLC, each ONS needs its own unique address. If you are working on a large program, it may behoove you to create a new binary file just to hold your oneshots. Load And Save Your Workspace. This is a nifty way for RSLogix to remember your window positions and the files that you would like to be opened the next time you run RSLogix. Choose File > Load/Save Workspace to access this. Symbols This is a type of label that can be used as a substitute for an address. There are some advantages in terms of exporting the database, but in my experience, they are not used much. Use CTRL-G To Goto Things Real Fast. CTRL-G brings up a dialog box. Enter in a rung number or text to go to the first occurrence of the search string.

When You Are Done, Store Your Program To The EEPROM In The PLC. It is a good idea to save your ladder file to the EEPROM. The onboard battery will keep your program in the PLC’s RAM, but if the battery fails, the EEPROM will hold the program. Don’t Lose All Your Rung Comments And Address Descriptors. Your rung comments and address descriptors are not stored in the PLC when you download your program. If you were to go online without choosing a database, upload the file to your computer and save it, there is a chance that you could overwrite the file that has all the rung comments and address descriptors. Use Revision Notes That way, you will know what you did the last time you were there. Use Tools > Options… to switch on revision notes. 127 PLC Programming with RSLogix 500 How to Program an Allen-Bradley SLC 500 with Rockwell Automation’s RSLogix 500 Copyright  2008 Modern Media modernmediaonline.com

Use The Built-In Automatic Program Backup Choose Tools > Options… and set your Project Files Search Path. Make sure AutoSave is enabled. RSLogix will automatically save your file every few minutes (the default is 10 minutes). Create An HMI In RSLogix. RSLogix provides quick way to create an HMI (Human Machine Interface). It is not something you might want to use as a final solution for a factory floor, as anyone could get in and change your program, but it is pretty handy for start-up and troubleshooting. Double-Click on “CGM 0” in the “Custom Graphical Monitors” section of the “Project” tree. Click on a button at the top of the CGM screen to select it. In the screen area, click and drag a square to create the object. Click and drag an address from your ladder program and drop it on the object you just made. Double-click on the object to change parameters and you will end up with something like this.

When you are in Run Mode, click on the blue arrow to run the CGM.

Write Your Rung Comments In The Present Tense. You can then cut and paste them into a document to make an operator’s manual. Write Your Rung Comments In A Standalone Word Processor (such as Word) Spell check them, then cut and paste them into RSLogix. 128 PLC Programming with RSLogix 500 How to Program an Allen-Bradley SLC 500 with Rockwell Automation’s RSLogix 500 Copyright  2008 Modern Media modernmediaonline.com

Conclusion I hope that you have found the information in this book useful. Some of the concepts we have covered may seem confusing at first, but with time and effort, you will be able to program a PLC to do whatever you want it to do. I wish you the best of luck in your endeavors.

129 PLC Programming with RSLogix 500 How to Program an Allen-Bradley SLC 500 with Rockwell Automation’s RSLogix 500 Copyright  2008 Modern Media modernmediaonline.com

Index 1746-IA16 120VAC Input Module, 27 1746-NI4 Analog 4 Channel Input Module, 27 1746-OW16 Relay Output Module, 27 AB_DF1, 99 Accept Current Rung Edit, 116 Accept Current Rung Edits, 122 Analog Inputs, 27 Assemble Edits, 119, 122 Assigning I/O Addresses, 27 Backup Your Files, 125 Baud Rate, 104 BIT, 11 Cancel An Edit, 123 CGM, 128 Change The Screen Font, 122 COM1, 96 Configuring Colors, Fonts and Address Display, 36 COUNTER, 13 Create An HMI In RSLogix, 128 Descriptors, 37 Digital Inputs, 28 Digital Outputs, 29 Disable A Rung With An AF, 125 Done bit (DN), 66, 69 Download, 9, 10, 101, 104 Downloading, 9 EEPROM, 127 Enable bit (EN), 66, 67 Expand Data Tables When You Are In Run Mode., 125 Fault The Processor, 125 Find Errors After A PLC Fault, 126 Force, 123, 124 GEQ, 59, 61, 64, 70, 71 Goto, 127 GRT, 79 HARDWIRED INPUT, 12

HARDWIRED OUTPUT, 12 I/O Modules, 7 Installing RSLogix, 30 INSTRUCTION, 11 JSR, 52, 56, 80 LED, 109, 111, 124 LEQ, 57, 58, 61, 64, 70, 71, 109, 112 limit switches, 22, 24, 70, 71, 72, 73, 74, 88 Memory, 124 MicroLogix, 5, 7, 8, 9, 13, 30, 132 NFPA, 106 normally open, 11, 14, 16, 24, 73, 109 One Shots, 127 online edit, 120 OTE, 14, 42, 43, 47, 57, 58, 61, 63, 67, 71, 72, 81, 108, 109 OTL, 49, 51, 62, 69, 71 OTU, 49, 59, 62, 69 Passwords, 126 Pilot Lights, 81 Printout, 126 PROG, 93, 107 program mode, 89, 107 Project Scope, 17 REM, 107 REMOTE RUN, 111 remote run mode, 107 RET, 57, 80 Revision Notes, 127 RS-232, 95 RSLinx, 9, 10, 93, 94, 98, 132 RSLinx Communications Service, 93, 94 RSLinx Lite, 9, 10 RSLogix 500 Software, 8 run mode, 107 RUNG, 12 Rung Comments, 85, 122, 125, 126, 127, 128 130

PLC Programming with RSLogix 500 How to Program an Allen-Bradley SLC 500 with Rockwell Automation’s RSLogix 500 Copyright  2008 Modern Media modernmediaonline.com

Running RSLogix, 31 Scan Time, 16 Search And Replace, 125 Set The Date And Time, 126 SLC 5/03, 27 SLC 500, 1, 6, 7, 11, 12, 30, 93 SLC Power Supply, 6 SLC Rack, 6 System Fault, 42, 43, 75, 78, 79, 84 System Power-Up, 126 Test Continuous, 108 Test Edit, 117 Test Edits, 116, 122 The Date Attribute Of The File Is Updated Every Time You Go Online Even If You Don’t Save The Program., 125 Time Base, 66

timer, 11, 13, 14, 37, 65, 66, 67, 68, 69, 70, 72, 74, 75, 76, 89, 125 TIMER, 13 Timer On Delay, 66 Ultrasonic Level Sensor, 19, 21, 22, 25, 27, 39, 51, 70 Untest Edits, 118, 123 upload, 104, 126, 127 Use The Built-In Automatic Program Backup, 128 Use The Data Table To Find Unused Bits As You Write Your Program, 124 voltage, 7, 14, 54 Workspace, 127 XIC, 11, 14, 37, 41, 43, 44, 46, 49, 57, 59, 62, 63, 65, 67, 69, 70, 76, 108, 111, 113, 125 XIO, 14, 37, 42, 43, 44, 47, 50, 63, 74, 76, 108

131 PLC Programming with RSLogix 500 How to Program an Allen-Bradley SLC 500 with Rockwell Automation’s RSLogix 500 Copyright  2008 Modern Media modernmediaonline.com

THE FOLLOWING ARE TRADEMARKS OF ROCKWELL AUTOMATION, INC. Allen-Bradley® MicroLogix™ PanelView™ RSLinx® RSLogix™ RSLogix™ 500 SLC™ 500 THE AUTHOR OR THE PUBLISHER OF THIS BOOK IS IN NO WAY AFFILIATED WITH ROCKWELL AUTOMATION, INC.

Disclaimer THE AUTHOR INTENDS THIS DOCUMENT TO BE ADVISORY ONLY. ITS USE IN INDUSTRY OR TRADE IS STRICTLY VOLUNTARY. THIS DOCUMENT IS PROVIDED BY THE VENDOR “AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE VENDOR OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS DOCUMENT, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Courtesy of Rockwell Automation, Inc.

132 PLC Programming with RSLogix 500 How to Program an Allen-Bradley SLC 500 with Rockwell Automation’s RSLogix 500 Copyright  2008 Modern Media modernmediaonline.com

View more...

Comments

Copyright ©2017 KUPDF Inc.
SUPPORT KUPDF