PLC Programming With RSLogix 500 Excerpt PDF
PLC Programming With RSLogix 500 Excerpt PDF
Programming
with
RSLogix 500
How to Program an
Allen-Bradley PLC with
Rockwell Automations
RSLogix 500
By Jack Rindell
Table of Contents
Introduction!......................................................................................1
PLCs!...............................................................................................2
Hardware!.........................................................................................3
SLC Rack!........................................................................................3
SLC Power Supply !..........................................................................3
SLC Processors!..............................................................................3
SLC I/O Modules!.............................................................................4
MicroLogix 1000!..............................................................................4
MicroLogix 1200!..............................................................................4
MicroLogix 1500!..............................................................................4
Ladder Logic!....................................................................................5
The Dialect of PLCs!........................................................................5
Equivalent Logic!..............................................................................9
Scan Time!.......................................................................................10
Project Scope!..................................................................................11
Summarizing the Scope!..................................................................17
Which PLC?!....................................................................................18
Lay Out The I/O!..............................................................................18
Laying Out The Modules In The Rack!.............................................20
Assigning I/O Addresses!.................................................................21
Analog Inputs!..................................................................................21
Digital Inputs!...................................................................................22
Digital Outputs!................................................................................23
Installing RSLogix!...........................................................................24
Installing RSLogix 500!....................................................................24
Running RSLogix!............................................................................25
Configuring Colors, Fonts and Address Display !.............................31
Adding Descriptors To Your I/O!.......................................................31
Writing the Program!........................................................................34
Setting Up An Overall Control Rung!...............................................34
Starting a Batch Cycle!....................................................................37
Batching Steps!................................................................................42
Step 1 Adding City Water!.............................................................42
Analog Inputs!..................................................................................45
Setting up an SCP to calculate Tank Weight!...................................48
Setting Up An SCP To Calculate Tank Level!...................................50
Back to Batching Step 1!...............................................................51
Step 2 Adding Chemical KM!........................................................54
Step 3 Adding Chemical KM!........................................................58
Step 4 Blending!............................................................................59
Step 5 Pump to Filling Lines!........................................................64
Faults!..............................................................................................66
PLC Programming with RSLogix 500
Copyright 2013 Modern Media & Automation, LLC
engineer-and-technician.com
Introduction
The purpose of this book is to teach you how to set up, program and use an Allen-Bradley 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
Beginners 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 Beginners 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.
Go to engineer-and-technician.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 Rockwells proprietary
software known as RSLogix.
In the book, we will concentrate specifically on the SLCs, MicroLogix PLCs and RSLogix. We
wont talk about other manufacturers or other Rockwell software, as RSLogix will (and currently
does) perform nearly all the programming requirements of a plants 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 cant 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.
Hardware
One of the nice things about Allen-Bradleys smaller PLCs is the relative simplicity of assembling
the hardware to create a system.
First, lets 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 computers 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 Processors
There are five SLC 500 processors available:
SLC 5/01
SLC 5/02
SLC 5/03
SLC 5/04
SLC 5/05
PLC Programming with RSLogix 500
Copyright 2013 Modern Media & Automation, LLC
engineer-and-technician.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 isnt a comprehensive summary, but if you are just starting out, the information
presented here 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.
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 lets 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.
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.
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 dont, 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.
11
Hyper-Glass Cleaner
Batching Project Scope
Goal
The goal of this project is to install a new automated batching system for mixing Hyper-Glass
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.
12
The operator will then press the START BATCH pushbutton to begin the batching process. The
SYSTEM READY pilot light will turn off. No further operator input is required.
Step 1 City Water
Automatic valve AV-CW will open. The ADDING WATER pilot light will illuminate.
Valve AV-CW will remain open until 1275 lbs. of City Water is in the Mixing Tank. Valve AV-CV
will close.
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.
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, valve AV-CW will close and the ADDING WATER pilot
light will turn off.
Step 2 Ingredient QR
Valve AV-QR will be opened. After the valve position has been verified by LS-QR2, PUMP-QR
will pump 390 lbs. of ingredient QR into the Mixing Tank. The ADDING QR pilot light will be
illuminated while the pump is running.
After the ingredient QR has been added to the Mixing Tank, PUMP-QR stops and the ADDING
QR pilot light will turn off. Valve AV-QR will close.
Step 3 Ingredient KM
Valve AV-KM will be opened. After the valve position has been verified by LS-KM2, PUMP-KM
will pump 173 lbs. of ingredient KM into the mixing tank. The ADDING KM pilot light will be
illuminated while the pump is running.
After the ingredient KM has been added to the Mixing Tank, valve AV-KM will close. PUMP-KM
will stop. 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.
Step 4 Mixing
The agitator will run for 3 minutes. The BLENDING pilot light will illuminate.
After the agitator is finished, the BLENDING pilot light will turn off.
16
Which PLC?
There are certainly a number of factors that will determine which PLC you need. Without getting
into all of those, lets 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.
A bit of advice here: Dont 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.
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.
PLC Programming with RSLogix 500
Copyright 2013 Modern Media & Automation, LLC
engineer-and-technician.com
18
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 cant stress how important it is to get the verbiage right in a descriptor. For example, lets 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.
If we used the descriptor
Limit Switch
LS-CW1
that wouldnt 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.
19
20
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.
Signal/Module Type
Slot
Address
Scales
0-10VDC Input
I:1.0
0-10VDC Input
I:1.1
spare
I:1.2
spare
I:1.3
21
Running RSLogix
To run RSLogix, click:
Start > All Programs > Rockwell Software > RSLogix 500 English > RSLogix 500 English
25
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
PLCs 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.
30
We want to use the E-Stop input in this rung. Find the XIC (examine if closed)
the User menu.
tool button in
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
34
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.
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.
35
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.
42
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 doesnt 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 0001.
Press CTRL-C.
Click on the rung number for Rung 0003.
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.
43
116
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
Show 3D Instructions
View > Properties > Miscellaneous
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
117
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 cant 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.
119
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
Running RSLogix, 31
Scan Time, 16
Search And Replace, 125
Set The Date And Time, 126
SLC 5/03, 27
126
127
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.
128