You are on page 1of 266

n

ct ,
du nly
io
ro O
ep w
INTRODUCTION TO
e
r R vi

PROGRAMMABLE LOGIC
e
Fo R

CONTROLLERS
ot or
F

STUDENT GUIDE
N
Introduction to Programmable Logic
Controllers

Table of Contents

INTRODUCTION ............................................................................................................. 1 
OBJECTIVES .................................................................................................................. 1 
NUMBER THEORY ......................................................................................................... 2 
Identifying the Base of a Number ............................................................................... 2 
Positional Notation and the Decimal Numbering System ........................................... 3 
The Binary Number System ....................................................................................... 4 
Binary System Positional Notation........................................................................ 5 

n
ct ,
How to Convert a Number from Binary to Decimal ............................................... 5 

du nly
How to Convert a Number from Decimal to Binary ............................................... 6 

io
The Octal Number System ......................................................................................... 7 
Octal System Positional Notation ......................................................................... 7 
How to Convert a Number from Octal to Decimal ................................................. 8 

ro O
How to Convert a Number from Decimal to Octal ................................................. 8 
Conversions between Octal and Binary ................................................................ 9 
ep w
How to Convert a Number from Octal to Binary.................................................... 9 
How to Convert a Number from Binary to Octal.................................................. 10 
e
The Hexadecimal System ........................................................................................ 11 
Conversions between Hexadecimal and Binary ................................................. 12 
r R vi

How to Convert a Number from Hexadecimal to Binary ..................................... 12 


How to Convert a Number from Binary to Hexadecimal ..................................... 13 
e

INTRODUCTION TO THE PLC-5.................................................................................. 14 


Fo R

PLC-5 Hardware ...................................................................................................... 14 


Equipment Chassis............................................................................................. 15 
ot or

Power Supply Module ......................................................................................... 16 


Processor Module............................................................................................... 17 
F

Key Switch .................................................................................................... 20 


Front Panel LEDs .......................................................................................... 20 
Battery ........................................................................................................... 22 
Processor Module DIP Switches ................................................................... 22 
Memory Modules ........................................................................................... 24 
N

Input Modules, Output Modules, and Field Wiring .............................................. 24 


Input Modules................................................................................................ 24 
Output Modules ............................................................................................. 28 
Field Wiring ................................................................................................... 30 
Remote I/O Adapter Module ............................................................................... 31 
PLC-5 System Operation ......................................................................................... 33 
Signal Flow Paths ............................................................................................... 35 
Ladder Logic and I/O Control.............................................................................. 36 
Remote I/O ......................................................................................................... 38 
Linking Multiple Processors ................................................................................ 39 

i
Introduction to Programmable Logic
Controllers

RSLOGIX 5 INTRODUCTION ....................................................................................... 40 


Screen Layout and Organization ............................................................................. 41 
Ladder Window................................................................................................... 42 
Project Window................................................................................................... 44 
Controller Folder ........................................................................................... 45 
Program Files Folder ..................................................................................... 46 
Data Files Folder ........................................................................................... 47 
Results Window .................................................................................................. 53 
Windows Toolbar ................................................................................................ 55 
Standard Toolbar ................................................................................................ 56 
Instruction Toolbar .............................................................................................. 57 
On-Line Toolbar.................................................................................................. 58 

n
ct ,
du nly
Finding Help ............................................................................................................. 59 

io
FILES, MEMORY AREAS, AND ADDRESSING ........................................................... 61 
Memory Areas.......................................................................................................... 61 

ro O
Program Memory Area ....................................................................................... 62 
How to Create a New Program File ............................................................... 63 
Data Memory Area ............................................................................................. 68 
ep w
How to Create a New Data File ..................................................................... 70 
Addressing ............................................................................................................... 75 
e
Logical Addressing ............................................................................................. 75 
r R vi

Indexed Addressing ............................................................................................ 77 


Indirect Addressing ............................................................................................. 78 
e

Symbolic Addressing .......................................................................................... 81 


How to Create or Edit a Symbolic Name for an Address ............................... 82 
Fo R

I/O Image Addressing ......................................................................................... 85 


Chassis, Slots, I/O Racks, and Groups ......................................................... 86 
ot or

Slot Addressing for I/O Transfer .................................................................... 88 


Examples of I/O Image Addressing ............................................................... 92 
F

USING RSLOGIX 5 ....................................................................................................... 93 


Going On-Line with a Controller ............................................................................... 93 
How to Go On-Line with a Controller .................................................................. 93 
Uploading a Project from a PLC-5 ........................................................................... 98 
How to Upload a Project ..................................................................................... 98 
N

Saving a Project ..................................................................................................... 101 


How to Save a Project ...................................................................................... 101 
How to Change the Default Path where Projects are Saved ............................ 104 
Downloading a Project to a PLC-5 ......................................................................... 106 
How to Download a Project .............................................................................. 106 
Editing Ladder Logic .............................................................................................. 112 
Edit Zone Markers ............................................................................................ 112 
Online Editing ................................................................................................... 113 
Online Editing Restrictions .......................................................................... 114 
How to Verify, Accept, Test, and Assemble Online Edits ............................ 114 

ii
Introduction to Programmable Logic
Controllers

Offline Editing ................................................................................................... 125 


How to Verify a Single Rung ....................................................................... 125 
How to Verify a File or Project ..................................................................... 127 
UNDO and REDO............................................................................................. 127 
Inserting and Appending Rungs of Ladder Logic ................................................... 128 
How to Insert a Rung ........................................................................................ 128 
How to Append a Rung .................................................................................... 130 
Branching ............................................................................................................... 132 
How to Insert a Branch ..................................................................................... 132 
PROGRAMMING WITH BIT INSTRUCTIONS ............................................................ 135 
Selected Bit Instructions ........................................................................................ 135 

n
ct ,
Examine IF CLOSED (XIC) .............................................................................. 136 

du nly
Examine IF OPEN (XIO) ................................................................................... 139 

io
Output Enable Instruction (OTE) ...................................................................... 140 
Output Latch (OTL)........................................................................................... 141 

ro O
Output Unlatch (OTU) ....................................................................................... 141 
Using Bit Instructions ............................................................................................. 142 
How to Insert Bit Instructions into a Program ................................................... 143 
ep w
How to Assign a Logical Address Directly at the Instruction ............................. 148 
How to Drag and Drop a Logical Address from a Data File .............................. 153 
e
How to Search for Unused Logical Addresses ................................................. 156 
r R vi

PROGRAMMING WITH TIMERS ................................................................................ 159 


Timer Operation ..................................................................................................... 159 
e

Timer Type ....................................................................................................... 159 


Fo R

Timer On-Delay (TON) ................................................................................ 160 


Timer Off-Delay (TOF) ................................................................................ 161 
Retentive Timer On-Delay (RTO) ................................................................ 161 
ot or

Timer Address .................................................................................................. 162 


Timer Preset Value ........................................................................................... 162 
F

Timer Accumulator Value ................................................................................. 162 


Timer Status Bits .............................................................................................. 163 
Time Base ........................................................................................................ 163 
Reset Timer/Counter Instruction (RES) ................................................................. 164 
Using Timer Instructions ........................................................................................ 164 
N

How to Insert a New Timer into a Program ....................................................... 164 


How to Assign or Modify a Timer Address ........................................................ 167 
How to Assign or Modify a Time Base and Preset............................................ 172 
Changing the Time Base ............................................................................. 172 
Changing the Timer Preset ......................................................................... 174 
How to Program the Timer Status Bits ............................................................. 175 
How to Reset the RTO Accumulator using the RES Instruction ....................... 179 
PROGRAMMING WITH COUNTERS ......................................................................... 184 
Counter Operation ................................................................................................. 184 
Counter Type .................................................................................................... 184 

iii
Introduction to Programmable Logic
Controllers

Count Up Counter (CTU)............................................................................. 185 


Count Down Counter (CTD) ........................................................................ 185 
Counter Address............................................................................................... 186 
Counter Preset Value ....................................................................................... 186 
Counter Accumulator Value .............................................................................. 186 
Counter Status Bits........................................................................................... 186 
Using Counter Instructions ..................................................................................... 187 
How to Insert a New Counter into a Program ................................................... 187 
How to Assign or Modify a Counter Address .................................................... 190 
How to Assign or Modify a Preset Value at the Instruction ............................... 193 
How to Assign or Modify a Preset Value using the C5 Data File ...................... 195 
How to Create an Up/Down Counter ................................................................ 198 

n
ct ,
du nly
TROUBLESHOOTING ................................................................................................ 199 

io
Systematic Troubleshooting ................................................................................... 199 
Clearing Processor Memory .................................................................................. 200 

ro O
How to Clear Processor Memory ...................................................................... 201 
Forcing I/O Bits ...................................................................................................... 204 
How to Determine the Status of Forces in a Project ......................................... 206 
ep w
How to Install and Remove a Force Using Popup Menus ................................ 208 
How to Install and Remove a Force Using the Force Tables ............................ 214 
e
Cross Referencing Instructions .............................................................................. 221 
r R vi

How to Open the Cross Reference Report ....................................................... 222 


From the Ladder Window ............................................................................ 222 
e

From the Project Window ............................................................................ 224 


Data Table Monitoring............................................................................................ 227 
Fo R

How to Open a Data Table ............................................................................... 228 


From the Ladder Window ............................................................................ 228 
ot or

From the Project Window ............................................................................ 230 


How to Change Values Using a Data Table ..................................................... 232 
Searching ............................................................................................................... 234 
F

How to Search using Popup Menus at an Instruction ....................................... 234 


How to Search using Drop Down Menus from the Windows Toolbar ............... 237 
Find ............................................................................................................. 238 
Replace ....................................................................................................... 240 
Go To .......................................................................................................... 241 
N

How to Search Using the Standard Toolbar ..................................................... 244 


Histograms ............................................................................................................. 248 
How to Create a Histogram .............................................................................. 249 

iv
Introduction to Programmable Logic
Controllers

List of Figures
Figure 1: Equipment Chassis ....................................................................................... 15 
Figure 2: Power Supply Module ................................................................................... 16 
Figure 3: PLC 5/15 Processor Module ......................................................................... 19 
Figure 4: Processor Module Switches .......................................................................... 23 
Figure 5: 1771-IAD AC Input Module ........................................................................... 26 
Figure 6: 1771-OAD AC Output Module ....................................................................... 29 
Figure 7: Remote I/O Adapter Module.......................................................................... 31 
Figure 8: Hypothetical Circuit ....................................................................................... 33 
Figure 9: Hypothetical Circuit Controlled by PLC System ............................................ 34 

n
ct ,
du nly
Figure 10: Vat Control System ..................................................................................... 36 

io
Figure 11 Hardwired Vat Control System ...................................................................... 36 
Figure 12: PLC Vat Control System ............................................................................. 37 
Figure 13: Hardwired System Changes........................................................................ 37 

ro O
Figure 14: PLC System Changes ................................................................................. 38 
Figure 15: RSLogix 5 Main Window ............................................................................. 41 
Figure 16: Ladder Window ........................................................................................... 42 
ep w
Figure 17: Ladder Window with Multiple Open Programs ............................................ 43 
e
Figure 18: Renaming a Program .................................................................................. 43 
Figure 19: Project Window ........................................................................................... 44 
r R vi

Figure 20: Controller Properties Popup Window .......................................................... 45 


Figure 21: Expanded Program Files Folder.................................................................. 46 
e

Figure 22: Expanded Data Files Folder ........................................................................ 47 


Fo R

Figure 23: Cross Reference Report Popup Window .................................................... 48 


Figure 24: Output Image Data File Popup Window ...................................................... 49 
Figure 25: Usage Popup Window ................................................................................. 50 
ot or

Figure 26: Input Image Data File Popup Window ......................................................... 51 
Figure 27: Timer Data File Popup Window................................................................... 52 
F

Figure 28: Search Results Window .............................................................................. 53 


Figure 29: Results Window Moved in Display .............................................................. 54 
Figure 30: Windows Toolbar ........................................................................................ 55 
Figure 31: Standard Toolbar ........................................................................................ 56 
Figure 32: Tool Tip ....................................................................................................... 56 
N

Figure 33: Instruction Toolbar ...................................................................................... 57 


Figure 34: Detached Instruction Toolbar ...................................................................... 57 
Figure 35: On-Line Toolbar .......................................................................................... 58 
Figure 36: On-line/Off-line Drop Down Menu ............................................................... 58 
Figure 37: Help Window ............................................................................................... 59 
Figure 38: Help Drop Down Menu ................................................................................ 60 
Figure 39: Program Area File Assignments .................................................................. 62 
Figure 40: Program Files Popup Window ..................................................................... 63 
Figure 41: Create Program File Popup Window ........................................................... 64 
Figure 42: Completed Create Data File Popup Window ............................................... 65 

v
Introduction to Programmable Logic
Controllers

Figure 43: New File in Program Files Folder ................................................................ 66 


Figure 44: LAD 50 – SUBR-1 File Open for Editing in Ladder Window ........................ 67 
Figure 45: Data Area File Assignments ........................................................................ 68 
Figure 46: Popup Window for New Data File ............................................................... 70 
Figure 47: Create Data File Popup Window ................................................................. 71 
Figure 48: Data File Type Selection ............................................................................. 72 
Figure 49: Completed Create Data File Popup Window ............................................... 73 
Figure 50: New Integer Data File Created .................................................................... 74 
Figure 51: File N100 – TEST Popup Window ............................................................... 75 
Figure 52: Status Register S:24 ................................................................................... 77 
Figure 53: Integer Register N7 ..................................................................................... 78 
Figure 54: Integer Data Register N7 and Indirect Addressing ...................................... 79 

n
ct ,
du nly
Figure 55: User-Defined N100 Data File ...................................................................... 80 

io
Figure 56: N100 Data File ............................................................................................ 81 
Figure 57: Popup Window for Symbolic Name Entry.................................................... 82 
Figure 58: Symbolic Name Entry .................................................................................. 83 

ro O
Figure 59: Symbolic Name Entry Completed ............................................................... 83 
Figure 60: Symbolic Name and Description in Ladder Logic ........................................ 84 
Figure 61: I/O Address in Ladder Logic ........................................................................ 85 
ep w
Figure 62: Data Files Folder ......................................................................................... 87 
e
Figure 63: 1-Slot Addressing ........................................................................................ 89 
Figure 64: 2-Slot Addressing ........................................................................................ 90 
r R vi

Figure 65: 1/2-Slot Addressing ..................................................................................... 91 


Figure 66: Sixteen Point I/O Modules ........................................................................... 92 
e

Figure 67: Starting RSLogix 5 ...................................................................................... 94 


Fo R

Figure 68: Comms Drop Down Menu/WHO ACTIVE GO ONLINE Selection ............... 95 
Figure 69: Communications Popup Window ................................................................ 96 
Figure 70: RSLogix On-Line with a Controller .............................................................. 97 
ot or

Figure 71: Starting RSLogix 5 ...................................................................................... 98 


Figure 72: Comms Drop Down Menu/UPLOAD Selection............................................ 99 
F

Figure 73: Going to Online Programming State Popup Window ................................ 100 
Figure 74: Floppy Disk Icon from Standard Toolbar ................................................... 101 
Figure 75: File Drop Down Menu/SAVE Selection ..................................................... 102 
Figure 76: Revision Note Popup Window ................................................................... 103 
Figure 77: Tools Drop Down Menu............................................................................. 104 
N

Figure 78: System Options Popup Window ................................................................ 105 


Figure 79: Set Directory Popup Window .................................................................... 106 
Figure 80: Starting RSLogix 5 .................................................................................... 107 
Figure 81: Open Folder Icon ...................................................................................... 107 
Figure 82: Open/Import PLC5 Program Popup Window............................................. 108 
Figure 83: Open Project in RSLogix Display .............................................................. 109 
Figure 84: Comms Drop Down Menu ......................................................................... 110 
Figure 85: RSLogix 5 Popup Window......................................................................... 111 
Figure 86: Original Ladder Logic for Online Editing Example ..................................... 114 
Figure 87: Popup Menu for Online Editing ................................................................. 115 

vi
Introduction to Programmable Logic
Controllers

Figure 88: New Rung for Editing (Offline)................................................................... 116 


Figure 89: OTE Logical Address Changed ................................................................. 117 
Figure 90: Popup Menu for Verifying Rung Edits ....................................................... 118 
Figure 91: Rung Verified ............................................................................................ 119 
Figure 92: Popup Menu for Accepting Rung Edits ..................................................... 120 
Figure 93: Rung Edits Accepted ................................................................................. 121 
Figure 94: TEST EDITS Button from Online Editing Toolbar...................................... 122 
Figure 95: Test Edits Confirmation Popup Window .................................................... 122 
Figure 96: Test Edits Online Indication....................................................................... 123 
Figure 97: Edits Assembled ....................................................................................... 124 
Figure 98: Popup Window to Verify a Single Rung of Ladder Logic ........................... 125 
Figure 99: Results Window ........................................................................................ 126 

n
ct ,
du nly
Figure 100: Verify File and Verify Project Icons ......................................................... 127 

io
Figure 101: UNDO Button (Left Arrow) and REDO Button (Right Arrow) ................... 127 
Figure 102: Popup Menu with Mouse Pointer over Rung Number ............................. 128 
Figure 103: New Rung Inserted ................................................................................. 129 

ro O
Figure 104: Popup Window with Mouse Pointer Over Rung Number ......................... 130 
Figure 105: New Rung Appended .............................................................................. 131 
Figure 106: Location for New Branch ......................................................................... 132 
ep w
Figure 107: Rung Icon Under USER Tab of Instruction Toolbar ................................ 132 
e
Figure 108: Insertion Points for the New Branch ........................................................ 133 
Figure 109: New Branch Inserted ............................................................................... 133 
r R vi

Figure 110: Dragging the Branch to the Termination Point ........................................ 134 
Figure 111: New Branch Terminated.......................................................................... 134 
e

Figure 112: XIC Instructions ....................................................................................... 136 


Fo R

Figure 113: XIC Instruction and the Input Image Data Table ..................................... 137 
Figure 114: XIC Instruction and the Bit Data Table .................................................... 138 
Figure 115: XIO Instructions ....................................................................................... 139 
ot or

Figure 116: Comparison of XIC and XIO .................................................................... 140 


Figure 117: OTE Instruction ....................................................................................... 140 
F

Figure 118: OTL Instruction........................................................................................ 141 


Figure 119: OTU Instruction ....................................................................................... 141 
Figure 120: Arrangement of Latch And Unlatch Instructions ...................................... 142 
Figure 121: Bit Instruction Icons under BIT Tab of Instruction Toolbar ...................... 143 
Figure 122: Insertion Points for XIC Instruction .......................................................... 144 
N

Figure 123: XIC Instruction Inserted into Ladder Logic .............................................. 145 
Figure 124: OTE Instruction on Instruction Toolbar .................................................... 145 
Figure 125: Insertion Point for OTE Instruction .......................................................... 146 
Figure 126: OTE Instruction Inserted into Ladder Logic ............................................. 147 
Figure 127: XIC Instruction Selected for New Address .............................................. 148 
Figure 128: Starting the Logical Address ................................................................... 149 
Figure 129: Available Logical Addresses ................................................................... 150 
Figure 130: Logical Address Selected ........................................................................ 151 
Figure 131: Logical Address Assigned to XIC Instruction........................................... 152 
Figure 132: B3 Data Table File Open ......................................................................... 153 

vii
Introduction to Programmable Logic
Controllers

Figure 133: Logical Address Targets.......................................................................... 154 


Figure 134: Logical Address Assigned to OTE Instruction ......................................... 155 
Figure 135: I1 Input Image Data Table File ................................................................ 156 
Figure 136: Logical Address Usage ........................................................................... 157 
Figure 137: XIC Logical Address Changed from B3:0/0 to I:010/0 ............................. 158 
Figure 138: Timer On-Delay (TON) Instruction .......................................................... 160 
Figure 139: Timer Off-Delay (TOF) Instruction ........................................................... 161 
Figure 140: Retentive Timer On-Delay (RTO) Instruction .......................................... 161 
Figure 141: Reset Timer/Counter (RES) Instruction ................................................... 164 
Figure 142: Timer Instruction Icons under TIMER/COUNTER Tab of Instruction Toolbar
............................................................................................................................. 164 
Figure 143: Insertion Point for RTO Instruction .......................................................... 165 

n
ct ,
du nly
Figure 144: RTO Instruction Inserted into Ladder Logic ............................................. 166 

io
Figure 145: T4 Data File Popup Window.................................................................... 167 
Figure 146: Timer Usage............................................................................................ 168 
Figure 147: Unused Timer T4:61 ............................................................................... 169 

ro O
Figure 148: “Timer” Field in RTO Instruction as the Logical Address Target.............. 170 
Figure 149: Completed Logical Address Assignment ................................................. 171 
Figure 150: Time Base Drop Down Menu .................................................................. 172 
ep w
Figure 151: New Time Base Selected ........................................................................ 173 
e
Figure 152: New Time Base Entered ......................................................................... 173 
Figure 153: New Value Typed into “Preset” Field ....................................................... 174 
r R vi

Figure 154: New Preset Entered ................................................................................ 174 


Figure 155: XIC Instruction Inserted into Ladder Logic .............................................. 175 
e

Figure 156: T4 Data File Popup Window.................................................................... 176 


Fo R

Figure 157: Timer Address Located in Data File Popup Window ............................... 177 
Figure 158: XIC Instruction as the Logical Address Target ........................................ 178 
Figure 159: Logical Address Assignment Complete ................................................... 179 
ot or

Figure 160: Timer Instruction Icons under TIMER/COUNTER Tab of Instruction Toolbar
............................................................................................................................. 179 
F

Figure 161: Insertion Point for RES Instruction .......................................................... 180 


Figure 162: RES Instruction Inserted into Ladder Logic ............................................. 181 
Figure 163: Dialog Box for Logical Address Entry ...................................................... 181 
Figure 164: Logical Address for the RES Instruction .................................................. 182 
Figure 165: Symbolic Name/Comment Popup Window.............................................. 182 
N

Figure 166: Comment and Symbolic Name Information ............................................. 183 


Figure 167: Logical Address, Symbolic Address, and Comment ................................ 183 
Figure 168: CTU Instruction ....................................................................................... 185 
Figure 169: CTD Instruction ....................................................................................... 185 
Figure 170: Counter Instruction Icons under TIMER/COUNTER Tab of Instruction
Toolbar ................................................................................................................. 187 
Figure 171: Insertion Point for CTU Instruction .......................................................... 188 
Figure 172: CTU Instruction Inserted into Ladder Logic ............................................. 189 
Figure 173: C5 Data File Popup Window ................................................................... 190 
Figure 174: Counter Usage ........................................................................................ 191 

viii
Introduction to Programmable Logic
Controllers

Figure 175: Dialog Box for Logical Address Entry ...................................................... 191 
Figure 176: Instruction Type Popup Menu ................................................................. 192 
Figure 177: Logical Address Popup Menu ................................................................. 192 
Figure 178: Completed Logical Address Assignment ................................................. 193 
Figure 179: “Preset” Field Open for Editing ................................................................ 193 
Figure 180: New Value Typed into “Preset” Field ....................................................... 194 
Figure 181: New Preset Entered ................................................................................ 194 
Figure 182: C5 Data File Popup Window ................................................................... 195 
Figure 183: Preset Field Open for Editing .................................................................. 196 
Figure 184: New Preset Value Entered ...................................................................... 197 
Figure 185: Count Up/Count Down Ladder Logic ....................................................... 198 
Figure 186: On-Line Drop Down Menu....................................................................... 201 

n
ct ,
du nly
Figure 187: Change Mode Confirmation Popup Window ........................................... 201 

io
Figure 188: Processor in Program Mode.................................................................... 202 
Figure 189: Comms Drop Down Menu ....................................................................... 202 
Figure 190: Clear Memory Confirmation Popup Window ........................................... 203 

ro O
Figure 191: Force Table Positioning Diagram ............................................................ 205 
Figure 192: Force Status Indications .......................................................................... 206 
Figure 193: Forces Installed but Not Enabled ............................................................ 207 
ep w
Figure 194: Forces Installed and Enabled .................................................................. 207 
e
Figure 195: Popup Menu with Install Force Selections............................................... 208 
Figure 196: Inputs Forced ON .................................................................................... 209 
r R vi

Figure 197: Drop Down Menu with Enable Force Selection ....................................... 209 
Figure 198: Enable Forces Confirmation Popup Window ........................................... 210 
e

Figure 199: Forces Enabled ....................................................................................... 210 


Fo R

Figure 200: Multiple Forces in Project ........................................................................ 211 


Figure 201: Popup Menu with Remove Force Selections........................................... 212 
Figure 202: Selected Force Removed ........................................................................ 213 
ot or

Figure 203: Force Files in Project Window ................................................................. 214 


Figure 204: O0 (Output Force File) Popup Window ................................................... 215 
F

Figure 205: Output Address to Force ......................................................................... 216 


Figure 206: Force Installed......................................................................................... 217 
Figure 207: Enable Forces Confirmation Popup Window ........................................... 217 
Figure 208: Force Enabled ......................................................................................... 218 
Figure 209: Popup Menu with Remove Force Selections........................................... 219 
N

Figure 210: Force Removed ....................................................................................... 220 


Figure 211: Cross Reference Report – Sorted by Address ........................................ 221 
Figure 212: Cross Reference Popup Window ............................................................ 222 
Figure 213: Cross-Reference Report for Address Selected in Ladder Window .......... 223 
Figure 214: Data Files Folder Open in Project Window.............................................. 224 
Figure 215: Cross Reference Report Open ................................................................ 225 
Figure 216: Address in Ladder Window Selected from Cross-Reference Report ....... 226 
Figure 217: Data Table............................................................................................... 227 
Figure 218: Data Table Popup Window...................................................................... 228 
Figure 219: Data Table for Address Selected in Ladder Window ............................... 229 

ix
Introduction to Programmable Logic
Controllers

Figure 220: Data Files Folder Open in Project Window.............................................. 230 


Figure 221: Data Table Open ..................................................................................... 231 
Figure 222: N10 Data Table for Address N10:22 ....................................................... 232 
Figure 223: New Value in Data Table......................................................................... 233 
Figure 224: Value Changed through Data Table ........................................................ 233 
Figure 225: Find All Popup Menu ............................................................................... 234 
Figure 226: Search Results Window for O:011/16 ..................................................... 235 
Figure 227: Going to an Instruction in the Ladder Logic from a Search Result .......... 236 
Figure 228: Search Drop Down Menu ........................................................................ 237 
Figure 229: Find Popup Window ................................................................................ 238 
Figure 230: FIND ALL Search Results ....................................................................... 239 
Figure 231: Replace Popup Window .......................................................................... 240 

n
ct ,
du nly
Figure 232: Go To Popup Window ............................................................................. 241 

io
Figure 233: Go To Example ....................................................................................... 241 
Figure 234: Address/Symbol Editor Popup Window ................................................... 242 
Figure 235: Additional Options Available through Popup Menu ................................. 242 

ro O
Figure 236: Search Results from Address/Symbol Editor .......................................... 243 
Figure 237: Search Entry Box and FIND Buttons ....................................................... 244 
Figure 238: Searching for TON Instruction ................................................................. 245 
ep w
Figure 239: Result of FIND NEXT for TON Instruction ............................................... 246 
e
Figure 240: Result of FIND ALL for TON Instruction .................................................. 247 
Figure 241: Histogram ................................................................................................ 248 
r R vi

Figure 242: Comms Drop Down Menu ....................................................................... 249 


Figure 243: Histogram Popup Window ....................................................................... 250 
e

Figure 244: Entering Target Address ......................................................................... 251 


Fo R

Figure 245: Histogram Popup Menu........................................................................... 252 


Figure 246: Histogram Properties Popup Window ..................................................... 253 
Figure 247: Creating Histogram Trends ..................................................................... 254 
ot or
F
N

x
Introduction to Programmable Logic
Controllers

List of Tables
Table 1: Number System Bases ..................................................................................... 2
Table 2: Decimal and Binary Equivalents ....................................................................... 4
Table 3: Decimal to Binary Conversion .......................................................................... 6
Table 4: Decimal, Binary, and Octal Equivalents ........................................................... 7
Table 5: Decimal to Binary Conversion .......................................................................... 8
Table 6: Binary and Octal Equivalents ........................................................................... 9
Table 7: Octal to Binary Example ................................................................................... 9
Table 8: Binary to Octal Example ................................................................................. 10

n
ct ,
Table 9: Decimal, Binary, and Octal Equivalents ......................................................... 11

du nly
Table 10: Hexadecimal to Binary Example................................................................... 12

io
Table 11: Binary to Hexadecimal Example................................................................... 13
Table 12: Power Supply Ratings .................................................................................. 17
Table 13: PLC-5 Processors ........................................................................................ 18

ro O
Table 14: AC and DC Input Modules ............................................................................ 25
Table 15: AC and DC Output Modules ......................................................................... 28
ep w
Table 16: Data Files ..................................................................................................... 47
Table 17: PLC-5 Default Data Files .............................................................................. 69
e
Table 18: PLC-5 User Defined Data File Types ........................................................... 69
r R vi

Table 19: Logical Address Format ............................................................................... 76


Table 20: I/O Image Address Format ........................................................................... 85
e

Table 21: Data File Type Abbreviations ..................................................................... 231


Fo R
ot or
F
N

xi
Introduction to Programmable Logic
Controllers

PLC Basics

INTRODUCTION
This course provides information on PLC concepts, hardware, software, ladder logic
functions (relay contacts, timers, counters). There are hands-on exercises for
configuration and programming.

OBJECTIVES

n
ct ,
du nly
Upon completion of this course, you will be able to perform the following:

io
1. Convert a number from one base to another.
2. Describe the major components of the PLC-5.

ro O
3. Explain the basic operation of a PLC-5 system.
4. Identify the major components of the RSLogix 5 main window.
ep w
5. Access the RSLogix 5 on-line help files.
6. Describe the organization of processor memory.
e
7. Describe hardware and software addressing.
8. Establish a communication link to the PLC.
r R vi

9. Save, restore, and create program files.


10. Edit existing rungs of ladder logic.
e

11. Explain the operation of bit instructions


Fo R

12. Use bit instructions in a program.


13. Explain the operation of timer instructions.
14. Use timer instructions in a program.
ot or

15. Explain the operation of counter instructions.


16. Use counter instructions in a program.
F

17. Clear processor memory.


18. Monitor the data tables.
19. Force bit instructions on and off.
20. Describe the operation of histograms.
21. Describe a basic systematic troubleshooting process.
N

1
Introduction to Programmable Logic
Controllers

NUMBER THEORY
The section introduces four commonly used systems for numbering: decimal, binary,
octal, and hexadecimal. You are probably most familiar with the decimal system, as this
the system of numbers we use every day. Programmable logic controllers (PLCs),
however, do not understand the decimal system. PLCs, along with every other
computer in the world, are based on two stable states. These two states are
represented most effectively using the binary number system. The octal and
hexadecimal systems, which are easily derived from the binary system, are convenient
for representing strings of binary numbers. Octal numbering is especially important with
Allen-Bradley products as much of the technical PLC documentation is based on this

n
ct ,
system.

du nly
io
IDENTIFYING THE BASE OF A NUMBER

ro O
A number is a symbol that represents a quantity. The base, or radix, of a number
system identifies the number of unique symbols in that particular system. The base of
the decimal system is ten because we use ten unique symbols (0, 1, 2, 3, 4, 5, 6, 7, 8,
ep w
9) to represent all of the numbers. A number system using three symbols (0, 1, and 2)
would be base three. Remember to count zero as a symbol when determining the base
e
of a number system.
r R vi

The base of a number system is indicated by a subscript at the end of the number.
e

Table 1 illustrates some examples of different number system bases.


Fo R

Table 1: Number System Bases


ot or

Number Base
125710 Ten (decimal)
F

100100012 Two (binary)


23458 Eight (octal)
12FA416 Sixteen (hexadecimal)
N

If you do not see a subscript at the end of a number, then the number is assumed to be
base ten. This means that 34510 and 345 are equivalent base 10 numbers. Only
numbers written in a base other than base ten must have a subscript.

2
Introduction to Programmable Logic
Controllers

You should also note that the highest value symbol used in a number system is always
one less than the base of the system. In base ten, the symbol with the largest value is
9; in base 5, it is 4; and in base 2, it is 1. Base 16 (hexadecimal) is a little different.
Base 16 uses 16 unique symbols to represent all of the numbers. Since we run out of
unique number symbols after 9, the letters A through F are used to make up the rest of
the symbols.

POSITIONAL NOTATION AND THE DECIMAL NUMBERING SYSTEM


Positional notation is a system that describes the value of a number by the position of the
symbol within the number. Each position is assigned a weight. The number in the right-

n
most position has the lowest weighted value. Weighted values increase as you move from

ct ,
du nly
right to left. In the decimal system, the weighted values are 1, 10, 100, 1000, and so on.

io
Numerical quantities are determined by multiplying the digit in a particular position by the
weighted value of the position, then summing the results. Positional notation is best
described through an example.

ro O
The number 687 (in base 10) is made up of three digits - 6, 8, and 7. The least significant
ep w
digit (LSD) is 7, and its value is 7. The next significant digit is 8 and has a value of 80 (8 x
10). The 6 is the most significant digit (MSD) and has a value of 600 (6 x 100). The 7
e
occupies the ones position; the 8 occupies the 10’s position; and the 6 is in the 100’s
position. Using scientific notation, the number 687 is written:
r R vi

(6 x 102) + (8 x 101) + (7 x 100)


e
Fo R

Which is equivalent to:


ot or

(6 x 100) + (8 x 10) + (7 x 1)
= 600 + 80 + 7
= 687
F

What about a number like 67.832? We interpret this as:

(6 x 101)+(7 x 100)+(8 x 10-1)+(3 x 10-2)+(2 x 10-3)


N

Which is equivalent to:

(6 x 10)+(7 x 1)+(8 x 1/10)+(3 x 1/100)+(2 x 1/1000)


= 60 + 7 + 0.8 + 0.03 + 0.002
= 67.832

3
Introduction to Programmable Logic
Controllers

THE BINARY NUMBER SYSTEM


The binary system of numbering is based on two digits, 0 and 1. Therefore, the binary
number system has a base of 2. The binary numbering system is ideal for use with all
digital devices, which includes PLCs and computers. All digital devices operate using
two different states: off and on. The binary numbers 0 and 1 correspond nicely to these
states. Normally, 0 represents the “off” state of the digital device, and 1 represents the
“on” state.

Counting in binary is performed the same way as counting in decimal. Binary numbers,
however, can be quite lengthy because there are so few symbols available to represent

n
all of the numbers. Table 2 compares the first 16 decimal numbers to their binary

ct ,
du nly
equivalents.

io
Table 2: Decimal and Binary Equivalents

ro O Decimal Binary
ep w
0 0000
e
1 0001
r R vi

2 0010
3 0011
e

4 0100
Fo R

5 0101
ot or

6 0110
7 0111
F

8 1000
9 1001
10 1010
N

11 1011
12 1100
13 1101
14 1110
15 1111

4
Introduction to Programmable Logic
Controllers

Binary System Positional Notation

The decimal system uses powers of 10 as weighted values of particular positions within
a number. The binary system, however, uses powers of 2. The following illustrates
binary system positional notation:

24 23 22 20 2-1 2-2 2-3 2-4

Where:

24 = 2 x 2 x 2 x 2 = 1610
23 = 2 x 2 x 2 = 810

n
ct ,
22 = 2 x 2 = 410

du nly
io
21 = 2 = 210
20 = 110
2-1 = 1/2 = 0.510

ro O
2-2 = 1/(2 x 2)= 0.2510
2-3 = 1/(2 x 2 x 2)= 0.12510
2-4 = 1/(2 x 2 x 2 x 2)= 0.062510
ep we
How to Convert a Number from Binary to Decimal
r R vi

Converting from base 2 (binary) to base 10 (decimal) is relatively easy. Just sum the
weighted values of all positions where a 1 is present in the binary number.
e
Fo R

Example: Convert the binary number 1100112 to its decimal equivalent.

1100112
ot or

= (1 x 25) + (1 x 24) + (0 x 23) + (0 x 22) + (1 x 21) + (1 x 20)


= (1 x 32) + (1 x 16) + 0 + 0 + (1 x 2) + (1 x 1)
F

= 5110

Example: Convert the binary number 0.01012 to its decimal equivalent.

0.01012
N

= (0 x 20) + (0 x 2-1) + (1 x 2-2) + (0 x 2-3) + (1 x 2-4)


= 0 + 1/4 + 0 + 1/16
= 0.312510

5
Introduction to Programmable Logic
Controllers

How to Convert a Number from Decimal to Binary

Decimals are converted to another base by successively dividing the decimal by the
desired base. You begin by dividing the decimal number by the base. The remainder
of this step becomes the least significant (right-most) digit in the converted number. All
of the remainders from the successive divisions, when placed together, become the
converted number.

Example: Convert 15110 to its binary equivalent.

Begin by dividing 151 by 2, and then successively divide the result of each step
by 2. The remainders, when taken together, are the converted number. The

n
ct ,
du nly
steps of each successive division are shown in Table 3.

io
Table 3: Decimal to Binary Conversion

ro O Division Result Remainder


ep w
151 / 2 75 1
75 / 2 37 1
e
37 / 2 18 1
r R vi

18 / 2 9 0
9/2 4 1
e

4/2 2 0
2/2 1 0
Fo R

1/2 0 1
ot or

We are finished with the successive divisions when we get 0 as the result. The
remainders now become the converted decimal. The remainder from the first
F

division is the least significant digit of the base 2 conversion. So:

15110 = 100101112

You can check your result by converting the binary number back to its decimal
N

equivalent.

100101112
= (1 x 27) + (0 x 26) + (0 x 25) + (1 x 24) + (0 x 23) + (1 x 22) + (1 x 21) + (1 x 20)
= 128 + 0 + 0 + 16 + 0 + 4 + 2 + 1
= 15110

6
Introduction to Programmable Logic
Controllers

THE OCTAL NUMBER SYSTEM


The octal, or base 8 system of numbering is based on eight digits: 0, 1, 2, 3, 4, 5, 6, and
7. Allen-Bradley uses the octal number system extensively with all models of PLC.
Table 4 compares a decimal number to its binary and octal equivalents.

Table 4: Decimal, Binary, and Octal Equivalents


Decimal Binary Octal
0 0000 0
1 0001 1
2 0010 2

n
ct ,
3 0011 3

du nly
4 0100 4

io
5 0101 5
6 0110 6

ro O
7 0111 7
8 1000 10
9 1001 11
ep w
10 1010 12
11 1011 13
e
12 1100 14
r R vi

13 1101 15
14 1110 16
e

15 1111 17
Fo R

Octal System Positional Notation


ot or

The octal system uses powers of 8 as the positional notation weighted values. The
following illustrates the octal system positional notation:
F

84 83 82 80 8-1 8-2 8-3 8-4

Where:

84 = 8 x 8 x 8 x 8 = 409610
N

83 = 8 x 8 x 8 = 51210
82 = 8 x 8 = 6410
81 = 8 = 810
80 = 110
8-1 = 1/8 = 0.12510
8-2 = 1/(8 x 8)= 0.01562510
8-3 = 1/(8 x 8 x 8)= 0.00195310
8-4 = 1/(8 x 8 x 8 x 8)= 0.00024410

7
Introduction to Programmable Logic
Controllers

How to Convert a Number from Octal to Decimal

The same principles are used to convert octal to decimal as were used to convert binary
to decimal. The only difference is that octal uses 8 for the base instead of the 2 used in
binary. You must also multiply the weighted value of the position by the number
occupying the position.

Example: Convert the binary number 1428 to its decimal equivalent.

1428
=(1 x 82) + (4 x 81) + (2 x 80)
= (1 x 64) + (4 x 8) + (2 x 1)

n
ct ,
du nly
= 9810

io
How to Convert a Number from Decimal to Octal

ro O
Decimals are converted to octal by successively dividing a
decimal number by eight. The method is the same as was
used to convert decimal to binary.
ep we
Example: Convert 14910 to its octal equivalent.
r R vi

Table 5: Decimal to Binary Conversion


e
Fo R

Division Result Remainder


149 / 8 18 5
18 / 8 2 2
ot or

2/8 0 2
F

We are finished with the successive divisions when get 0 as the result. The
remainders now become the converted decimal. The remainder from the first
division is the least significant digit of the base 8 conversion. So:

14910 = 2258
N

You can check your result by converting the octal number back to its decimal
equivalent.

2258
= (2 x 82) + (2 x 81) + (5 x 80)
= 128 + 16 + 5
= 14910

8
Introduction to Programmable Logic
Controllers

Conversions between Octal and Binary

Octal numbers can be represented using three binary digits. Table 6 illustrates octal
numbers and their binary equivalents.

Table 6: Binary and Octal Equivalents

Octal Binary
0 000
1 001
2 010

n
ct ,
du nly
3 011

io
4 100
5 101
6 110

ro O
7 111
ep w
How to Convert a Number from Octal to Binary
e
Using the information in Table 6, locate the octal number in the table then read across
to the binary equivalent. Write down the binary equivalent below the octal digit being
r R vi

converted. Convert each octal digit using the table. The binary equivalent then
becomes the string of ones and zeros that were written down for each octal digit.
e
Fo R

Example: Convert 236538 to binary.


ot or

Use Table 6 and write the binary equivalent below each octal digit. This is
illustrated in Table 7.
F

Table 7: Octal to Binary Example

Octal 2 3 6 5 3
Binary 0 1 0 0 1 1 1 1 0 1 0 1 0 1 1
N

The binary equivalent of 236528 is 0101001101010112.

9
Introduction to Programmable Logic
Controllers

How to Convert a Number from Binary to Octal

You can use Table 6 to convert from binary to octal, but you have to separate the binary
number into groups of three digits starting on the right side of the number. You then
read the octal equivalent from the table for each group of three binary digits.

Example: Convert 111001002 to octal.

Separate the binary number into groups of three digits beginning from the right
side. Use Table 6 and write the octal equivalent below each group of three
binary digits. This is illustrated in Table 8. Add leading zeros to the last group,
as in this example, to complete a group having one or two digits.

n
ct ,
du nly
io
Table 8: Binary to Octal Example

ro O
Binary 0 1 1 1 0 0 1 0 0
Octal 3 4 4
ep w
The octal equivalent of 111001002 is 3448.
e
r R vi
e
Fo R
ot or
F
N

10
Introduction to Programmable Logic
Controllers

THE HEXADECIMAL SYSTEM


The hexadecimal, or base 16 system of numbering is based on sixteen digits. Since we
run out of unique numbers after 9, the letters A through F are used to represent the
remaining numbers in the base. Table 9 compares a decimal number to its binary,
octal, and hexadecimal equivalents.

Table 9: Decimal, Binary, and Octal Equivalents

Decimal Binary Octal Hex

n
0 0000 0 0

ct ,
du nly
1 0001 1 1

io
2 0010 2 2
3 0011 3 3
4 0100 4 4

ro O
5
6
0101
0110
5
6
5
6
ep w
7 0111 7 7
8 1000 10 8
e
9 1001 11 9
r R vi

10 1010 12 A
11 1011 13 B
e

12 1100 14 C
13 1101 15 D
Fo R

14 1110 16 E
15 1111 17 F
ot or
F
N

11
Introduction to Programmable Logic
Controllers

Conversions between Hexadecimal and Binary

Conversions between hexadecimal and binary are similar to octal/binary conversions in


that you can use a table of equivalent values to perform the conversion. The only
difference is that you need four binary digits to represent a hexadecimal digit instead of
the three used with octal. The most difficult part of hexadecimal conversions is
remembering that a letter represents a number.

How to Convert a Number from Hexadecimal to Binary

Using the information in Table 9, locate the hexadecimal number in the table then read
across to the binary equivalent. Write down the binary equivalent below the

n
ct ,
du nly
hexadecimal digit being converted. Convert each hexadecimal digit using the table.

io
The binary equivalent then becomes the string of ones and zeros that were written
down for each hexadecimal digit.

ro O
Example: Convert A5F16 to binary.

Use Table 9 and write the binary equivalent below each hexadecimal digit. This
ep w
is illustrated in Table 10.
e
r R vi

Table 10: Hexadecimal to Binary Example


e

Hexadecimal A 5 F
Fo R

Binary 1 0 1 0 0 1 0 1 1 1 1 1

The binary equivalent of A5F16 is 1010010111112.


ot or
F
N

12
Introduction to Programmable Logic
Controllers

How to Convert a Number from Binary to Hexadecimal

You can use Table 9 to convert from binary to hexadecimal, but you have to separate
the binary number into groups of four digits starting on the right side of the number.
You then read the hexadecimal equivalent from the table for each group of four binary
digits.

Example: Convert 111001002 to hexadecimal.

Separate the binary number into groups of four digits beginning from the right
side. Use Table 9 and write the hexadecimal equivalent below each group of
four binary digits. This is illustrated in Table 11. Add leading zeros to the last

n
ct ,
du nly
group, if necessary, to complete a group of four digits.

io
Table 11: Binary to Hexadecimal Example

Binary
Hexadecimal ro O 1
E
1 1 0 0
4
1 0 0
ep we
The hexadecimal equivalent of 111001002 is E416
.
r R vi
e
Fo R
ot or
F
N

13
Introduction to Programmable Logic
Controllers

INTRODUCTION TO THE PLC-5


This section introduces the basic operation and organization of the PLC-5
programmable logic controller. Although this training specifically discusses the PLC-5,
the concepts introduced in this text are applicable to most programmable logic
controllers.

PLC-5 HARDWARE
A programmable logic controller (PLC) is a specialized type of computer designed for
industrial automation and process control. The complexity of the operating environment

n
ct ,
defines the number of PLCs in the system. Simple applications may use only one PLC.

du nly
However, multiple PLCs may be connected together via a common communication

io
network in order to provide sophisticated control over complex operating environments.

ro O
The PLC-5 is a family of PLCs manufactured by Allen-Bradley. The PLC-5 is a modular
system, which provides flexibility in order to meet a wide range of possible applications.
A basic PLC system consists of the following components:
ep w
• Equipment chassis
e
• Power supply
r R vi

• Processor module
• I/O modules with field wiring
e

• Remote I/O adapter module


Fo R
ot or
F
N

14
Introduction to Programmable Logic
Controllers

Equipment Chassis

The equipment chassis is a single, compact enclosure that holds the programmable
controller module, power supply, and I/O or specialty modules that make up the system.
Modules are inserted into the chassis on plastic slots and plug into the back plane
connections. Four different size chassis are available: 4-slot, 8-slot, 12-slot, and 16-
slot. This design provides for easy system expansion and module replacement. The
left-most slot of the chassis accepts the controller module (or the remote I/O adapter if
the chassis is being used as a remote I/O rack). An example of an equipment chassis
is shown in Figure 1.

n
ct ,
du nly
io
ro O
ep we
r R vi
e
Fo R
ot or
F

Figure 1: Equipment Chassis

The power supply jumper is used to set up the system for either an internal (in the same
rack) power supply, or an external power supply. The configuration plug is moved to
N

the left side when an internal power supply is used, and to the right side for an external
power supply.

15
Introduction to Programmable Logic
Controllers

The back plane switch assembly consists of eight rocker switches that determine the
chassis output operation in the event of a fault, the addressing mode of the chassis, and
the operation of memory modules.

Power Supply Module

The purpose of the power supply is to supply and regulate the power to the modules in
the PLC-5 equipment chassis. The power supply module can be installed in any slot in
the chassis (except the processor slot on the left side of the chassis). A variety of
power supply modules are available, each with different ratings for input and output
voltages. An example of a power supply module is shown in Figure 2.

n
ct ,
du nly
io
ro O
ep we
r R vi
e
Fo R
ot or
F
N

Figure 2: Power Supply Module

Power supply modules can be either a single or double slot design. A typical power
supply module is the model 1771-P4. The 1771 designates that the power supply is
compatible with the 1771 chassis. The P4 designator indicates the power supply rating.
If the power supply is a single slot module, it will be designated with an “S” such as
1771-P4S.

16
Introduction to Programmable Logic
Controllers

The 1771-P4 power supply is a two slot module. It accepts 120 VAC, 60 Hz input and
delivers 8A, 5VDC output to the chassis back plane. This power supply contains output
over-voltage, under-voltage, and over-current protection to the I/O chassis and its
modules. If one of these faults occur, the power supply will shutdown. You must turn
the power supply off for 15 seconds to reset it. The power supply will also shutdown if
the processor line voltage drops below 92 VAC and will restart the processor when line
voltage increases to 97 VAC. This prevents the processor from operating when voltage
is too low, and any resulting errors.

The operation, protection features, and external wiring connectors of the power supplies
are essentially the same. Table 12 lists the ratings of the various slot power supplies
commonly used with the PLC-5.

n
ct ,
du nly
io
Table 12: Power Supply Ratings

ro O
Power Supply Model Input Power Output Power
1771-P3S 120VAC/60Hz 3A/5VDC/38W
ep w
1771-P4 120VAC/60Hz 8A/5VDC/79W
1771 -P4S 120VAC/60Hz 8A/5VDC/60W
e
1771-P4S1 100VAC/60Hz 8A/5VDC/60W
r R vi

1771-P5 24VDC 8A/5VDC/72W


1771-P6S 220VAC/60HZ 8A/5VDC/60W
e

1771-P6S1 200VAC/60Hz 8A/5VDC/60W


Fo R

Processor Module
ot or

The processor module is a small, rack-mounted computer. The processor module does
not have a keyboard, so you must connect some type of programming interface in order
to monitor or direct the operation of the device. The programming interface is usually a
F

laptop computer, although it can be a desktop computer connected over some distance
to the controller through a communication network. In either case, the programming
interface runs the RSLogix 5 software. The RSLogix 5 software allows you to create the
programs (application software) that tell the controller module what to do.
N

The application software resides in the processor’s memory. Although there are
different types of application software that you can write for the PLC-5, the most
common type is known as ladder logic. The ladder logic ultimately controls the
machines and processes associated with the PLC. If the ladder logic does not operate
correctly, then the machine or process being controlled by the PLC will not operate
properly.

17
Introduction to Programmable Logic
Controllers

There are many types of processor modules in the Allen-Bradley PLC-5 family of
controllers. Differences between the types of processors generally relate to I/O
capacity, remote rack capability, memory, and scan time. Table 13 summarizes the
capabilities of the several models of processors.

Table 13: PLC-5 Processors

Processor Memory I/O I/O Racks Rack Communication


Model (Words) Points (Maximum) Configuration Mode
5/10 6,000 256 4 4 local None
5/12 6,000 256 4 4 local Adapter

n
ct ,
du nly
4 local/3
5/15 6,000 512 4 Scanner/Adapter

io
remote
4 local/7
5/25 13,000 1024 8 Scanner/Adapter
remote

ro O
4 local/15
5/40 48,000 2048 16 Scanner/Adapter
remote
ep w
4 local/23
5/60 64,000 3072 24 Scanner/Adapter
remote
e
r R vi
e
Fo R
ot or
F
N

18
Introduction to Programmable Logic
Controllers

The processor module always occupies the left-most slot in the chassis. The processor
requires 2.5 Amperes of current for operation and draws this power from the chassis
back plane. All processor modules have essentially the same physical appearance and
operate the same internally. Figure 3 illustrates the PLC 5/15 processor module as an
example.

n
ct ,
du nly
io
ro O
ep we
r R vi
e
Fo R
ot or
F
N

Figure 3: PLC 5/15 Processor Module

19
Introduction to Programmable Logic
Controllers

A 9-pin, D-shell connector labeled PEER COMM INTFC is the communication port
between the processor and the programming device. This connection lets the
programming device communicate with any device on the link. Once you connect the
programming device to one processor, the device can communicate with each
processor on the network.

There are two communication ports on the processor module located directly below the
D-shell connection. The upper connector, labeled PEER COMM INTFC, is for the peer
communications link (Data Highway Plus). The lower terminal labeled REM I/O is the
remote I/O connector.

Key Switch

n
ct ,
du nly
io
The front-panel key switch has three positions for controlling the mode of processor
operation. They are RUN, PROGRAM, and REMOTE. In the RUN mode, you can run
the loaded program, force I/O, and save programs to a disk drive. In this mode you

ro O
cannot:


ep w
Create or delete ladder or data files.
• Program on-line.
e
• Modify the size of a data file.
• Change mode of operation through the programming device.
r R vi

In the PROGRAM mode, you can enter a program, modify ladder files, down load to an
e

EEPROM module, and save or restore programs. In this mode, outputs are disabled,
Fo R

inputs are not updated, and the processor does not scan the program.
ot or

In the REMOTE mode, you can change between remote program, remote test, and
remote run modes through the programming device. Be aware that the outputs are
disabled in Remote Test mode, even though the ladder logic executes. Note that you
F

cannot create or delete ladder logic or data files while in the Remote Test mode.

Front Panel LEDs

The processor module has six LED status indicators. These are:
N

• COM (Communication Active)


• REM I/O (Remote I/O)
• ADPT (Adapter)
• BATT (Battery)
• PROC (Processor)
• FORCE

20
Introduction to Programmable Logic
Controllers

COM (Communication Active) LED

The COM LED indicates the operation of the PLC-5 processor within the Peer
Communication Link, and provides indication of communication faults. The Peer
Communication Link allows the PLC-5 processor to communicate with other PLC-5
processors and with the industrial terminal. The maximum number of stations you can
connect to the Peer Communications Link is 64. The status indications of the COM
LED are as follows:

• Blinking Green: Processor transmitting/receiving on the communication link


• Steady Bright Red: Watchdog timer time out

n
ct ,
Steady Dull Red: Duplicate station address selected

du nly
• Off: No communication

io
REM I/O (Remote I/O Active) LED

ro O
The REM I/O LED light indicates the operation of the remote I/O rack and provides
indication of a remote I/O fault. The status indications of the REM I/O LED are as
ep w
follows:
e
• Steady Green: Active remote I/O link

r R vi

Steady Red: Remote I/O link fault


• Blinking Green/Red: Partial remote I/O link fault

e

Off: No remote I/O selected


Fo R

ADPT (Adapter) LED


ot or

The ADPT (adapter) LED indicates the mode of operation of the PLC-5 processor. The
processor may operate in Adapter Mode or Scanner Mode.
F

When in the Adapter Mode, the PLC-5 processor communicates with a supervisory
processor capable of remote I/O and it controls the I/O in its local chassis. In the
Scanner Mode, the processor communicates with I/O in up to three remote I/O chassis
and with its local I/O. The ADPT LED will be on when in adapter mode and off in
scanner mode. The ADPT LED status indications are as follows:
N

• Steady Green: Active remote I/O link


• Steady Red: Duplicate station address selected
• Blinking Green: No communication with host processor
• Sporadic Green: Bad communication with host processor
• Off: Not in Adapter mode.

21
Introduction to Programmable Logic
Controllers

BATT (Battery) LED

The BATT LED indicates the status of the battery. The LED is off if the battery is good
and on if the battery is low.

PROC (Processor) LED

The PROC LED indicates the condition and program mode of operation within the
processor. The PROC LED status indications are as follows:

• Steady Green: Run Mode. The program is running.


n
Steady Red: Major Fault

ct ,
du nly
• Off: Program Mode, Test Mode, or the processor is not receiving power. The

io
program is not running.

FORCE LED

ro O
The FORCE LED is amber. It indicates that a force exists within the processor. The
ep w
FORCE LED is on steady when forces are installed and enabled, blinks when forces are
installed but not enabled, and off when no forces are installed.
e

Battery
r R vi

The processor houses one AA lithium battery. If power is not applied to the processor
e

module, the battery retains the processor memory for up to one year. The battery is
Fo R

held beneath a cover on the front of the processor module. The date the battery was
installed should be written on the front of the module.
ot or

Processor Module DIP Switches


F

The processor module is configured for operation through three groups of DIP switches.
These switches, labeled SW1, SW2, and SW3, are located inside the processor module
as illustrated in Figure 4.
N

22
Introduction to Programmable Logic
Controllers

n
ct ,
du nly
io
Figure 4: Processor Module Switches

ro O
Switch assembly SW1 is an eight-switch assembly. It is used to determine the station
ep w
number of the processor module when it is configured in a peer communications link
(data highway plus). This switch assembly also configures the processor for scanner or
e
adapter operation.
r R vi

Switch assembly SW2 is also an eight-switch assembly. It sets the number of words
e

exchanged between the host processor and the PLC-5 processor when the PLC-5
Fo R

processor is in adapter mode. The PLC 5/15 can transfer eight words between the host
PLC-5 and the adapter module per scan. This switch assembly also establishes the
beginning I/O group number assigned to the PLC-5 processor, and the I/O rack number
ot or

of the processor module when it is in adapter mode.


F

Switch assembly SW3 is a four-switch assembly that connects a terminator across the
line when the processor module is the last device in a peer communications link remote
I/O link. The specific switch settings for this module are found in the processor
technical bulletin.
N

23
Introduction to Programmable Logic
Controllers

Memory Modules

Each processor module contains a base memory. This is usually an adequate level for
most applications. However, due to system expansion and increased needs, additional
memory may be required. These memory modules are installed into the memory-
module slot on the bottom of the processor module. There are three memory modules
that may be added to the processor:

• EEPROM Module (1785-MJ) - Provides up to 6K words of nonvolatile memory


backup.

n
CMOS RAM Module (1785-MR) - Provides 4K words of RAM memory in addition

ct ,
du nly
to the processor’s base memory.

io
• CMOS RAM Module (1785-MS) - Provides 8K words of RAM memory in addition
to the processor’s base memory.

ro O
The EEPROM module may be used in any processor. The two CMOS RAMs are only
ep w
available for use with the PLC 5/15 and 5/25 processors.
e
Input Modules, Output Modules, and Field Wiring
r R vi

Input modules accept input signals from field devices and condition them to meet the
power requirements of the processor. Output modules accept the control signals from
e

the processor and energize the designated output module point. Field wiring connects
Fo R

the modules to signaling or control devices in the facility.


ot or

Input Modules

An input is any signal that supplies information to the programmable controller. The
F

interface between all physical inputs and the controller is the input module. The input
module receives the signal from the input device, transforms the signal to a format that
is recognizable by the ladder logic, and then passes the information on to the controller
through common connection in the equipment rack. Common types of input devices are
push buttons, limit and proximity switches, control relays, sensors, and operator
N

controls.

24
Introduction to Programmable Logic
Controllers

There are several types of input modules. Input modules are available in 8-point (8 input
signal terminals), 16-point, and 32-point designs and accept AC or DC input signals. The
type of input module selected for a particular application depends on the type of input
signal. This includes analog inputs, digital inputs, and specialty modules for inputs from
thermocouples, resistance-temperature devices, and encoders. Table 14 summarizes
the rating characteristics of the various AC and DC input modules commonly used with the
PLC-5.

Table 14: AC and DC Input Modules

Model Number Input Voltage Rating Number of

n
ct ,
du nly
Input Points

io
1771-IA 92-138 VAC/VDC 8
1771-IAD 77-138 VAC 16
1771-IA2 92-138 VAC 8

ro O
1771-IB 10-27 VDC 8
1771-IBD 10-30 VDC 16
ep w
1771-IBN 10-30 VDC 32
1771-IC 42-56 VDC 8
e
1771-ICD 20-60 VDC 16
1771-IH 24-50 VDC 8
r R vi

1771-IM 184-276 VAC/VDC 8


1771-IMD 184-250 VAC 16
e

1771-IN 12-28 VAC 8


Fo R

1771-IND 10-30 VAC 16


1771-IQ 5-30 VDC 8
ot or

1771-IT 10-27 VDC 8


1771-IVN 10-30 VDC 32
F

A typical input module is the 1771-IAD. This number provides descriptive information
about the module. The “1771” identifies the PLC-5 family and indicates that the module
fits into a 1771-series universal chassis. The “I” indicates an input module, the “A”
indicates an AC module, and the “D” indicates high density. A high-density module is a
module with 16 or more points.
N

This module converts sixteen individual 120VAC inputs to a logic level compatible with the
processor. Typical field device inputs to this module are proximity switches, limit switches,
and push buttons. The input signals are filtered within the module to limit the effects of
voltage transients caused by contact bounce and electrical noise. This prevents false data
input to the processor. The input circuits within the input module are optically isolated from
the back plane of the chassis.

25
Introduction to Programmable Logic
Controllers

The power used to operate the logic circuitry within the input module is drawn from the
chassis back plane. Each input module requires approximately 0.25 Amperes of current.
Figure 5 illustrates the 1771-IAD module.

n
ct ,
du nly
io
ro O
ep we
r R vi
e
Fo R
ot or
F
N

Figure 5: 1771-IAD AC Input Module

26
Introduction to Programmable Logic
Controllers

The 1771-IAD module occupies one slot in the universal chassis and can be placed in any
location within the universal chassis except for the very first slot to the left, which is
reserved for the processor. To install the module, slide it into the slotted track located
within the chassis. To remove the module, pull outward on the tab located on the top of
the module.

The field devices are wired to the terminal block on the front of the module. This terminal
block is hinged on the bottom and connected to the universal chassis. This eases the
removal and replacement of a module. Note that the first four terminals (A, B, C, D) are
not used on input modules. The next sixteen terminals are numbered 00 through 17
(octal). The last terminal (E) is for the common ground connection. A hinged plastic cover
protects the terminals.

n
ct ,
du nly
io
The input status indicators are located on the front of the module above the terminal strip.
The status indicators show the condition of the module and its inputs. The green ACTIVE
LED when the module is powered and the opto-isolator data paths are functioning

ro O
properly. The remaining sixteen LEDs (00 to 17) illuminate red when the associated input
has power present on the terminal.
ep w
The input module fault mode selection configuration plug is located on the top of the
e
module. The purpose of this plug is to determine the status of the inputs to the processor
during a module failure. The plug has two positions: “last-state” and “reset.” In the last-
r R vi

state position, the inputs to the processor from the module remain in the last known valid
state when a failure is detected. In the reset position, the inputs are reset to the off
e

position when a module failure occurs.


Fo R
ot or
F
N

27
Introduction to Programmable Logic
Controllers

Output Modules

An output from the programmable controller causes an external event to occur. The
interface between the controller and a physical output is the output module. The output
interface module interprets the control signals controller from the controller then outputs
the signals that actually change the position of equipment or modify processes. Typical
output devices include relays, solenoids, lamps, and system displays or monitors.

There are several types of output modules. As with the input module, the type of output
module depends on the application. Types of output modules include those for analog
and digital signals, and linear position transducers. Table 15 summarizes the rating
characteristics of the various AC and DC output modules commonly used with PLC-5.

n
ct ,
du nly
io
Table 15: AC and DC Output Modules
Model Number Output Voltage Rating Number of
Output Points

ro O
1771-OA 92-138 VAC 8
1771-OAD 10-138 VAC 16
1771-OB 10-27 VDC 8
ep w
1771-OBD 10-60 VDC 16
1771-OBN 10-30 VDC 32
e
1771-OC 42-53 VDC 8
r R vi

1771-OM 184-276 VAC 8


1771-OMD 184-250 VAC 16
e

1771-ON 20-30 VAC 8


1771-OQ 24 VDC 8
Fo R

1771-OVN 10-30 VDC 32


1771-OW 24-138 VAC 8
ot or

1771-OYL 0-24 VAC/VDC 8

A typical output module is the 1771-OAD. This number provides descriptive information
F

about the module. The “1771” identifies the PLC-5 family and indicates that the module
fits into a 1771-series universal chassis. The “O” indicates an output module, the “A”
indicates AC module, and the “D” indicates high density. A high-density module is a
module with 16 or more points.
N

This module converts the signals from the processor in order to energize the 16 individual
outputs associated with the module. The module outputs can accommodate a range of 12
to 120 VAC. Typical field device connections to the module are AC motor starters,
solenoids, and indicators.

The outputs of the module are fused by one 10 Ampere, 250V fuse to protect the module
from damage in the event of a field device short circuit. The fuse is located on the left side
of the module.

28
Introduction to Programmable Logic
Controllers

The power used to operate the logic circuitry within the output module is drawn from the
chassis back plane. Each output module requires approximately 0.7 Ampere of current.
Figure 6 illustrates the 1771-OAD module.

n
ct ,
du nly
io
ro O
ep we
r R vi
e
Fo R
ot or
F
N

Figure 6: 1771-OAD AC Output Module

29
Introduction to Programmable Logic
Controllers

The 1771-OAD module occupies one slot and can be placed in any location within the
chassis except for the very first slot to the left, which is reserved for the processor. The
module is installed and removed in the same manner as its corresponding input module.

The field devices are wired to the terminal block on the front of the module. This terminal
block is hinged on the bottom to allow easy module removal without removing the field
device wiring. A hinged plastic cover protects the terminals. AC power is supplied to this
module through the four terminals labeled L1. These four terminals should be jumpered
together to prevent overstressing any single point. Power is supplied to all four points to
protect from exceeding the total surge rating of the module. Field devices are connected
to terminals 00 to 17 (octal). The connection paths are from the module to the field device
to ground. The last terminal (L2) may or may not be used as a common ground with the

n
ct ,
du nly
field device. If it is not used, no connection to this point is necessary.

io
The output status indicators operate in a manner similar to the input module. The ACTIVE
LED indicates power to the output module and opto-isolation data path operation. The red

ro O
output LEDs (00-17) indicate that the processor has commanded an output on. They do
not indicate the presence of power on a given terminal. One additional indicator is present
on the status panel. It is the FUSE indicator. When illuminated, it indicates that the output
ep w
fuse has blown.
e

The output module fault mode selection configuration plug is located on the bottom of the
r R vi

module. This plug determines the state of the outputs following a module failure. The
possible plug positions are “last state” and “reset.” In the last-state position, the outputs will
e

remain in the last known current state should a module failure occur. In the reset position,
Fo R

the outputs will reset to off following a module failure.

The module configuration plug operates independently of the last-state switch on the I/O
ot or

chassis back plane. The module plug position takes precedence when a module fault
occurs. The I/O chassis back plane plug takes precedent if a rack fault occurs.
F

Field Wiring

All inputs and outputs are connected to the programmable controller by field wiring.
Field wiring is all wiring, junction boxes, and connectors used to connect the
N

programmable controller to external devices. Field wiring completes the PLC-5


connections to the field devices.

30
Introduction to Programmable Logic
Controllers

Remote I/O Adapter Module

The 1771-ASB Remote I/O Adapter module is an interface between remote racks and
the processor module. Essentially, the remote I/O adapter takes the place of the
processor module in the remote racks. The adapter communicates with the other I/O
modules in the remote rack, and the processor module communicates with the adapter.

The adapter occupies one slot in the universal chassis and must be placed in the left-
most slot, just as with the processor module. The power to operate the module is drawn
from the chassis back plane. The module requires 1.2 Amperes of current. Figure 7
illustrates the Remote I/O Adapter module.

n
ct ,
du nly
io
ro O
ep we
r R vi
e
Fo R
ot or
F

Figure 7: Remote I/O Adapter Module


N

31
Introduction to Programmable Logic
Controllers

The terminal block on the front of the module is used for connection of external I/O
communication cables and an optional chassis restart button. The module has built-in
fault detection capabilities. If a fault should occur in a remote I/O chassis containing
inputs, the inputs to the processor will remain in their last pre-fault state. As a result,
when a fault occurs, the outputs in an un-faulted local or remote rack will remain in the
last state ordered prior to the fault.

Two switch assemblies are located inside the 1771-ASB Remote I/O adapter module.
These switches are labeled SW-1 and SW-2. They are used to set group numbers and
rack numbers in both a complimentary and non-complimentary I/O configuration. The
positioning procedures for these switches are contained in the equipment technical
bulletin.

n
ct ,
du nly
io
The module has three status indicators. The ACTIVE indicator is green. When on, it
indicates: that there is active communication between the processor and the adapter
module, that DC power is on and supplying the entire I/O rack, and that the I/O adapter

ro O
module is actively controlling the modules. When it is OFF it indicates there is no
communication between the processor and the adapter module. When flashing it
indicates that a communication link is established between the processor and the
ep w
remote I/O adapter module, the processor is in the program or test mode, and the
e
remote I/O adapter module is not actively controlling the I/O modules.
r R vi

The ADAPTER FAULT indicator is red. When on it indicates that the module is not
operating properly, there is a fault, and that the I/O rack response is in the manner
e

denoted by the last state switch (switch number one of the I/O chassis back plane
Fo R

switch assembly). When it is flashing, it shows that the processor restart lockout switch
on the I/O chassis back plane switch assembly is on. Depress the I/O rack restart push
button (if installed) to clear the restart lockout.
ot or

The I/O RACK FAULT indicator is red. When on, it indicates that a fault has been
F

detected at the remote I/O adapter module on the logic side of the I/O modules.
N

32
Introduction to Programmable Logic
Controllers

PLC-5 SYSTEM OPERATION


The major components of a PLC are the equipment chassis, processor module, input
module, output module, and power supply. A programming terminal is used to program
the processor, but it is not considered a major component because once the processor
is programmed, the terminal may be disconnected. The operation of these major
components is best illustrated by developing a hypothetical hardwired circuit, then
implementing the same circuit using the major PLC components.

Figure 8 illustrates the hypothetical circuit for this example. This circuit controls two

n
different lamps. Switch 1 and Switch 2 are normally open push button switches. Lamp

ct ,
du nly
1 illuminates when switch 1 is closed, and lamp 2 illuminates when switch 2 is closed.

io
ro O
ep we
r R vi
e
Fo R

Figure 8: Hypothetical Circuit


ot or
F
N

33
Introduction to Programmable Logic
Controllers

Figure 9 shows the same switches and lamps under the control of a PLC system. The
push button switches connect to an input module in the PLC system instead of directly
to the lamps. The lamps are connected to the output module. Notice also that the input
module is indirectly connected to the output module via the processor.

n
ct ,
du nly
io
ro O
ep we
r R vi

Figure 9: Hypothetical Circuit Controlled by PLC System


e

The processor is programmed to connect Switch 1 to Lamp 1, and Switch 2 to Lamp 2


Fo R

through software. This software is also known as ladder logic since it appears similar to
a standard electrical ladder diagram. The processor is programmed using a terminal
(laptop) connected to a communication port on the processor. The operation of the
ot or

hardwired lamp system and the PLC-controlled system appear identical. When Switch
1 is closed, Lamp 1 lights, and when Switch 2 closes, Lamp 2 lights. The major
F

differences between the two models relate to the signal flow paths.
N

34
Introduction to Programmable Logic
Controllers

Signal Flow Paths

When a push button is pressed in the hardwired system, power moves from the voltage
source through the switch to the lamp, and then to ground. Electrical power simply
follows the wire conductors to the lamp. When the switch is opened, power is
interrupted and the light goes out.

In the PLC controlled system, power moves from the voltage source, through the switch,
into the input module. The input module senses the presence of this voltage and in
turn, sends a small signal voltage into the processor through the back plane
connections to the equipment chassis. The voltage from the switch is isolated from the
voltage signal that the module sends into the processor. This isolation is necessary

n
ct ,
du nly
since the fragile processor chip operates at very low voltage and current levels.

io
The signal received by the processor is analyzed and interpreted by the ladder logic.
The ladder logic generates a low-voltage output signal from the processor to the output

ro O
module. This output signal not only contains the ON signal to the lamp, but also tells
the output module to which terminal the lamp is connected to on the module. This
allows the output module to discriminate between Lamp 1 and Lamp 2. An observer of
ep w
both hardwired and PLC controlled systems would not notice any difference in the
e
system operation. In both systems, Switch 1 controls Lamp 1, and Switch 2 controls
Lamp 2.
r R vi

The greatest advantage of a programmable logic controller becomes evident when a


e

change is needed in the circuits previously discussed. For example, if you needed to
Fo R

change the circuits of a hardwired system to have Switch 1 control Lamp 2, and Switch
2 control Lamp 1, it would take several minutes to rewire them, and would involve
exchanging the wires at the switches or the lamps. With a PLC, a simple editing
ot or

operation can make these changes internal to the program. This eliminates the need
for rewiring and this process takes only a fraction of the time required to change a
F

hardwired system
N

35
Introduction to Programmable Logic
Controllers

Ladder Logic and I/O Control

A practical application demonstrating the flexibility of a PLC ladder program is illustrated


in the next example. Figure 10 shows a vat containing a liquid. In this system, a motor
is energized to rotate the stirrer and mix the contents of the vat when certain conditions
of temperature and pressure are met.

n
ct ,
du nly
io
ro O
ep we
Figure 10: Vat Control System
r R vi

Figure 11 illustrates the hardwired method for vat control. In this example, a pressure
e

switch and a temperature switch are hardwired in series. This means both switches
Fo R

must be energized at the same time before the motor will start. A manual override push
button is also installed in order to bypass the temperature and pressure switches and
start the motor on demand.
ot or
F
N

Figure 11 Hardwired Vat Control System

36
Introduction to Programmable Logic
Controllers

Figure 12 illustrates the vat control circuit implemented in PLC ladder logic. Notice that
the three different inputs (pressure switch, temperature switch, and manual override)
are represented by the contacts 000, 001, and 002, respectively. The actual pressure
switch and the temperature switch would be hardwired to two different terminals on an
input module. The manual override push button would be hardwired to a third input
terminal. The motor, represented by the coil labeled 110, would be hardwired to a
terminal on an output module.

n
ct ,
du nly
io
ro O
ep we

Figure 12: PLC Vat Control System


r R vi
e

It now becomes quite easy to change the operating logic in the PLC without physically
moving a wire connection. Figure 13 shows how a traditional circuit would be
Fo R

reconnected in order to make temperature a critical path for the motor to work. As you
can see, the wiring of the switch must be physically changed, which could involve
ot or

extensive work depending on its location.


N F

Figure 13: Hardwired System Changes

37
Introduction to Programmable Logic
Controllers

Figure 14 shows how the PLC ladder logic is reprogrammed to implement the same
changes without ever touching a wire.

n
ct ,
du nly
io
ro O
ep we
Figure 14: PLC System Changes
r R vi

Remote I/O
e

Complex operating environments may require more input and output terminals than a
Fo R

single, fully populated equipment chassis can provide. When this is the case, additional
racks of I/O modules may be connected to the processor. These additional racks are
ot or

known as remote I/O because they are located remotely from the equipment chassis that
contains the processor module. Note that any I/O modules that reside in the same chassis
as the processor are known as resident I/O.
F

A remote I/O chassis consists of various input and output modules, a power supply, and
an interface adapter. There is no processor module in the remote I/O rack. The interface
adapter, which is installed in the left-most slot of the chassis in place of the processor,
provides a serial communication link from the remote racks to the processor.
N

38
Introduction to Programmable Logic
Controllers

Individual racks are normally connected to the processor using a daisy chain or star
configuration via one or two twisted-pair conductors or a single coaxial cable. The
distance a remote rack can be placed away from the processor varies between
manufacturers, but can be as much as two miles. Remote I/O offers tremendous savings
on wiring materials and labor costs for large systems in which the field devices are in
clusters at various spread-out locations. With the processor in a central area, only the
communication link is brought back to the processor, instead of hundreds of field wires.
Distributed I/O also offers the advantage of allowing subsystems to be installed and
started up independently, as well as allowing maintenance on individual subsystems while
others continue to operate.

Linking Multiple Processors

n
ct ,
du nly
io
Data Highway Plus (DH+) is a communications network used to transfer information
between multiple processors in a network. Each processor on the highway is assigned
a unique address, which identifies the station on the network. Up to sixty-four (64)

ro O
stations are allowed on a single data highway plus network, with station number
assignments ranging from 08-778. Multiple processors may be connected in a daisy
chain or, in a trunkline/dropline architecture.
ep we
r R vi
e
Fo R
ot or
F
N

39
Introduction to Programmable Logic
Controllers

RSLOGIX 5 INTRODUCTION
This section introduces the RSLogix 5 software. RSLogix 5 operates using a Windows-
based environment. This section discusses the major components found in the main
operating window of the software, and introduces several basic software functions.

n
ct ,
du nly
io
ro O
ep we
r R vi
e
Fo R
ot or
F
N

40
Introduction to Programmable Logic
Controllers

SCREEN LAYOUT AND ORGANIZATION


The RSLogix 5 main window is the interface between you and the PLC-5. The major
components of the main window, shown in Figure 15, are as follows:

• Ladder window
• Project window
• Results window
• Windows toolbar
• Standard toolbar
• Instruction toolbar

n
ct ,
• On-line toolbar

du nly
io
ONLINE WINDOWS STANDARD INSTRUCTION

ro O
TOOLBAR ep w TOOLBAR TOOLBAR TOOLBAR
e
r R vi
e
Fo R
ot or
F

LADDER
WINDOW
PROJECT
WINDOW
N

RESULTS WINDOW

Figure 15: RSLogix 5 Main Window

41
Introduction to Programmable Logic
Controllers

Ladder Window

The ladder window displays the ladder logic for the project that is open. This may be
software that is actively running on a PLC-5 processor, or ladder logic that is under
development off-line. The ladder window is shown in Figure 16.

n
ct ,
du nly
io
ro O
ep we
r R vi
e
Fo R

Figure 16: Ladder Window


ot or
F
N

42
Introduction to Programmable Logic
Controllers

You can have more than one ladder program open at a time. Each open program is
identified by a tab at the bottom of the window as shown in Figure 17. Just click on a
tab to bring that program to the front on the display.

n
ct ,
du nly
io
ro O
ep we
Figure 17: Ladder Window with Multiple Open Programs
r R vi

Programs can be renamed by double-clicking the tab. This opens the Rename popup
e

window shown in Figure 18. Type the new name in the “Name” field then click the OK
Fo R

button to change the name.


ot or
F
N

Figure 18: Renaming a Program

43
Introduction to Programmable Logic
Controllers

Project Window

The project window, shown in Figure 19, contains a variety of files associated with the
open project. The actual project files are stored in the various folders in the window.
You can expand each folder to see the project files inside by clicking the small “+” (plus
sign) located in the box to the left of the folder. A “-” (minus sign) to the left of the folder
means that the folder is expanded to show the project files within.

n
ct ,
du nly
io
ro O
ep we
r R vi
e
Fo R
ot or
F

Figure 19: Project Window


N

44
Introduction to Programmable Logic
Controllers

Controller Folder

The Controller folder contains the files for configuring communication between the
controller and various system devices. The controller folder also allows you to define
each equipment chassis in the system, along with the number and types of cards in
each chassis. Double click a particular file to open a popup window containing the
configuration options for that file. The Controller Properties popup window is shown in
Figure 20 as an example.

n
ct ,
du nly
io
ro O
ep we
r R vi
e
Fo R
ot or
F

Figure 20: Controller Properties Popup Window


N

45
Introduction to Programmable Logic
Controllers

Program Files Folder

The Program Files folder contains all of the ladder logic that makes up the project. An
example of an expanded Program Files folder is shown in Figure 21. Since each
controller can run a different project, the actual files in the Program Files folder may
change depending on which controller is being examined.

n
ct ,
du nly
io
ro O
ep we
r R vi
e
Fo R

Figure 21: Expanded Program Files Folder


ot or

The SYS 0 file is a system file that is automatically created by RSLogix for a new
F

project. Other than adding a name and description, you cannot change SYS 0 file.

Although it is not shown, there is also a SYS 1 file that is automatically created by
RSLogix. The SYS 1 file is a system file for programs written using Sequential Function
Chart (SFC). You will not see the SYS 1 file until you create an SFC program.
N

The other files in the Program Files folder are user-defined and contain the actual
ladder logic that makes up the project. The number of files in the folder can vary
depending on the application. RSLogix 5 allows you to create up to 997 individual
program files for ladder logic. These program files are numbered LAD 2 through LAD
999. (Remember that 0 and 1 are system files). The fact that you can add program
files helps to segment a large program into smaller pieces, such as subroutines, that are
easier to isolate and troubleshoot. Ideally, the name that you give each file should
describe the function performed by the ladder logic in that section of the program.

46
Introduction to Programmable Logic
Controllers

Data Files Folder

The Data Files folder contains information about instructions, I/O, and data used by the
program files. An expanded Data Files folder is shown in Figure 22. A list of data file
types is found in Table 16 following the figure.

n
ct ,
du nly
io
ro O
ep we
r R vi
e

Figure 22: Expanded Data Files Folder


Fo R

Table 16: Data Files


ot or

File File Type Notes


No.
F

O0 Output image Bits in this memory area control the status of all outputs.
table
I1 Input image Bits in this memory area indicate the status of all inputs.
table
S2 Status A processor configuration and status report.
N

B3 Bit or binary Binary (0 or 1) information.


T4 Timers Timer information.
C5 Counters Counter information.
R6 Control Used for advanced file instructions.
N7 Integer Integer values in the range -32,768 to +32,767.
F8 Floating-point Numbers containing a decimal point such as 5.6 or 6.2.
9 - 999 User assigned User assigned file types as needed. Timers and counters
may also use these file numbers.

47
Introduction to Programmable Logic
Controllers

Cross Reference Data File

The Cross Reference data file is a list of every instruction used in the main program and
its associated subroutines. Double click on the Cross Reference icon in the Data Files
folder to open the Cross Reference Report popup window, which is shown in Figure 23.
The popup lists the address and type of each instruction in the project. The cross-
reference report is also useful because it shows you where the open addresses are in
the event you need to insert an instruction. Double clicking a specific entry in the cross-
reference report closes the popup and places the cursor over that instruction in the
program.

n
ct ,
du nly
io
ro O
ep we
r R vi
e
Fo R
ot or

Figure 23: Cross Reference Report Popup Window


N F

48
Introduction to Programmable Logic
Controllers

Output Image Data File (O0)

The Output Image data file displays the status of all of the active and inactive outputs.
These are physical outputs attached to the terminals of the output modules in the rack.
Double click the O0 icon in the Data Files folder to open the Output Image Data File O0
popup window, which is shown in Figure 24. The display is arranged to show the 16
bits associated with each output word. A “1” in the display represents an active output
at the address, and a “0” represents an inactive output.

n
ct ,
du nly
io
ro O
ep we
r R vi
e
Fo R
ot or
F

Figure 24: Output Image Data File Popup Window


N

49
Introduction to Programmable Logic
Controllers

The Radix drop down menu changes the format of the displayed data between binary,
octal, decimal, Hex/BCD, or ASCII. Input and Output image tables are best displayed in
the binary format as shown in Figure 24.

The USAGE button on the popup window shows the user data memory locations that
are actually used by the program. For instance, one word in a binary file has sixteen
bits. Not all of these bits are necessarily used by the program. The Usage popup
window, shown in Figure 25, identifies the used bits with an X. Unused bits are
identified with a period (.). A description can be added to each bit to further identify the
usage. Left click the DATA FILE button to return to the previous display.

n
ct ,
du nly
io
ro O
ep we
r R vi
e
Fo R
ot or
F

Figure 25: Usage Popup Window


N

50
Introduction to Programmable Logic
Controllers

Input Image Data File (I1)

The Input Image data file displays the status of all of the active and inactive inputs.
These are physical inputs attached to the terminals of the input modules in the rack.
Double click the I1 icon in the Data Files folder to open the Input Image Data File I1
popup window, which is shown in Figure 26. The display is arranged to show the 16
bits associated with each input word. A “1” in the display represents an active input at
the address, and a “0” represents an inactive input.

n
ct ,
du nly
io
ro O
ep we
r R vi
e
Fo R
ot or
F

Figure 26: Input Image Data File Popup Window


N

51
Introduction to Programmable Logic
Controllers

Timer Data File (T4)

The Timer data file is a summary of all of the timers used in the program. Double click
the T4 icon in the Data Files folder to open the Timer Data File T4 popup window, which
is shown in Figure 27. Notice how the entries for timer T4:0 in the popup window
correspond to the entries for the timer in the ladder logic. The popup window makes it
easy to view the operation of multiple timers without actually having the ladder logic
containing the timer in the active display.

n
ct ,
du nly
io
ro O
ep we
r R vi
e
Fo R
ot or
F

Figure 27: Timer Data File Popup Window


N

52
Introduction to Programmable Logic
Controllers

Results Window

The Results window, which is usually located at the bottom of the screen, contains two
tabs: Build and Search Results. The Search Results tab displays the results of
searches for particular instructions. Searches are performed to find all of the instances
of a specific instruction within a program. The instances are listed at the bottom of the
screen in the results window under the Search Results tab. Clicking an entry in the
Results window moves the cursor over that instruction in the ladder logic as shown in
Figure 28.

n
ct ,
du nly
io
ro O
ep we
r R vi
e
Fo R
ot or
F

Figure 28: Search Results Window


N

53
Introduction to Programmable Logic
Controllers

The Build tab of the results window displays errors that occurred after the file or project
is verified. Types of errors include unknown instruction types, addressing errors, and
user-defined label usage.

You can detach the Results window from the bottom of the screen and move it
anywhere in the display. This is illustrated in Figure 29. Move the mouse pointer to the
outside border of the Results window, hold the left mouse button down then drag the
mouse to where you would like to move the window. RSLogix will remember the
position of the Results window if you close it without moving it back to the bottom of the
screen. You can move the window back to its original position by dragging it below the
ladder window before releasing the left mouse button.

n
ct ,
du nly
io
ro O
ep we
r R vi
e
Fo R
ot or
F
N

Figure 29: Results Window Moved in Display

54
Introduction to Programmable Logic
Controllers

Windows Toolbar

The Windows toolbar provides easy access to the global functions performed by
RSLogix. The Windows toolbar, located at the top of the screen, is a series of drop
down menus that operate in a manner identical to that of all Windows-based programs.
Left clicking one of the menu items opens the respective drop down menu. The FILE
drop down menu is shown in Figure 30 as an example of the options available through
the Windows toolbar.

n
ct ,
du nly
io
ro O
ep we
r R vi
e
Fo R
ot or
F

Figure 30: Windows Toolbar


N

55
Introduction to Programmable Logic
Controllers

Standard Toolbar

The standard toolbar is the row of icons located directly below the Windows toolbar.
The standard toolbar, shown in Figure 31, represents the functions of RSLogix used
most frequently during programming or software manipulation.

Figure 31: Standard Toolbar

n
ct ,
du nly
io
Functions found on the standard toolbar allow you to do the following:

• Create a new project

ro O
• Open an existing project
• Save your work to disk

ep w
Cut, copy and paste sections of ladder logic
• Undo and redo
e
• Search for instructions

r R vi

Verify a file or project


• Zoom in and out of the ladder logic display

e

Open an instruction palette


Fo R

Holding the cursor over an icon on the standard toolbar opens a small tool tip window
that identifies the function of the icon. An example of a tool tip is shown in Figure 32.
ot or
F

Figure 32: Tool Tip


N

56
Introduction to Programmable Logic
Controllers

Instruction Toolbar

The instruction toolbar contains all of the instructions supported by RSLogix 5. The
instruction toolbar, shown in Figure 33, is located above the ladder window.

Figure 33: Instruction Toolbar

n
ct ,
The instructions on the toolbar are grouped by function. The tabs below the actual

du nly
io
instructions identify these functional groups. Clicking the tab displays the instructions
within the group. The left and right arrow buttons allow you to scroll through the tabs
and instructions that are not visible in the display.

ro O
You use an instruction in your program by dragging it from the instruction toolbar with
the mouse. First, locate the instruction under the appropriate tab then move the mouse
ep w
pointer over the desired instruction. Hold the left mouse button down, drag the
instruction to the point in the ladder logic where you want to use it, and then release the
e
mouse button. The instruction will then be inserted into the ladder logic.
r R vi

You may also detach the instruction toolbar and move it to another area of the screen.
e

Just move the mouse pointer within the toolbar to a point above the row of instructions
or below the row of tabs. Hold the left mouse button down then drag the toolbar to the
Fo R

new location. An example of a detached instruction toolbar is shown in Figure 34.


Double click the mouse over the PLC5 Instructions title bar in the toolbar window to
ot or

move it back to its original position over the ladder window.


N F

Figure 34: Detached Instruction Toolbar

57
Introduction to Programmable Logic
Controllers

On-Line Toolbar

The on-line toolbar allows you to change operational status of the processor, identify
forces, determine the PLC node in communication with RSLogix, and identify the
communications driver being used with the node. The on-line toolbar, shown in
Figure 35, is located above project window in the RSLogix display.

n
ct ,
du nly
Figure 35: On-Line Toolbar

io
The node number of the PLC is identified in the lower, right-hand corner of the toolbar.

ro O
The node number can be either an octal or a decimal number. An octal format is
identified by the lower case “o” at the end of the node number.
ep w
The PLC is brought on-line with RSLogix or off-line using the drop down menu in the
upper, left-hand corner of the toolbar as shown in Figure 36. Note that you must have
e
the key switch on the processor in the REM position before you can change to
r R vi

PROGRAM mode using RSLogix.


e
Fo R
ot or
F

Figure 36: On-line/Off-line Drop Down Menu


N

58
Introduction to Programmable Logic
Controllers

FINDING HELP
A variety of on-line help features is available through RSLogix. These help features
cover all aspects of instruction usage, menu functions, and toolbar selections. The
easiest way to access the on-line help is by pressing the F1 key on the keyboard. This
opens a popup window with help information for whatever is active at the time. For
example, if the cursor is over an instruction in the ladder window, pressing the F1 key
opens a help window containing information for that specific instruction. This is
illustrated in Figure 37. The cursor is over the XIC instruction in the ladder window.
The topic discussed in the help window covers the XIC instruction.

n
ct ,
du nly
io
ro O
ep we
r R vi
e
Fo R
ot or
F
N

Figure 37: Help Window

59
Introduction to Programmable Logic
Controllers

All help functions are available through the drop down menu under the Help selection of
the Windows toolbar. The Help drop down menu is shown in Figure 38.

n
ct ,
du nly
io
ro O Figure 38: Help Drop Down Menu
ep we
r R vi
e
Fo R
ot or
F
N

60
Introduction to Programmable Logic
Controllers

FILES, MEMORY AREAS, AND ADDRESSING


Memory is the place in the PLC-5 processor where information is stored. There are two
basic types of PLC-5 processor memory: program and data. The program area of
memory holds the instructions that make up the ladder logic of the application. These
are the program files of the project. The data area is generally used for temporary
storage of information required by the project files. The project files use various
methods of addressing to move information into and out of the data areas.

MEMORY AREAS

n
ct ,
Memory is an information storage area for the processor. Exactly what is stored and

du nly
where it is stored depends on how the processor module was engineered. The

io
important point here is that not all processors use memory in the same way. However,
all PLC-5 processors have two basic memory areas: program and data.

ro O
ep we
r R vi
e
Fo R
ot or
F
N

61
Introduction to Programmable Logic
Controllers

Program Memory Area

The program area of processor memory is where the ladder logic is stored. Ladder
logic includes the main control program, subroutines, fault handling routines, and any
processor input interrupts. The program area is also where the system files for the
processor are stored. The PLC5/20 processor supports up to 16 main control
programs. User-defined ladder logic files may be numbered from 2 to 999.
Subroutines, fault routines, and interrupts are numbered from 3 to 999. These files
appear in the Project Files folder of the Project window as shown in Figure 39.

n
ct ,
du nly
io
ro O
ep we
r R vi
e
Fo R
ot or
F

Figure 39: Program Area File Assignments


N

62
Introduction to Programmable Logic
Controllers

How to Create a New Program File

1. Go off-line with the processor, or place the processor in the program mode. You
will not be able to create a program data file if you are on-line with a processor.

2. Move the mouse pointer over the Program Files folder in the Project window and
right-click the mouse. This opens the popup window shown in Figure 40.

n
ct ,
du nly
io
ro O
ep we
r R vi
e
Fo R
ot or
F

Figure 40: Program Files Popup Window


N

63
Introduction to Programmable Logic
Controllers

3. Left-click NEW from the popup window. This opens the Create Program File
popup window shown in Figure 41.

n
ct ,
du nly
io
ro O
ep we
r R vi
e

Figure 41: Create Program File Popup Window


Fo R

4. Type a number for the file in the “Number:” field. The number 50 is used as an
example in this illustration.
ot or
F
N

64
Introduction to Programmable Logic
Controllers

5. Enter a name for the new file and a description in the respective fields. A name
can be up to 10 characters in length, and a description up to 50 characters.
Remember that the file name and description should relate to the function of the
software. Keep in mind that any documentation you associate with the file may
be useful for troubleshooting problems at some future date. As an example, this
ladder file is given the name “SUBR-1” with a description of “sample ladder file.”
An example of the completed popup window is shown in Figure 42.

n
ct ,
du nly
io
ro O
ep we
r R vi
e
Fo R
ot or

Figure 42: Completed Create Data File Popup Window


N F

65
Introduction to Programmable Logic
Controllers

6. Select the OK button after you enter the name and description. This enters the
new file with the assigned name in the Program Files folder as shown in
Figure 43.

n
ct ,
du nly
io
ro O
ep we
r R vi
e

Figure 43: New File in Program Files Folder


Fo R
ot or
F
N

66
Introduction to Programmable Logic
Controllers

7. Double click the “LAD 50 – SUBR-1” program file to open the file for
programming. Notice the new file opens over anything you may already have
open in the ladder window as shown in Figure 44. The name you entered for the
file appears on the tab at the bottom of the ladder window, and the description
you entered, as well as the name of the file, appear in the title bar the top of the
ladder window.

n
ct ,
du nly
io
ro O
ep we
r R vi
e
Fo R

Figure 44: LAD 50 – SUBR-1 File Open for Editing in Ladder Window
ot or
F
N

67
Introduction to Programmable Logic
Controllers

Data Memory Area

The smallest storage location in processor memory is a bit. Eight bits are grouped
together to form a byte. Sixteen bits (2 bytes) are grouped together to form a word.
The Allen-Bradley PLC-5/40 processor has 48 K-words of data area memory space.
This memory space is set aside for the requirements of the data table. The data table
includes the input image, output image, bit, timer, counter, and other files in the Data
Files folder of the Project window. An example of the files in the Data Files folder is
shown in Figure 45.

n
ct ,
du nly
io
ro O
ep we
r R vi
e
Fo R
ot or
F
N

Figure 45: Data Area File Assignments

68
Introduction to Programmable Logic
Controllers

Files with numbers zero through 8 are default files for the PLC-5. The letter and
number designations for each data file relate to the type (format) of information that can
be stored in the file as described in Table 17.

Table 17: PLC-5 Default Data Files

File File Type Notes


No.
O0 Output Image Bits in this memory area control the status of all
Table outputs.

n
I1 Input Image Table Bits in this memory area indicate the status of all inputs.

ct ,
du nly
S2 Status A processor configuration and status report.

io
B3 Bit or binary Binary (0 or 1) information.
T4 Timers Timer information.
C5 Counters Counter information.
R6
N7
Control
Integer
ro O Used for advanced file instructions.
Integer values in the range -32,768 to +32,767.
ep w
F8 Floating-point Numbers containing a decimal point such as 5.6 or 6.2.
e
Data files numbered 9 through 999 are user defined to contain a specific data type. The
r R vi

user defined data file types are listed in Table 18.


e

Table 18: PLC-5 User Defined Data File Types


Fo R

Identifier File Type


ot or

B Bit or binary
T Timers
F

C Counters
R Control
N Integer
F Floating-point
A ASCII
N

D BCD/Hexadecimal
BT Block Transfer
Control
PD PID Control
SC SFC Status
MG Message Control
ST ASCII String

69
Introduction to Programmable Logic
Controllers

How to Create a New Data File

You must first determine the format of the data that is going to be stored in the file. You
then pick a new file type that is consistent with the format of this data. Assume for this
example that additional space is required in memory to store integer data. Based on
the information in Table 18, we are going to create a data file having an “N” identifier.
This example creates an integer data file with a file number of 100. Note that this
number assignment is arbitrary, but it must be in the range of 9 to 999, which are
reserved for the user-defined files. Follow these steps to create a new data file, which,
in this case, is identified as N100.

1. Go off-line with the processor, or place the processor in program mode. You will

n
ct ,
du nly
not be able to create a new data file if you are on-line with a processor.

io
2. Move the mouse pointer over the Data Files folder in the Project window and
right-click the mouse. This opens the popup window shown in Figure 46.

ro O
ep we
r R vi
e
Fo R
ot or
F
N

Figure 46: Popup Window for New Data File

70
Introduction to Programmable Logic
Controllers

3. Left-click NEW from the popup window. This opens the Create Data File popup
window shown in Figure 47.

n
ct ,
du nly
io
ro O
ep we
r R vi
e
Fo R
ot or
F

Figure 47: Create Data File Popup Window

4. Type “100” in the “File:” field. This is the user defined reference number of the
new file for this example. Valid file numbers are from 9 to 999.
N

71
Introduction to Programmable Logic
Controllers

5. Open the “Type:” drop down menu and select INTEGER from the list as shown in
Figure 48.

n
ct ,
du nly
io
ro O
ep we
r R vi
e
Fo R
ot or
F

Figure 48: Data File Type Selection

6. Enter a name for the new file and a description in the respective fields. A name
can be up to 10 characters in length, and a description up to 50 characters. The
name and description should reflect what information is being held in the file.
N

Keep in mind that any documentation you associate with the file may be useful
for troubleshooting problems at some future date.

72
Introduction to Programmable Logic
Controllers

7. Enter the number of elements the file contains in the “Elements:” field. The
number of elements is the number of individual pieces of information being
stored in the file. This sets aside sufficient data memory to hold your information.
This example uses 10 elements of memory. The completed popup window is
shown in Figure 49.

n
ct ,
du nly
io
ro O
ep we
r R vi
e
Fo R
ot or
F

Figure 49: Completed Create Data File Popup Window


N

73
Introduction to Programmable Logic
Controllers

8. Click the OK button from the bottom of the popup window. This creates the new
integer file N100 – TEST in the Data Files folder of the Project window as shown
in Figure 50.

n
ct ,
du nly
io
ro O
ep we
r R vi
e
Fo R
ot or

Figure 50: New Integer Data File Created


N F

74
Introduction to Programmable Logic
Controllers

You can examine the contents of any data file by double-clicking the mouse over it.
This opens a popup window for that data file with the memory contents displayed.
Double clicking the mouse over the new N100 – TEST file opens the popup window
shown in Figure 51. Notice the description in the title bar, and that the file contains ten
elements labeled 0 through 9. All ten elements contain 0 for data as shown in
Figure 51.

n
ct ,
du nly
io
ro O
ep w
Figure 51: File N100 – TEST Popup Window
e
ADDRESSING
r R vi

An address is a location in memory where information is stored. Addressing is the


method by which this information is moved to that location. RSLogix uses a variety of
e

addressing schemes in order to manipulate data. You must understand these schemes
Fo R

to ensure that the information you need goes where you want at the time you want it
there.
ot or

There are several basic types of addressing schemes as follows:


F

• Logical
• Indexed
• Indirect
• Symbolic
• I/O image
N

Logical Addressing

Logical addresses are codes that specify the location of information in the data table.
Variations of a logical addressing allow indexed and indirect addressing schemes. The
general format of a logical address is as follows:

#TN:0.s/b

75
Introduction to Programmable Logic
Controllers

Table 19 explains the details of the logical address format.

Table 19: Logical Address Format

Symbol Description
# The # symbol indicates an indexed address.
Omit the # symbol if you are not using an indexed address.

T This indicates the file type. Any of the following letters are valid file types:
• B – binary • A - ASCII
• C – counter • D – BCD

n
ct ,
du nly
• F – floating-point • BT – block transfer

io
• I – input • MG – message
• O – output • PD – PID
• N - integer • SC – SFC status

ro O
• S - status
• R – control
• ST – ASCII string
• CT – ControlNet Transfer
ep w
• T – timer
e

N This indicates the file number. Allowable numbers are from 0 to 999. The file
r R vi

number is that which is associated with the file type for the files in the Data
File folder.
e
Fo R

: The ‘:’ symbol is a delimiter separating the file reference from the word
reference (which is the location within the file where the data is found).
ot or

0 The 0 is the word number within the file. This number must be in octal for
input or output files, and decimal for other file types.
F

. The ‘.’ Symbol is a delimiter that indicates a structure member mnemonic


follows.

s The ‘s’ represents the structure member mnemonic of a counter, timer, or


N

control file. The structure member mnemonic is an abbreviation that is two or


three characters long.

/ The ‘/’ is a delimiter indicating a bit number reference follows.

b The b represents a bit number reference. This number must be in octal (008
through 078 and 108 through 178) for input or output files, and decimal (00
through 15) for other file types.

76
Introduction to Programmable Logic
Controllers

Indexed Addressing

Indexed addressing adds the contents of a special register, known as the index register,
to a base address in order to form a new (indexed) address. The PLC-5 uses status
register S:24 as the index register. The contents of S:24 are added to the base address
to form the indexed address. The program then goes to the indexed address to retrieve
or store data. It is up to the programmer to make sure the index register S:24 is loaded
with the correct offset before using an indexed address.

Indexed addresses are especially useful with loop structures. The index register can be
forced to increment or decrement with each iteration of a loop. The offset from the
status register is then combined with the base address, providing access to a sequential

n
ct ,
du nly
range of data registers.

io
Indexed addresses in a program begin with the pound sign (#). The easiest way to
understand the operation of an indexed address is by an example.

ro O
Start by examining the contents of status register S:24, shown in Figure 52. Recall that
you can open the status register by double clicking the S2 file from the Data Files folder.
ep w
From the figure, you can see that the binary number 00000000000000112 is stored in
e
the register, which is equivalent to 3 in decimal.
r R vi
e
Fo R
ot or
F
N

Figure 52: Status Register S:24

77
Introduction to Programmable Logic
Controllers

Now consider the logical address N7:0, which is the address of the first integer in the N7
data file. The contents of this register are displayed in Figure 53. The data stored at
address N7:0 is 1.

n
ct ,
du nly
io
ro O Figure 53: Integer Register N7
ep w
Now modify the logical address N7:0 to form the indexed address #N7:0. When the
e
program encounters the # at the base address, the software goes to status register S:24
to get the offset. In this case, the offset is 3 as shown in Figure 52. This value is added
r R vi

to the base address of N7:0 to yield an indexed address of N7:3. The data at this
memory location is 50, which is the value that would be used in any calculation by the
e

program.
Fo R

Indirect Addressing
ot or

Like indexed addressing, indirect addressing is a modification of a basic logical address.


The significant difference is that an indirect address points to another address, which
F

then points to the data. After calculating the offset, the indexed address points to the
actual data.

Indirect addresses are identified by brackets somewhere in the instruction. An example


of an indirect addressing format is N[N7:2]:1. The value within the brackets becomes
N

part of the address.

78
Introduction to Programmable Logic
Controllers

Consider the contents of integer data register N7 shown in Figure 54 as an example.


The data at location N7:2 is 100.

n
ct ,
du nly
io
ro O
Figure 54: Integer Data Register N7 and Indirect Addressing
ep we
r R vi
e
Fo R
ot or
F
N

79
Introduction to Programmable Logic
Controllers

The indirect instruction retrieves this data (100) and substitutes it for what is in the
brackets. In this case, N[N7:2]:1 becomes N100:1. N100 is a user-defined data file that
will be found in the Data Files folder of the Project window, as shown in Figure 55.

n
ct ,
du nly
io
ro O
ep we
r R vi
e
Fo R
ot or
F

Figure 55: User-Defined N100 Data File


N

80
Introduction to Programmable Logic
Controllers

N100:1 is a logical address that points to word number 1 in the file. The N100 data file
is shown in Figure 56. The data at location N100:1 is 33. This value, 33, would then be
used in any calculation referenced using the indirect address. This example used an
integer register for the indirect address. Valid registers for indirect addressing include
the following types: N, T, C, R, B, I, O, and S.

n
ct ,
du nly
io
ro O
ep w
Figure 56: N100 Data File
e
r R vi

Symbolic Addressing

Symbolic addressing allows you to substitute a name for a logical address. This
e

symbolic name can then describe the information contained at the address, which
Fo R

should make the program flow easier to understand. There are several restrictions on
symbolic names:
ot or

1. The symbolic name is limited to 20 characters in length. Allowable characters


are:
F

• The letters A through Z (uppercase)


• The numbers 0 through 9
• The underscore ( _ ) character
N

2. A symbolic name cannot be only numbers.

3. The following characters are not allowed in a symbolic name: ~ ` ! @ # $ % ^ & *


()+=[]{}\|:;“<>?/,.

4. A symbolic name cannot be a number followed by a D, O, H, E, or B. These are


considered representations of decimal, octal, hexadecimal, exponential, and
binary numbers, respectively.

81
Introduction to Programmable Logic
Controllers

5. You cannot start a symbolic name with the letters O, I, or S, and then follow that
letter with a number. These are considered representations of logical addresses
for output, input, or status files, respectively.

6. No blank spaces are allowed.

How to Create or Edit a Symbolic Name for an Address

There are several ways to create or edit a symbolic name for an address. These steps
illustrate one of the easier methods.

1. Determine the name you are going to assign. The name should describe some

n
ct ,
du nly
attribute of the function occurring at the address, and help you to understand the

io
flow of the ladder logic. A little thought at this step could provide a great deal of
help during fault diagnosis and troubleshooting.

ro O
2. Right click the mouse over the symbol for which you are assigning a symbolic
name. This opens the popup window shown in Figure 57.
ep we
r R vi
e
Fo R
ot or
F
N

Figure 57: Popup Window for Symbolic Name Entry

82
Introduction to Programmable Logic
Controllers

3. Select EDIT DESCRIPTION from the popup window. This opens a popup
window for the symbol shown in Figure 58.

n
ct ,
du nly
io
ro O
ep w
Figure 58: Symbolic Name Entry
e
r R vi

4. Enter or change the description of function in the “Edit Description Type” field,
and the actual symbolic name in the “Symbol” field. Be as descriptive as
possible with your entries. An example of a completed description and symbolic
e

name is shown in Figure 59.


Fo R
ot or
F
N

Figure 59: Symbolic Name Entry Completed

83
Introduction to Programmable Logic
Controllers

5. Select the OK button when you are satisfied with the information in the popup
window. This enters the symbolic name and description into the ladder logic as
shown in Figure 60.

n
ct ,
du nly
io
ro O
ep we
r R vi

Figure 60: Symbolic Name and Description in Ladder Logic


e
Fo R
ot or
F
N

84
Introduction to Programmable Logic
Controllers

I/O Image Addressing

I/O image addressing is used to move data between the processor module and the I/O
modules in the equipment chassis. The general format of a logical address is as
follows:

M:rng/tb
Table 20 explains the details of this format.

Table 20: I/O Image Address Format

n
ct ,
du nly
io
Symbol Description
M This indicates the file type. The following letters are valid file types:
• I – input

ro O
• O – output
ep w
rn This indicates the I/O rack number. The rack number, which must be in octal
format, has a maximum allowable range of 008 to 278. The actual allowable
e
range depends on the model of the PLC-5 processor.
r R vi

g This indicates the I/O group number. The I/O group number is in octal format
and ranges from 08 to 78.
e
Fo R

/ The / is a delimiter separating the I/O group number from the terminal
number.
ot or

tb This indicates the terminal (bit) on an I/O module to which the I/O point is
connected.
F

Figure 61 illustrates how an I/O address appears in the ladder logic.


N

Figure 61: I/O Address in Ladder Logic

85
Introduction to Programmable Logic
Controllers

Chassis, Slots, I/O Racks, and Groups

This section of the text describes how the software talks to the I/O modules of the
hardware. There are several basic concepts that are easily confused. These concepts
include the following:

• Chassis
• Slot
• Rack
• Group

n
ct ,
Chassis and slots are concepts that refer to the hardware, while racks and groups relate

du nly
to the software.

io
Chassis and Slots

ro O
The chassis is the piece of equipment that holds the modules. Each module is
connected to a slot in the chassis. A single chassis can have up to 16 slots to hold the
ep w
various modules. Other common chassis sizes are 8-slot and 12-slot.
e
r R vi
e
Fo R
ot or
F
N

86
Introduction to Programmable Logic
Controllers

I/O Rack

An I/O rack is not the same as an I/O chassis. The chassis is the hardware. Racks are
files in software. This means a rack is a logical device, not a physical one.

One I/O rack is 8 words of the output image table and 8 words of the input image table.
Remember that these image tables are the first two files in the Data Files folder in the
RSLogix 5 Project window. The contents of the Data Files folder are shown in
Figure 62. The output image table is labeled O0, and the input image table is labeled
I1.

n
ct ,
du nly
io
ro O
ep we
r R vi
e
Fo R
ot or
F
N

Figure 62: Data Files Folder

87
Introduction to Programmable Logic
Controllers

I/O Group

An I/O group is comprised of two words, one input word (16 bits) and one output word
(16 bits) in the data table. This means that one I/O rack consists of 8 I/O groups
(because 1 rack is 8 words in each of the output and input image tables).

Slot Addressing for I/O Transfer

Allen-Bradley offers a good deal of flexibility in the types and sizes of I/O modules that
you may install in a rack. If, for example, you purchase a digital input module with
provisions for 16 inputs, then the inputs from the module correspond nicely to the 16
bits available in an I/O group of the input image table. In this case, the transfer of data

n
ct ,
du nly
between the input module and the processor is relatively straightforward.

io
Digital input modules, however, have 8, 16, or 32 inputs, depending on the model
selected for the application. These inputs somehow have to relate to the input image

ro O
table, which has a defined size of 16 bits per group and 8 groups per rack.
Allen-Bradley accounts for this by providing three different slot addressing schemes
through RSLogix. These slot addressing schemes are as follows:
ep w

e
1-slot
• 2-slot
r R vi

• ½-slot
e
Fo R
ot or
F
N

88
Introduction to Programmable Logic
Controllers

1-Slot Addressing

When 1-slot addressing is selected, the processor addresses one slot in the rack as one
group. Therefore, a 16-slot chassis contains two logical racks (rack 0 and rack 1) when
1-slot addressing is used. The physical address of each group corresponds to an input
and output image table word. The type of module you install determines the number of
bits and the type of word that are used.

With 1-slot addressing, 16 input bits and 16 output bits are available in the processor’s
image table for each I/O group. Therefore, you can use any mix of 8-point or 16-point
modules in any order, and you need only eight slots of a chassis to achieve up to 128
I/O points. When you use 8-point I/O modules with 1-slot addressing, only eight bits of

n
ct ,
du nly
the I/O image table word, for that I/O group, are used. Figure 63 illustrates 1-slot

io
addressing.

ro O
ep we
r R vi
e
Fo R
ot or
F
N

Figure 63: 1-Slot Addressing

89
Introduction to Programmable Logic
Controllers

2-Slot Addressing

Two-slot addressing forces the processor to address two I/O module slots as one I/O
group. Therefore, a 16-slot chassis contains one rack (rack 0) when 2-slot addressing
is used. Each I/O group is then allotted one word (16 points) in the input image table
and one word in the output image table. This means you cannot use a 32-point card
with 2-slot addressing because only 16 points are reserved in the respective image
table.

You can use 8-point or 16-point I/O modules with 2-slot addressing. If you are using 16-
point cards, you must alternate an input card with an output card in the chassis.
Alternating the cards is the only way to match the points on the card with the

n
ct ,
du nly
corresponding points in the image tables. An example of 2-slot addressing is shown in

io
Figure 64.

ro O
ep we
r R vi
e
Fo R
ot or
F
N

Figure 64: 2-Slot Addressing

90
Introduction to Programmable Logic
Controllers

1/2-Slot Addressing

When you select 1/2-slot addressing, the processor addresses one-half of an I/O
module slot as one I/O group. Therefore, a 16-slot chassis contains four racks (rack 0,
rack 1, rack 2, and rack 3) when 1/2-slot addressing is used. The physical address of
each I/O slot corresponds to two input and two output image table words. The type of
module you install determines the number of bits in these words that are used.

Since 16 input bits and 16 output bits are available in the processor’s image table for
each I/O group, you can mix 8, 16 and 32-point I/O modules in any order in the I/O
chassis. A 32-point I/O module (two 1/2-slot I/O groups) uses two words of the image
table. Fewer I/O points are available by using 1/2–slot addressing with 8 or 16-point I/O

n
ct ,
du nly
modules. Figure 65 illustrates 1/2-slot addressing.

io
ro O
ep we
r R vi
e
Fo R
ot or
F
N

Figure 65: 1/2-Slot Addressing

91
Introduction to Programmable Logic
Controllers

Examples of I/O Image Addressing

Sixteen-point I/O modules have 16 input terminals or 16 output terminals. A 16-point


I/O module uses a full word in the input or output image table. Figure 66 illustrates how
16-point I/O modules are mapped to the image tables.

n
ct ,
du nly
io
ro O
ep we
r R vi
e
Fo R
ot or
F
N

Figure 66: Sixteen Point I/O Modules

92
Introduction to Programmable Logic
Controllers

USING RSLOGIX 5
This section discusses the more common operations performed using RSLogix. This
includes going on-line with a controller, along with basic editing and file manipulation
commands.

GOING ON-LINE WITH A CONTROLLER


You must be on-line with a controller in order to see what is happening with the project
that the controller is currently running. Follow these steps to start RSLogix and go on-
line with a controller.

n
ct ,
du nly
How to Go On-Line with a Controller

io
These steps assume that the laptop and the controller have already been configured to

ro O
communicate with each other. You will need to set up the communication link using the
RSLinx software package if the communication protocol has changed or is otherwise
incorrect.
ep w
1. Connect the communications interface cable between the laptop computer that is
e
running RSLogix and the controller.
r R vi
e
Fo R
ot or
F
N

93
Introduction to Programmable Logic
Controllers

2. Start the RSLogix software package. This will generally be through a shortcut
icon on the desktop of the computer you are using. RSLogix opens to a blank
screen as shown in Figure 67.

n
ct ,
du nly
io
ro O
ep we
r R vi
e
Fo R

Figure 67: Starting RSLogix 5


ot or
F
N

94
Introduction to Programmable Logic
Controllers

3. Open the “Comms” drop down menu. The Comms drop down menu is shown in
Figure 68.

n
ct ,
du nly
io
ro O
ep we
r R vi
e
Fo R

Figure 68: Comms Drop Down Menu/WHO ACTIVE GO ONLINE Selection


ot or
F
N

95
Introduction to Programmable Logic
Controllers

4. Select WHO ACTIVE GO ONLINE from the Comms drop down menu. This
opens the Communications popup window shown in Figure 69. If you see a
large red “X” over any device then communication is not established with that
device. If this is the case then check the configuration of the communications
driver using RSLinx.

n
ct ,
du nly
io
ro O
ep we
r R vi
e
Fo R
ot or

Figure 69: Communications Popup Window


N F

96
Introduction to Programmable Logic
Controllers

5. Click the ONLINE button. RSLogix now attempts to go on-line with the
connected controller. RSLogix reads the name of the project from the controller
and attempts to find a file with the same name on the hard drive. When the
matching file is located, the ladder logic appears in the display as shown in
Figure 70.

n
ct ,
du nly
io
ro O
ep we
r R vi
e
Fo R
ot or

Figure 70: RSLogix On-Line with a Controller


N F

97
Introduction to Programmable Logic
Controllers

UPLOADING A PROJECT FROM A PLC-5


Uploading a project is the process of transferring a program loaded on a PLC-5
processor into memory of the programming interface connected to the processor.
Uploading is necessary because RSLogix requires that you have a copy of the project
on the hard disk before you can go on line to the controller. You will be prompted to
upload the project if you attempt to go on-line and RSLogix cannot find a copy of the
project on the hard disk.

How to Upload a Project

n
These steps assume that the laptop and the controller have already been configured to

ct ,
du nly
communicate with each other. You will need to set up the communication link using the

io
RSLinx software package if the communication protocol has changed or is otherwise
incorrect.

ro O
1. Connect the communications interface cable between the laptop computer that is
running RSLogix and the controller.
ep w
2. Start the RSLogix software package. This will generally be through a shortcut
e
icon on the desktop of the computer you are using. RSLogix opens to a blank
screen as shown in Figure 71.
r R vi
e
Fo R
ot or
F
N

Figure 71: Starting RSLogix 5

98
Introduction to Programmable Logic
Controllers

3. Open the “Comms” drop down menu. The Comms drop down menu is shown in
Figure 72.

n
ct ,
du nly
io
ro O
ep we
r R vi
e
Fo R

Figure 72: Comms Drop Down Menu/UPLOAD Selection


ot or
F
N

99
Introduction to Programmable Logic
Controllers

4. Select UPLOAD from the Comms drop down menu. RSLogix then searches for
a project saved in the default directory on the hard disk for a file with the same
name as that on the controller. If RSLogix cannot locate a file then the Going to
Online Programming State popup window opens. The Going to Online
Programming State popup window is shown in Figure 73. This popup window
allows you to create a new file in the default directory, merge the file with one of
those identified in the bottom half of the popup window, or browse for a location
to store the file. You will be prompted to go on-line with the controller after the
upload is finished.

n
ct ,
du nly
io
ro O
ep we
r R vi
e
Fo R
ot or
F

Figure 73: Going to Online Programming State Popup Window


N

100
Introduction to Programmable Logic
Controllers

SAVING A PROJECT
Saving your project writes a current copy of your work to the hard drive. Be sure to
save your work frequently if you are working off-line.

How to Save a Project

Follow these steps to save a copy of your work to the hard disk.

1. Left click the icon of the floppy disk from the standard toolbar located at the top of
the screen. This icon is shown in Figure 74.

n
ct ,
du nly
io
ro O
ep we
Figure 74: Floppy Disk Icon from Standard Toolbar
r R vi
e
Fo R
ot or
F
N

101
Introduction to Programmable Logic
Controllers

Note that you may also select SAVE from the File drop down menu to
accomplish the same thing. The File drop down menu is shown in Figure 75.

n
ct ,
du nly
io
ro O
ep we
r R vi
e
Fo R
ot or

Figure 75: File Drop Down Menu/SAVE Selection


N F

102
Introduction to Programmable Logic
Controllers

2. Selecting either the icon from the standard toolbar or the SAVE selection from
the File drop down menu method opens the Revision Note popup window shown
in Figure 76. This window allows you to enter some descriptive comment
regarding any corrections or updates to the software. It is also helpful to enter
the date that the software changes were made.

n
ct ,
du nly
io
ro O
ep w
Figure 76: Revision Note Popup Window
e

3. Click the OK button after the revision note is entered. This saves the project to
r R vi

the default location on the hard drive.


e
Fo R
ot or
F
N

103
Introduction to Programmable Logic
Controllers

How to Change the Default Path where Projects are Saved

Changing the default path prevents the need to browse for the location where projects
are stored. This also changes the default path for upload operations. Follow these
steps to change the default project path.

1. Select Tools from the menu bar at the top of the screen. This opens the Tools
drop down menu shown in Figure 77.

n
ct ,
du nly
io
ro O
ep we
r R vi
e
Fo R
ot or
F

Figure 77: Tools Drop Down Menu


N

104
Introduction to Programmable Logic
Controllers

2. Select OPTIONS from the Tools drop down menu. This opens the System
Options popup window shown in Figure 78.

n
ct ,
du nly
io
ro O
ep we
r R vi
e
Fo R
ot or
F

Figure 78: System Options Popup Window


N

105
Introduction to Programmable Logic
Controllers

3. Select the top BROWSE button from the three shown in the lower, right-hand
corner of the popup window. This is the BROWSE button for the “Project Files
Search Path” field. Selecting this button opens the Set Directory popup window
shown in Figure 79.

n
ct ,
du nly
io
ro O
ep w
Figure 79: Set Directory Popup Window
e

4. Select the new default location from the list of folders available, then left click the
r R vi

OK button from the Set Directory popup window. This closes the popup window
and returns you to the System Options popup window.
e
Fo R

5. Left click the OK button from the System Options popup window. This closes the
popup and changes the default location for saving files.
ot or

DOWNLOADING A PROJECT TO A PLC-5


F

Downloading a project moves a copy of the software on the programming interface


(laptop) to the PLC-5 controller. Projects are downloaded after completing any offline
edits and you are ready to run the project. Note that you must be in the OFFLINE mode
with RSLogix before you can download a project to a controller.
N

How to Download a Project

These steps assume that the laptop and the controller have already been configured to
communicate with each other. You will need to set up the communication link using the
RSLinx software package if the communication protocol has changed or is otherwise
incorrect.

1. Connect the communications interface cable between the laptop computer that is
running RSLogix and the controller.

106
Introduction to Programmable Logic
Controllers

2. Start the RSLogix software package. This will generally be through a shortcut
icon on the desktop of the computer you are using. RSLogix opens to a blank
screen as shown in Figure 80.

n
ct ,
du nly
io
ro O
ep we
r R vi
e
Fo R

Figure 80: Starting RSLogix 5


ot or

3. Left click the icon of the open folder, shown in Figure 81, from the standard
F

toolbar. This opens the Open/Import PLC5 Program popup window from which
you can select a file to open. You must open the file on the hard drive before you
can download it to the controller.
N

Figure 81: Open Folder Icon

107
Introduction to Programmable Logic
Controllers

4. Select the desired file from the Open/Import PLC5 Program popup window, as
shown in Figure 82. You can browse for a file in a different folder by clicking the
GOTO button located near the middle of the window. Notice the revision notes
for the project located at the bottom of the window.

n
ct ,
du nly
io
ro O
ep we
r R vi
e
Fo R
ot or
F

Figure 82: Open/Import PLC5 Program Popup Window


N

108
Introduction to Programmable Logic
Controllers

5. Left click the OPEN button after selecting a project. This opens the project in the
RSLogix display as shown in Figure 83.

n
ct ,
du nly
io
ro O
ep we
r R vi
e
Fo R
ot or

Figure 83: Open Project in RSLogix Display


N F

109
Introduction to Programmable Logic
Controllers

6. Open the Comms drop down menu. The Comms drop down menu is shown in
Figure 84.

n
ct ,
du nly
io
ro O
ep we
r R vi

Figure 84: Comms Drop Down Menu


e
Fo R
ot or
F
N

110
Introduction to Programmable Logic
Controllers

7. Select DOWNLOAD from the drop down menu. This opens the RSLogix 5 popup
window shown in Figure 85.

n
ct ,
du nly
io
Figure 85: RSLogix 5 Popup Window

ro O
8. Click YES from the popup window and the program in the display will be
downloaded to the controller. You will be asked if you want to go on-line after the
ep w
download completes.
e
r R vi
e
Fo R
ot or
F
N

111
Introduction to Programmable Logic
Controllers

EDITING LADDER LOGIC


Editing is the process of adding, inserting, and deleting rungs, branches, and
instructions to the ladder logic. RSLogix usually provides multiple ways to perform a
task, and editing ladder logic is no exception. The methods presented in this text are
designed to familiarize you with some of the capabilities of RSLogix.

A project can be edited in one of two ways: online and offline. Zone markers in the
ladder logic identify the rungs being edited. These zone markers change to allow you to
track the status of your edits, and offer you opportunities to easily remove unwanted
changes.

n
ct ,
du nly
Edit Zone Markers

io
Online edits are indicated in the project by the upper case zone markers “I,” “R,” and
“D.” Uppercase markers indicate edits that are present in controller memory. These

ro O
markers appear between the rung number and the vertical bar (power rail) on the left
side of the ladder logic.
ep w
• I (Insert): These are new rungs that have been inserted into the ladder logic.
e

• R (Replace): These rungs have been replaced in controller memory. Rungs


r R vi

marked with an “R” will continue to function until new edits have been tested.
e

• D (Delete): These rungs have been deleted in controller memory. Rungs marked
Fo R

with a “D” will continue to function until the new edits have been tested.
ot or
F
N

112
Introduction to Programmable Logic
Controllers

Offline edits are indicated in the project by the lower case zone markers “e,” “i,” “r,” and
“d.” Lowercase markers indicate edits that are present in computer memory. These
markers also appear between the rung number and the vertical bar (power rail) on the
left side of the ladder logic.

• e (edit): These are new rungs that have been inserted into the ladder logic and
are currently being edited. This zone marker disappears after the ladder logic is
verified, indicating that the edits are now included in the project.

• i (insert): These rungs have been inserted into the ladder logic in computer
memory while online with a controller. Rungs marked with an “i” are not moved

n
to controller memory until the rung is accepted. Once accepted, the lower case

ct ,
du nly
“i” is replaced by the uppercase “I.”

io
• r (replace): These rungs are marked for replacement. Rungs marked with an “r”
are not moved to controller memory until the rung is accepted. Once accepted,

ro O
the lower case “r” is replaced by the uppercase “R.”


ep w
d (delete): These rungs are marked to be deleted. The lower case “d” means
that these rungs still reside in computer memory. Rungs marked with a “d” are
e
not moved to controller memory until the rung is accepted. Once accepted, the
lower case “d” is replaced by the uppercase “D.”
r R vi

Online Editing
e
Fo R

Online editing allows you to change a project while you are online with RSLogix 5 to
ladder logic that is actively running on a controller. There are four steps involved in
ot or

online editing. These are verify, accept, test, and assemble.

• Verifying edits is the process in which RSLogix checks your new programming
F

for syntax errors. Syntax errors are those that involve incorrect or improper use
of ladder logic instructions. Syntax errors must be corrected before the controller
will accept the new instructions.

• Edits are accepted after they are verified. This takes any offline edits (those
N

marked with an “e”) and moves them into controller memory. These rungs will
then be marked with an “I” (insert).

• Edits are tested after they are accepted. Any rungs that are marked with an “I”
(insert) are used in the ladder logic in place of those marked with an “R”
(replace). This allows you to check your work before finalizing the changes.

113
Introduction to Programmable Logic
Controllers

• Edits are assembled after they are tested. Edit zone markers are removed at this
stage. Rungs marked with an “I” are incorporated into the ladder logic, and those
rungs marked with an “R” are removed. You cannot undo any edits after they are
assembled.

Online Editing Restrictions

RSLogix does not permit you to resize the data tables, create project files, or delete
project files while you are online. You must go offline with the controller before
performing these types of operations.

n
ct ,
du nly
How to Verify, Accept, Test, and Assemble Online Edits

io
1. Go online with the controller being edited, and locate the rung where changes
are being made. This example replaces the OTE instruction at logical address

ro O
B3:0/0 on rung 0000 with an OTE instruction at logical address O:012/3. The
original ladder logic is shown in Figure 86.
ep we
r R vi
e
Fo R
ot or
F
N

Figure 86: Original Ladder Logic for Online Editing Example

114
Introduction to Programmable Logic
Controllers

2. Right click the mouse over the number of the rung being edited. This opens the
popup window shown in Figure 87.

n
ct ,
du nly
io
ro O
ep we
r R vi
e
Fo R
ot or

Figure 87: Popup Menu for Online Editing


N F

115
Introduction to Programmable Logic
Controllers

3. Select START RUNG EDITS from the popup window. This inserts a duplicate of
the rung being edited above the original as shown in Figure 88. RSLogix keeps
track of the original rung until the edits are tested and assembled. This allows
you to back out of any changes if they do not work as planned. The original rung
(which is now rung0001) is marked by the lower case letter “r” shown just to the
right of the rung number. This rung will be replaced by the rung being edited.
The rung being edited (rung 0000) is marked by the lower case letter “e.” Lower
case letters mean that the edits are offline.

n
ct ,
du nly
io
ro O
ep we
r R vi
e
Fo R
ot or

Figure 88: New Rung for Editing (Offline)


N F

116
Introduction to Programmable Logic
Controllers

4. Make the changes to the rung marked with the “e.” This example changes the
OTE instruction from logical address B3:0/0 to O:012/3 as shown in Figure 89.

n
ct ,
du nly
io
ro O
ep we
r R vi

Figure 89: OTE Logical Address Changed


e
Fo R
ot or
F
N

117
Introduction to Programmable Logic
Controllers

5. Right click the mouse over the number of the rung being edited. This opens the
popup menu shown in Figure 90.

n
ct ,
du nly
io
ro O
ep we
r R vi
e
Fo R
ot or

Figure 90: Popup Menu for Verifying Rung Edits


N F

118
Introduction to Programmable Logic
Controllers

6. Select VERIFY RUNG from the popup menu. This checks the syntax of the rung
being edited. The rung is marked for insertion as shown in Figure 91, if the rung
does not contain errors. Notice that the edits are still offline as indicated by the
lower case letters.

n
ct ,
du nly
io
ro O
ep we
r R vi
e

Figure 91: Rung Verified


Fo R
ot or
F
N

119
Introduction to Programmable Logic
Controllers

7. Right click the mouse over the number of the rung being edited. This opens the
popup menu shown in Figure 92.

n
ct ,
du nly
io
ro O
ep we
r R vi
e
Fo R
ot or
F

Figure 92: Popup Menu for Accepting Rung Edits


N

120
Introduction to Programmable Logic
Controllers

8. Select ACCEPT RUNG EDITS from the popup menu. This moves the edits from
computer RAM to the controller. The rung is now marked by a capital letter “I” to
indicate the edits are online. The online bar above the project window now
indicates that edits exist in the controller as shown in Figure 93.

n
ct ,
du nly
io
ro O
ep we
r R vi

Figure 93: Rung Edits Accepted


e
Fo R
ot or
F
N

121
Introduction to Programmable Logic
Controllers

You must now test the edits to ensure correct operation of the changes. During testing
the rung marked “I” takes precedence over the rung marked “R” during execution of the
ladder logic. Testing edits can be performed using selections from another popup
menu, however this example uses the online editing toolbar icons located just above the
ladder logic. The TEST EDITS button is the second from the right as shown in Figure
94.

n
ct ,
du nly
io
ro O
ep we
r R vi
e
Fo R
ot or

Figure 94: TEST EDITS Button from Online Editing Toolbar


F

9. Left click the TEST EDITS button to initiate testing. This opens the confirmation
popup window shown in Figure 95.
N

Figure 95: Test Edits Confirmation Popup Window

122
Introduction to Programmable Logic
Controllers

10. Left click YES from the confirmation popup window. This allows you to test the
edits in the project. The ladder logic display will not change, however the online
bar indicates edits are active as shown in Figure 96.

n
ct ,
du nly
io
ro O
ep we
r R vi
e

Figure 96: Test Edits Online Indication


Fo R
ot or
F
N

123
Introduction to Programmable Logic
Controllers

11. Assemble the edits when you are satisfied the program works correctly. You
may either assemble the edits using a popup menu selection, or select the
ASSEMBLE EDITS button, as in this example. Once the edits are assembled,
the rung marked for removal is actually removed from the ladder logic, and the
rung marked for insertion becomes part of the project as shown in Figure 97.

n
ct ,
du nly
io
ro O
ep we
r R vi
e
Fo R

Figure 97: Edits Assembled


ot or
F
N

124
Introduction to Programmable Logic
Controllers

Offline Editing

Offline editing allows you to change a project residing in computer memory (RAM).
Offline edits need only be verified as correct before the program is downloaded to the
PLC-5. During verification, RSLogix checks for unknown instruction types in the ladder
logic and ensures that the addresses in the ladder logic are defined in the data tables.
Any errors found during verification are reported under the BUILD tab of the Results
window, which is located at the bottom of the screen. There are various methods for
verifying edits. You may verify a single rung, a file, or an entire project.

How to Verify a Single Rung

n
ct ,
du nly
1. Right click the mouse over the number of the rung being verified. This opens the

io
popup menu shown in Figure 98. Rungs that need to be verified are marked by
the lower case letter “e” shown just to the right of the rung number.

ro O
ep we
r R vi
e
Fo R
ot or
F
N

Figure 98: Popup Window to Verify a Single Rung of Ladder Logic

125
Introduction to Programmable Logic
Controllers

2. Select VERIFY RUNG from the popup window. RSLogix will verify the rung and
display any errors in the Results window at the bottom of the screen. The
Results window is shown in Figure 99. Note that double-clicking the mouse over
the error message moves the cursor to the instruction in the ladder logic that
contains the error.

n
ct ,
du nly
io
ro O
ep we
r R vi
e
Fo R
ot or
F

Figure 99: Results Window


N

126
Introduction to Programmable Logic
Controllers

How to Verify a File or Project

Verifying a file or project is similar to verifying a single rung. The major difference
relates to the scope of the verification. Selecting the respective icon located at the top
of the screen verifies a file or project. The icons are shown in Figure 100. The file
verification icon is on the left side, and the project verification icon is on the right side.
Errors are displayed in the Results window regardless of which verification is selected.

n
ct ,
du nly
io
Figure 100: Verify File and Verify Project Icons

ro O
UNDO and REDO
ep w
UNDO and REDO are functions designed to help you back out of mistakes. UNDO and
REDO are two buttons found on the standard toolbar at the top of the screen as shown
e
in Figure 101. The UNDO button is on the left with the arrow that points to the left, and
the REDO button is on the right with the arrow that points to the right.
r R vi
e
Fo R
ot or

Figure 101: UNDO Button (Left Arrow) and REDO Button (Right Arrow)
F

The UNDO button reverses your last step. If you insert a rung in the wrong place,
incorrectly change the text of an instruction, or make just about any other mistake, the
UNDO button will back you up to where you were before you made the mistake. UNDO
can be used on up to 200 previous actions. If you make a mistake with the UNDO
button and remove something you did not mean to, the REDO button will restore the
N

object you just removed with the UNDO button.

127
Introduction to Programmable Logic
Controllers

INSERTING AND APPENDING RUNGS OF LADDER LOGIC


New rungs of ladder logic can be added to a program by either inserting the rung or
appending the rung. Rungs are inserted above the current location of the cursor in the
ladder window, while appended rungs are added below the location of the cursor.

How to Insert a Rung

1. Move the mouse pointer over the rung number where you want the new rung to
go then right-click the mouse. This opens the popup menu shown in Figure 102.
Rung 0001 is highlighted in this example. Remember that inserting a rung

n
places it above the location of the cursor.

ct ,
du nly
io
ro O
ep we
r R vi
e
Fo R
ot or
F
N

Figure 102: Popup Menu with Mouse Pointer over Rung Number

128
Introduction to Programmable Logic
Controllers

2. Select INSERT RUNG from the popup menu. This pushes the existing ladder
logic down one rung and inserts a new rung at the location of the cursor. The
new rung is shown in Figure 103. Notice the number of the new rung is 0001.
The lower case letter “e” to the right of the rung number indicates that new edits
are present.

n
ct ,
du nly
io
ro O
ep we
r R vi

Figure 103: New Rung Inserted


e
Fo R
ot or
F
N

129
Introduction to Programmable Logic
Controllers

How to Append a Rung

1. Move the mouse pointer over the rung number where you want the new rung to
go then right-click the mouse. This opens the popup menu shown in Figure 104.
Rung 0002 is highlighted in this example. Remember that appending a rung
places it below the location of the cursor.

n
ct ,
du nly
io
ro O
ep we
r R vi
e
Fo R
ot or
F

Figure 104: Popup Window with Mouse Pointer Over Rung Number
N

130
Introduction to Programmable Logic
Controllers

2. Select APPEND RUNG from the popup menu. The new rung is then inserted at
rung number 0003, which is below the location of the cursor. The new rung is
shown in Figure 105, along with rung 0001 which was inserted in the previous
example.

n
ct ,
du nly
io
ro O
ep we
r R vi
e
Fo R

Figure 105: New Rung Appended


ot or
F
N

131
Introduction to Programmable Logic
Controllers

BRANCHING
Branches are parallel flow paths within the ladder logic. Branches allow you to program
conditional instructions in which one branch or another is taken for a given set of inputs.

How to Insert a Branch

1. Decide where you are going to put the branch. This may seem obvious, but
there are many ways in which to insert a branch. Your ladder logic can quickly
become a confused jumble of lines if you are not careful about what you are
doing. This example inserts a branch on rung 0000 across the XIO instruction

n
labeled “First Scan of Ladder or SFC Step” at S:1/15, which is highlighted in

ct ,
du nly
Figure 106.

io
ro O
ep we
r R vi
e
Fo R
ot or
F

Figure 106: Location for New Branch

2. Hold the left mouse button down over the branch icon under the USER tab of the
N

instruction toolbar. The rung icon is shown in Figure 107.

Figure 107: Rung Icon Under USER Tab of Instruction Toolbar

132
Introduction to Programmable Logic
Controllers

3. Drag the mouse into the ladder window. A series of red boxes appears in the
ladder logic as soon as you drag the mouse into the window. These red boxes,
shown in Figure 108, represent valid positions at which you can place the
branch. You will also notice that the mouse pointer changes to the rung icon as
soon as the pointer is over the ladder logic. As you move the mouse around the
window, you will notice that one of the red boxes changes color from red to green
and contains a small “X” within the box. This green box represents the point at
which the branch will be inserted.

n
ct ,
du nly
io
ro O
ep we
r R vi

Figure 108: Insertion Points for the New Branch


e
Fo R

4. Release the mouse pointer when the branch is over the desired position. This
inserts a new branch at the location as shown in Figure 109.
ot or
F
N

Figure 109: New Branch Inserted

133
Introduction to Programmable Logic
Controllers

5. Hold the left mouse button down over the red box on the end of the branch then
drag it to the termination point. The series red boxes again appear in the window
as shown in Figure 110. These red boxes indicate valid termination points for the
branch. One of the boxes will change color from red to green as you drag the
mouse. This indicates the point at which the branch will terminate when the
mouse button is released.

n
ct ,
du nly
io
ro O
ep we
r R vi

Figure 110: Dragging the Branch to the Termination Point


e

6. Release the left mouse button. This places the branch across the XIC instruction
Fo R

as shown in Figure 111.


ot or
F
N

Figure 111: New Branch Terminated

134
Introduction to Programmable Logic
Controllers

PROGRAMMING WITH BIT INSTRUCTIONS


More than 120 instructions make up the PLC-5 programming language. The simplest
and most common instructions control the flow of data to a single point, or bit.
Therefore, these single point instructions are known collectively as bit instructions.

SELECTED BIT INSTRUCTIONS


Bit instructions provide the interface between discrete components and the application
software. Discrete I/O consists of those field devices that are either on or off.
Examples of discrete components are limit switches, photo sensors, or LED’s. Bit

n
ct ,
instructions also read and write information to internal processor memory, such as the

du nly
S2 (status) and B3 (binary) data files.

io
There are a number of different bit instructions. The bit instructions discussed in this

ro O
text that are supported by the PLC-5 are as follows:

• Examine If Closed (XIC)


ep w
• Examine If Open (XIO)
• Output Energize (OTE)
e
• Output Latch (OTL)
r R vi

• Output Unlatch (OTU)


e
Fo R
ot or
F
N

135
Introduction to Programmable Logic
Controllers

Examine IF CLOSED (XIC)

Examine If Closed is a bit-input instruction identified by the mnemonic XIC. Two XIC
instructions are shown on the left side of Figure 112.

n
ct ,
du nly
io
ro O
ep we

Figure 112: XIC Instructions


r R vi
e
Fo R
ot or
F
N

136
Introduction to Programmable Logic
Controllers

An XIC address beginning with the letter “I” is used with devices that are physically
connected to the terminals of a discrete input module. When one of these input devices
closes a circuit, a “1” is written to the input image table at the address corresponding to
that input device as illustrated in Figure 113. The processor then verifies that the circuit
is still closed when the XIC instruction referencing the address is encountered in the
user program. If the circuit is still closed, then the processor sets the logic for the XIC
instruction as true, which will energize an output instruction on the same rung as the
XIC instruction.

n
ct ,
du nly
io
ro O
ep we
r R vi
e
Fo R
ot or
F

Figure 113: XIC Instruction and the Input Image Data Table
N

137
Introduction to Programmable Logic
Controllers

An XIC address beginning with the letter “B” is used with internal processor memory
instead of physical devices. When another instruction (such as an output enable) writes
a “1” to a bit in memory, then a “1” is written to the bit data table at the address
corresponding to that memory location as illustrated Figure 114. The processor then
verifies that the memory address still contains a “1” when the XIC instruction referencing
the memory address is encountered in the user program. If the address still contains a
“1” then the processor sets the logic for the XIC instruction as true, which will energize
an output instruction on the same rung as the XIC instruction.

n
ct ,
du nly
io
ro O
ep we
r R vi
e
Fo R
ot or
F

Figure 114: XIC Instruction and the Bit Data Table


N

138
Introduction to Programmable Logic
Controllers

Examine IF OPEN (XIO)

Examine If Open is a single bit input instruction identified by the mnemonic XIO. Two
XIO instructions are shown in Figure 115.

n
ct ,
du nly
io
ro O
ep we
Figure 115: XIO Instructions
r R vi

The XIO instruction is similar to the XIC instruction except, when encountered in the
e

program, the XIO instruction looks for a “0” (zero) value at the address to which it is
attached in the data table. As with XIC, the XIO instruction may begin with the letter “I”
Fo R

for physical devices connected to the terminals of a discrete input module, or begin with
the letter “B” for internal processor memory.
ot or
F
N

139
Introduction to Programmable Logic
Controllers

The XIO instruction looks for a “0” value at the address with which it is associated in
order to make the ladder logic true. As an example, compare the XIC instruction to the
XIO instruction in Figure 116. Output O:000/00 will be energized if I:002/17 is on and
O:000/01 will be energized if I:002/17 is off.

n
ct ,
du nly
io
ro O
ep we
r R vi

Figure 116: Comparison of XIC and XIO


e

Output Enable Instruction (OTE)


Fo R

OTE is a single bit output instruction. The output remains true (on) for as long as rung
ot or

continuity to the OTE instruction remains true. Output Enable instruction addresses
begin with the letter “O” for physical outputs, or the letter “B” for internal outputs. An
F

example of the Output Enable instruction is shown in Figure 117 on the right side of the
rung.
N

Figure 117: OTE Instruction

140
Introduction to Programmable Logic
Controllers

Output Latch (OTL)

Once the Output Latch instruction becomes true/energized, it remains on even if rung
continuity is removed. It is considered a retentive device. Retentive devices retain their
value until they are reset by another rung of logic. Latches remain in their last state
even if the machine is powered off and on again. An example of the OTL instruction is
shown in Figure 118.

n
ct ,
du nly
io
ro O
ep w
Figure 118: OTL Instruction
e
Output Unlatch (OTU)
r R vi

The Output Unlatch instruction is used to clear a latched output. Therefore, the Output
e

Unlatch is normally paired with, and given the same address as, an Output Latch
instruction. An example of an Output Unlatch instruction is shown in Figure 119.
Fo R
ot or
F
N

Figure 119: OTU Instruction

141
Introduction to Programmable Logic
Controllers

Latch and unlatch instructions are usually arranged so they cannot both be on at the
same time. An example of this arrangement is shown in Figure 120. If power is applied
to the unlatch, the output device associated with the latch/unlatch address will be de-
energized, regardless of the state of the latch.

n
ct ,
du nly
io
ro O
ep we
r R vi

Figure 120: Arrangement of Latch And Unlatch Instructions


e

USING BIT INSTRUCTIONS


Fo R

There are two basic steps involved in programming with bit instructions: inserting the
ot or

instruction and assigning an address. Inserting the instruction is relatively


straightforward. Just drag the part from the instruction toolbar to the desired position in
F

the ladder logic. There are then several options for assigning an address. These
options include typing the address directly (if you know it), or assigning an address from
a data file. You may also search for unused addresses that you may assign to an
instruction.
N

142
Introduction to Programmable Logic
Controllers

How to Insert Bit Instructions into a Program

Input instructions are always on the left side of the ladder logic, and output instructions
are on the right side. This means that continuity through a rung is from left (input) to
right (output).

1. Left click the BIT tab on the instruction menu. This displays all of the bit
instructions under the tab as shown in Figure 121. If you forget the name of a
particular instruction, holding the mouse pointer over the instruction will display
the name in a popup window.

n
ct ,
du nly
io
ro O
Figure 121: Bit Instruction Icons under BIT Tab of Instruction Toolbar
ep w
2. Hold the left mouse button down over the specific bit instruction in the instruction
toolbar. An XIC instruction (located on the far left side of the instruction toolbar)
e
is used in the following steps.
r R vi
e
Fo R
ot or
F
N

143
Introduction to Programmable Logic
Controllers

3. Drag the mouse into the ladder window. A series of red boxes appears in the
ladder logic as soon as you drag the mouse into the window. These red boxes,
shown in Figure 122, represent valid positions at which you can place the
instruction. You will also notice that the mouse pointer changes to the XIC icon
as soon as the pointer is over the ladder logic. As you move the mouse around
the window, you will see that one of the red boxes changes color from red to
green and contains a small “X” within the box. This green box represents the
point at which the branch will be inserted. In this example, the insertion point for
the instruction is rung 0003.

n
ct ,
du nly
io
ro O
ep we
r R vi
e
Fo R
ot or
F

Figure 122: Insertion Points for XIC Instruction


N

144
Introduction to Programmable Logic
Controllers

4. Release the left mouse button. This inserts the instruction on rung 0003 as
shown in Figure 123. The small question mark above the instruction means that
an address has not yet been assigned.

n
ct ,
du nly
io
ro O
ep we
r R vi
e
Fo R
ot or

Figure 123: XIC Instruction Inserted into Ladder Logic


F

5. Now insert an OTE instruction on the rung. Begin by holding the left mouse
button down over the desired instruction in the instruction toolbar. Note that the
OTE instruction is the third icon from the left as shown in Figure 124.
N

Figure 124: OTE Instruction on Instruction Toolbar

145
Introduction to Programmable Logic
Controllers

6. Drag the mouse into the ladder window. Move the OTE instruction to the right
side of the insertion point on rung 0003 as shown in Figure 125. Be sure you are
close enough to the insertion point so that the box changes color from red to
green.

n
ct ,
du nly
io
ro O
ep we
r R vi
e
Fo R
ot or

Figure 125: Insertion Point for OTE Instruction


N F

146
Introduction to Programmable Logic
Controllers

7. Release the left mouse button. This inserts the instruction on the rung as shown
in Figure 126. You now need to assign addresses to the new parts.

n
ct ,
du nly
io
ro O
ep we
r R vi
e
Fo R

Figure 126: OTE Instruction Inserted into Ladder Logic


ot or
F
N

147
Introduction to Programmable Logic
Controllers

How to Assign a Logical Address Directly at the Instruction

1. Select the part for which the address is being assigned. This example uses the
XIC instruction on rung 0003 as shown in Figure 127.

n
ct ,
du nly
io
ro O
ep we
r R vi
e
Fo R
ot or

Figure 127: XIC Instruction Selected for New Address


N F

148
Introduction to Programmable Logic
Controllers

2. Begin typing a valid address. Depending on the application, the letters “B”
(binary), which is used in this example, or “I” (input) would be acceptable logical
addresses for the XIC instruction. Typing the first letter of the logical address
opens the drop down menu shown in Figure 128.

n
ct ,
du nly
io
ro O
ep we
r R vi
e
Fo R
ot or

Figure 128: Starting the Logical Address


N F

149
Introduction to Programmable Logic
Controllers

3. Double click B, BINARY from the drop down list. The options in the drop down
list change to reflect some of the available logical addresses as shown in
Figure 129.

n
ct ,
du nly
io
ro O
ep we
r R vi

Figure 129: Available Logical Addresses


e
Fo R
ot or
F
N

150
Introduction to Programmable Logic
Controllers

4. Double click one of the options from the drop down list, or continue typing if the
displayed options are not acceptable. The first option in the drop down list is
selected in this example as shown in Figure 130.

n
ct ,
du nly
io
ro O
ep we
r R vi

Figure 130: Logical Address Selected


e
Fo R
ot or
F
N

151
Introduction to Programmable Logic
Controllers

5. Left click the mouse somewhere in the ladder window. This assigns the logical
address to the component as shown in Figure 131.

n
ct ,
du nly
io
ro O
ep we
r R vi

Figure 131: Logical Address Assigned to XIC Instruction


e
Fo R
ot or
F
N

152
Introduction to Programmable Logic
Controllers

How to Drag and Drop a Logical Address from a Data File

You may assign a logical address by dragging it from any data table file then dropping
the address onto the component.

1. Open the data table file from which the address is being selected. This example
uses the B3 (binary) file as shown in Figure 132.

n
ct ,
du nly
io
ro O
ep we
r R vi
e
Fo R

Figure 132: B3 Data Table File Open


ot or
F
N

153
Introduction to Programmable Logic
Controllers

2. Hold the left mouse button down over the desired logical address in the B3 data
table window and drag the address into the ladder window. The target for the
logical address in this example is the OTE instruction on rung 0003. A series of
red boxes appears in the ladder logic as soon as you drag the mouse into the
window. These red boxes, shown in Figure 133, represent valid targets for the
logical address. You will also notice that the mouse pointer identifies the
selected logical address as soon as the pointer is over the ladder logic. As you
move the mouse around the window, you will see that one of the red boxes
changes color from red to green and contains a small “X” within the box. This
green box represents the component for which the address will be assigned.

n
ct ,
du nly
io
ro O
ep we
r R vi
e
Fo R
ot or

Figure 133: Logical Address Targets


N F

154
Introduction to Programmable Logic
Controllers

3. Release the left mouse button. This assigns the logical address to the
component as shown in Figure 134. Any symbolic address or description
previously assigned to the logical address will also transfer to the target
component and appear in the display.

n
ct ,
du nly
io
ro O
ep we
r R vi

Figure 134: Logical Address Assigned to OTE Instruction


e
Fo R
ot or
F
N

155
Introduction to Programmable Logic
Controllers

How to Search for Unused Logical Addresses

You can easily search for an open logical address if you require an address that is not
already assigned to another component in the project.

1. Open the data file in which to search. As an example, the I1 (input image) data
table is open in Figure 135.

n
ct ,
du nly
io
ro O
ep we
r R vi
e
Fo R
ot or
F

Figure 135: I1 Input Image Data Table File


N

156
Introduction to Programmable Logic
Controllers

2. Left click the USAGE button from the bottom of the data table window. This
changes the display to reflect the logical address usage as shown in Figure 136.
Any address marked by an “X” has already been assigned in the project. A “W”
states that the address is used at the word level with the project.

n
ct ,
du nly
io
ro O
ep we
r R vi
e
Fo R
ot or

Figure 136: Logical Address Usage


N F

157
Introduction to Programmable Logic
Controllers

3. You can assign or reassign the logical address of a component by dragging the
address from the data table window to the target component. As an example,
the logical address of the XIC instruction on rung 0003 shown in Figure 137 is
being changed from B3:0/0 to I:010/0. Just drag the I:010/0 address from the
open data table window to the target then release the mouse.

n
ct ,
du nly
io
ro O
ep we
r R vi
e
Fo R
ot or

Figure 137: XIC Logical Address Changed from B3:0/0 to I:010/0


N F

158
Introduction to Programmable Logic
Controllers

PROGRAMMING WITH TIMERS


Timers are devices that delay the energizing or de-energizing of an output signal for a
selected amount of time. They provide many of the same capabilities available with
timing relays and solid-state timing devices. There are three timer instructions available
through RSLogix 5:

• Timer On-Delay (TON)


• Timer Off-Delay (TOF)
• Retentive Timer On-Delay (RTO)

n
ct ,
TIMER OPERATION

du nly
io
Several parameters define the operation of timers. These parameters include the
following:


• ro O
Timer type (on-delay, off-delay, or retentive on-delay)
Timer address
ep w
• Time base
• Timer preset value
e
• Timer accumulator value
r R vi

• Timer status bits


e

Timer Type
Fo R

The type defines how the timer affects the output signal. There are three timer
instructions supported by the PLC-5. These are as follows:
ot or

• Timer On-Delay (TON)


F

• Timer Off-Delay (TOF)


• Retentive Timer On-Delay (RTO)
N

159
Introduction to Programmable Logic
Controllers

Timer On-Delay (TON)

The timer on-delay instruction is used to delay an output from going on after an input to
the timer goes on. The length of the delay is programmed into the timer. The timer on-
delay instruction is identified by the mnemonic TON. An example of a TON instruction
is shown in Figure 138.

n
ct ,
du nly
io
ro O
ep w
Figure 138: Timer On-Delay (TON) Instruction
e
The timer is assigned the address T4:26 in the example provided in Figure 138. The
r R vi

timer is programmed with a time base of 0.01 seconds and a preset value of 100. The
calculated on delay of the timer would then be 0.01 x 100 = 1.0 seconds.
e

The input signal to the timer is provided through the XIC instructions at address B3:1/0
Fo R

and address B3:1/7. The timer begins accumulating time towards the calculated on-
delay when both XIC instructions are true. This accumulated value appears in the
ot or

“Accum” field at the bottom of the timer instruction. The “Done Bit” from the timer then
becomes true after the accumulated value equals the preset value, which means the
F

timer has reached the calculated on-delay time (which is 1.0 seconds).
N

160
Introduction to Programmable Logic
Controllers

Timer Off-Delay (TOF)

The timer-off delay instruction is used to delay an output from going off after the input to
the timer goes off. The length of the delay is programmed into the timer. The timer off-
delay instruction is identified by the mnemonic TOF. An example of a TOF instruction is
shown in Figure 139.

n
ct ,
du nly
io
ro O
Figure 139: Timer Off-Delay (TOF) Instruction

The timer-enable bit (EN) is de-energized when the input rung goes false. The timer-
ep w
timing bit turns on when the input goes false and stays energized while the timer
instruction is timing. The timer-timing bit turns off when the preset value equals the
e

accumulator value.
r R vi

The timer-done bit turns off when the accumulator is equal to the preset value, or when
e

the timer finishes timing. The timer-done bit also turns on when the input logic to the
Fo R

timer goes false.

Retentive Timer On-Delay (RTO)


ot or

The retentive timer instruction is used to maintain the accumulator value if the input to
F

the timer goes false. The retentive timer instruction lets the timer stop and start without
resetting the accumulated value. A reset instruction (RES) with the same address as
the timer has to be programmed on another rung in order to reset the retentive timer
accumulator value. The retentive timer on-delay instruction is identified by the
mnemonic RTO. An example of a RTO instruction is shown in Figure 140.
N

Figure 140: Retentive Timer On-Delay (RTO) Instruction

161
Introduction to Programmable Logic
Controllers

The RTO instruction begins timing when the input to the timer goes true. The timer
updates the accumulated value until it reaches the preset value for as long as the rung
remains true. The RTO instruction retains its accumulated value, even if one of the
following occurs:

• The rung goes false.


• The PLC-5 is changed from run to program mode.
• The processor faults or loses power.

When the processor resumes operation or the rung goes true, timing continues from the
retained accumulated value. By retaining its accumulated value, retentive timers

n
measure the cumulative period during which the input rung is true.

ct ,
du nly
io
Timer Address

Each timer has a unique address in the data table of the PLC-5 memory. Data file T4 is

ro O
reserved for timers. There is room for 1000 timers in data file T4 numbered from T4:0
to T4:999. Use the lowest available number when programming a new timer in order to
ep w
conserve memory space.
e
Each timer address references three words of data table memory. One of these words
holds the timer preset value, one word holds the accumulated value, and one word
r R vi

holds the status bits that are used for output control of the timer.
e

Timer Preset Value


Fo R

The range for the timer preset is a value from 0 to 32,767. The preset value establishes
ot or

the number of timed intervals (0.01 or 1 second) to be timed. When the accumulator
equals the preset, the time delay is complete. The time delay is calculated by
multiplying the preset value by the time base. If the preset is equal to 1000, and the
F

time base is equal to 0.01 second, then the time delay equals 10 seconds (1000 x 0.01
seconds = 10 seconds).

Timer Accumulator Value


N

The timer accumulator accumulates time base increments (while the timer is timing)
until it matches the timer preset. The accumulator counts the number of timed intervals
that have elapsed since the timer was activated.

162
Introduction to Programmable Logic
Controllers

Timer Status Bits

There are three status bits in the timer status word. These status bits can be used in
the ladder program to trigger some event. The processor changes the state of status
bits depending on the condition of the timer. Timers have the following status bits:

• Timer Enable Bit (EN) (bit 15) is set (on) when the input to the timer is true, and
reset (off) when the input is false or when timer is reset by a RES instruction.

• Timer Timing Bit (TT) (bit 14) is set (on) when the timer is actively timing. This
means that for an off-delay timer, the TT bit is set (on) when the input to the timer

n
is off, and the TT bit is reset (off) when the input is on. For an on-delay timer, the

ct ,
du nly
status of the TT bit follows the input signal to the timer (on when the input is true

io
and off when the input is false). The TT bit is also reset (off) when the timer is
reset by a RES instruction.

ro O
• Timer Done Bit (DN) (bit 13) indicates when the accumulator value equals the
preset value, meaning that the timer has timed-out. For an on-delay timer, the
ep w
DN bit is off until the accumulator reaches the preset. The DN bit then changes
state to on and remains on until the input to the timer goes false. For an off-
e
delay timer, the DN bit is on until the accumulator reaches the preset. The DN bit
then changes state to off and remains off until the input to the timer changes
r R vi

state to on The TT bit is also reset (off) for both the on-delay and the off-delay
when the timer is reset by a RES instruction.
e
Fo R

Time Base
ot or

A timer can count in increments of 0.01 or 1 seconds. This is the time base of the timer.
The time base is multiplied by the timer preset value to determine the delay time of the
timer.
N F

163
Introduction to Programmable Logic
Controllers

RESET TIMER/COUNTER INSTRUCTION (RES)


There is one reset instruction used with both timers and counters. Of the three timer
instructions, only the retentive timer, which retains the accumulator value, requires the
use of the reset instruction. TON and TOF timers are normally reset by the removal of
the input signal enabling the timer. The reset instruction is identified by the mnemonic
RES. An example of a RES instruction is shown in Figure 141. Note how the logical
address of the RES instruction corresponds to that of the RTO instruction.

n
ct ,
du nly
io
ro O
ep w
Figure 141: Reset Timer/Counter (RES) Instruction
e
USING TIMER INSTRUCTIONS
r R vi

This section of the module discusses programming with timers. This includes dragging
e

a timer into a program, setting up or modifying the time-base, and using the timer status
Fo R

bits as indicators.

How to Insert a New Timer into a Program


ot or

A timer is a type of output instruction. This means it is programmed on the right side of
F

the ladder logic.

1. Left click the TIMER/COUNTER tab on the instruction menu. This displays all of
the timer and counter instructions under the tab as shown in Figure 142. If you
forget the name of a particular instruction, holding the mouse pointer over the
N

instruction will display the name in a popup window.

Figure 142: Timer Instruction Icons under TIMER/COUNTER Tab of Instruction


Toolbar

164
Introduction to Programmable Logic
Controllers

2. Hold the left mouse button down over the specific timer instruction in the
instruction toolbar. An RTO instruction (located third from the left side of the
instruction toolbar) is used in the following steps.

3. Drag the mouse into the ladder window. A series of red boxes appears in the
ladder logic as soon as you drag the mouse into the window. These red boxes,
shown in Figure 143, represent possible positions at which you can place the
instruction. You will also notice that the mouse pointer changes to the RTO icon
as soon as the pointer is over the ladder logic. As you move the mouse around
the window, you will see that one of the red boxes changes color from red to
green and contains a small “X” within the box. This green box represents the
point at which the instruction will be inserted. In this example, the insertion point

n
ct ,
du nly
for the instruction is rung 0001. Since the timer is an output instruction, the

io
insertion point is to the right of the box on the far right side of the rung.

ro O
ep we
r R vi
e
Fo R
ot or
F

Figure 143: Insertion Point for RTO Instruction


N

165
Introduction to Programmable Logic
Controllers

4. Release the left mouse button. This inserts the instruction on rung 0001 as
shown in Figure 144. The small question mark in the “Timer” field means that an
address has not yet been assigned to the instruction.

n
ct ,
du nly
io
ro O
ep we
r R vi

Figure 144: RTO Instruction Inserted into Ladder Logic


e
Fo R
ot or
F
N

166
Introduction to Programmable Logic
Controllers

How to Assign or Modify a Timer Address

Timer addresses are entered in the “Timer” field of the instruction. This address links
the timer to a specific location in the T4 data file.

There is more than one way to assign an address to a timer. The example searches for
an unused address in the T4 data file and then assigns that address to the timer.

1. Double click the T4 file from the Data Files folder in the project window of
RSLogix. This opens the T4 data file popup window shown in Figure 145.

n
ct ,
du nly
io
ro O
ep we
r R vi
e
Fo R
ot or
F

Figure 145: T4 Data File Popup Window


N

167
Introduction to Programmable Logic
Controllers

2. Left click the USAGE button from the bottom of the data table window. This
changes the display to reflect the logical address usage as shown in Figure 146.
Timer addresses are indicated under the “Offset” column. A “W” in the column
labeled “FW” indicates timers that are already used in a program.

n
ct ,
du nly
io
ro O
ep we
r R vi
e
Fo R
ot or

Figure 146: Timer Usage


N F

168
Introduction to Programmable Logic
Controllers

3. Move the mouse pointer over the scroll bar located on the right side of the
window. Hold the left mouse button down and drag the scroll bar down until you
find a timer that is not used. This example uses timer T4:61 as shown in
Figure 147.

n
ct ,
du nly
io
ro O
ep we
r R vi
e
Fo R
ot or
F

Figure 147: Unused Timer T4:61


N

169
Introduction to Programmable Logic
Controllers

4. Move the mouse pointer over the desired timer address in the “Offset” column of
the T4 data file popup window. Hold the left mouse button down and drag the
address to the “Timer” field in the RTO instruction as shown in Figure 148. A red
box appears in the “Timer” field as soon as you drag the mouse into the window.
This red box turns green when the logical address is properly positioned over the
“Timer” the field in the instruction.

n
ct ,
du nly
io
ro O
ep we
r R vi
e
Fo R

Figure 148: “Timer” Field in RTO Instruction as the Logical Address Target
ot or
F
N

170
Introduction to Programmable Logic
Controllers

5. Release the left mouse button. This assigns the logical address to the timer. A
“W” in the “FW” column of the T4 data file popup window identifies the logical
address as assigned in the project. The completed logical address assignment is
shown in Figure 149.

n
ct ,
du nly
io
ro O
ep we
r R vi
e
Fo R

Figure 149: Completed Logical Address Assignment


ot or
F
N

171
Introduction to Programmable Logic
Controllers

How to Assign or Modify a Time Base and Preset

Two time base settings are available: 0.01 seconds and 1 second. The preset value
can be an integer value between 0 and 32,767. Remember that the time base
multiplied by the preset value determines the time delay interval of the timer.

Changing the Time Base

1. Double click the value in the “Time Base” field. This opens the drop down menu
shown in Figure 150 containing the two time base options.

n
ct ,
du nly
io
ro O
ep we
Figure 150: Time Base Drop Down Menu
r R vi
e
Fo R
ot or
F
N

172
Introduction to Programmable Logic
Controllers

2. Left click the desired time base from the drop down menu. This changes the
time base display as shown in Figure 151.

n
ct ,
du nly
io
Figure 151: New Time Base Selected

ro O
3. Press the ENTER key on the keyboard, or left click the mouse pointer
somewhere in the ladder display in order to move the cursor from the “Time
Base” field. This enters the new time base into the timer. Note that if you press
ep w
the ENTER key, the cursor automatically moves down to the “Preset” field for you
to change the preset value as illustrated in Figure 152.
e
r R vi
e
Fo R
ot or
F

Figure 152: New Time Base Entered


N

173
Introduction to Programmable Logic
Controllers

Changing the Timer Preset

1. Double click the value in the “Preset” field. This opens the field for editing as
illustrated in Figure 152.

2. Enter the new value for the preset using the keyboard as shown in Figure 153.
This value should be an integer (which is a number that does not have a decimal
point) between 0 and 32767. However, if you enter zero as a preset then your
timer will not provide a delay.

n
ct ,
du nly
io
ro O
ep w
Figure 153: New Value Typed into “Preset” Field
e
r R vi

3. Left click the mouse in a blank area of the ladder logic. This enters the new
preset into the timer as shown in Figure 154.
e
Fo R
ot or
F

Figure 154: New Preset Entered


N

174
Introduction to Programmable Logic
Controllers

How to Program the Timer Status Bits

The three timer status bits (timer enabled, timer timing, timer done) provide an
indication of what the timer is doing. The timer status bits are programmed using bit
input and bit output instructions. A specific status bit is linked to an input (XIC)
instruction. The XIC instruction is then programmed to an output (OTE) instruction to
reflect the condition of the status bit.

All three status-bits are programmed in the same manner. This example uses only the
timer timing (TT) status bit to illustrate the process of programming. Any actual program
usage would depend entirely on your application and individual need.

n
ct ,
du nly
1. Insert an XIC instruction at the desired location in the ladder logic. The insertion

io
point depends on how you are going to use the instruction. For this example, the
XIC instruction will energize the OTE instruction at O:000/11. The output will be
on while the timer is timing, and go off when the timer is not timing. The XIC

ro O
instruction and the OTE instruction are both on rung 0002 as illustrated in
Figure 155.
ep we
r R vi
e
Fo R
ot or
F

Figure 155: XIC Instruction Inserted into Ladder Logic


N

175
Introduction to Programmable Logic
Controllers

2. Double click the T4 file from the Data Files folder in the project window of
RSLogix. This opens the T4 data file popup window shown in Figure 156.

n
ct ,
du nly
io
ro O
ep we
r R vi

Figure 156: T4 Data File Popup Window


e
Fo R
ot or
F
N

176
Introduction to Programmable Logic
Controllers

3. Scroll the popup window down until you locate the address of the timer. This
example uses the retentive timer at address T4:61, which is shown in Figure 157.

n
ct ,
du nly
io
ro O
ep we
r R vi
e
Fo R

Figure 157: Timer Address Located in Data File Popup Window


ot or
F
N

177
Introduction to Programmable Logic
Controllers

4. Move the mouse pointer over the “TT” field of timer T4:61. Hold the left mouse
button down and drag the mouse to the XIC instruction. Red boxes appear in the
ladder logic field as soon as you drag the mouse into the ladder window to
indicate valid targets for the logical address assignment. Be sure you drag the
mouse to the correct instruction in the ladder logic or you could overwrite an
existing logical address at some other bit instruction in the program. The red box
over the target XIC instruction turns green when the logical address is properly
positioned as shown in Figure 158.

n
ct ,
du nly
io
ro O
ep we
r R vi
e
Fo R
ot or
F

Figure 158: XIC Instruction as the Logical Address Target


N

178
Introduction to Programmable Logic
Controllers

5. Release the left mouse button. This assigns the logical address of the timer to
the XIC instruction as shown in Figure 159. Notice also the “TT” indication below
the XIC instruction instead of a bit number. This reflects the assignment of the
XIC instruction to the timer timing status bit of timer T4:61. The timer enabled
and timer done status bits carry the abbreviations “EN” and “DN,” respectively, in
place of the “TT” indication.

n
ct ,
du nly
io
Figure 159: Logical Address Assignment Complete

ro O
How to Reset the RTO Accumulator using the RES Instruction
ep w
Do not reset a delay timer-off (TOF) with a reset (RES) instruction. This is
because the RST instruction resets not only the accumulator, but also the
e
done (.DN) and timing (.TT) status bits as well. Resetting the done bit of a
r R vi

TOF instruction is an indication that the timer is done timing, which could
affect the operation of any machine that uses this bit as a trigger.
e
Fo R

1. Left click the TIMER/COUNTER tab on the instruction menu. This displays all of
the timer and counter instructions under the tab as shown in Figure 160. If you
ot or

forget the name of a particular instruction, holding the mouse pointer over the
instruction will display the name in a popup window. The reset instruction is the
one on the right side.
N F

Figure 160: Timer Instruction Icons under TIMER/COUNTER Tab of Instruction


Toolbar

2. Hold the left mouse button down over the RES instruction in the instruction
toolbar.

179
Introduction to Programmable Logic
Controllers

3. Drag the mouse into the ladder window. A series of red boxes appears in the
ladder logic as soon as you drag the mouse into the window. These red boxes,
shown in Figure 161, represent possible positions at which you can place the
instruction. You will also notice that the mouse pointer changes to the RES icon
as soon as the pointer is over the ladder logic. As you move the mouse around
the window, you will see that one of the red boxes changes color from red to
green and contains a small “X” within the box. This green box represents the
point at which the branch will be inserted. In this example, the insertion point for
the instruction is rung 0003. Since the reset is an output instruction, the insertion
point is to the right of the box on the far right side of the rung.

n
ct ,
du nly
io
ro O
ep we
r R vi
e
Fo R
ot or
F

Figure 161: Insertion Point for RES Instruction


N

180
Introduction to Programmable Logic
Controllers

4. Release the left mouse button. This inserts the instruction on rung 0003 as
shown in Figure 162. The small question mark above the instruction field means
that a logical address has not yet been assigned.

n
ct ,
du nly
io
ro O
ep we
r R vi

Figure 162: RES Instruction Inserted into Ladder Logic


e
Fo R

5. Double click question mark in the highlight bar above the RES instruction. This
opens a dialog box, shown in Figure 163, in which the logical address of the
ot or

timer is entered.
N F

Figure 163: Dialog Box for Logical Address Entry

181
Introduction to Programmable Logic
Controllers

6. Type the logical address of the timer. For this example, the RTO at logical
address T4:61 is used as shown in Figure 164. Be sure to include the leading
letter “T” and the colon in the address. An alternative to directly typing the logical
address is opening the T4 data file and dragging the desired timer address to the
RES instruction.

n
ct ,
du nly
Figure 164: Logical Address for the RES Instruction

io
7. Press the ENTER key on the keyboard. This opens a popup for the entry of a

ro O
symbolic address or descriptive comments as shown in Figure 165.
ep we
r R vi
e
Fo R
ot or
F
N

Figure 165: Symbolic Name/Comment Popup Window

182
Introduction to Programmable Logic
Controllers

8. Enter a functional description of the component in the “Edit Description Type”


field and, if desired a symbolic address in the “Symbol” field as illustrated in
Figure 166.

n
ct ,
du nly
io
ro O
ep we
r R vi

Figure 166: Comment and Symbolic Name Information


e

9. Left click the OK button from the bottom of the popup window. This enters the
Fo R

symbolic address and comment with the logical address as shown in Figure 167.
ot or
F
N

Figure 167: Logical Address, Symbolic Address, and Comment

183
Introduction to Programmable Logic
Controllers

PROGRAMMING WITH COUNTERS


Counters are used to keep track of the number of times that a certain event happens.
There are two types of counters: count up and count down. Count-up counters
increment an accumulator for each instance of an event, and count-down counters
decrement an accumulator. Counters are retentive instructions that maintain their
accumulated value regardless of the condition of the input rung. As with the RTO
instruction, the accumulator value of a counter is zeroed using a reset (RES) instruction.
There are two counter instructions available through RSLogix 5:

• Count Up Counter (CTU)

n
ct ,
• Count Down Counter (CTD)

du nly
io
COUNTER OPERATION

ro O
Several parameters define the operation of counters. These parameters include the
following:
ep w
• Counter type (up counter or down counter)
• Counter address
e
• Counter preset value
r R vi

• Counter accumulator value


• Counter status bits
e
Fo R

Counter Type

The type defines how the accumulator value changes as the counter keeps track of the
ot or

triggering events. The up counter increments the accumulator and the down counter
decrements the accumulator. The type also defines how the status bits are used with
F

the counter.
N

184
Introduction to Programmable Logic
Controllers

Count Up Counter (CTU)

The count-up counter is represented by the CTU instruction in the ladder logic. An
example of a CTU instruction is shown in Figure 168.

n
ct ,
du nly
io
Figure 168: CTU Instruction

The CTU instruction counts up over a range of -32,768 to +32,767. The accumulator

ro O
increments by one unit each time the input to the instruction goes from false to true.
When the accumulated value equals or exceeds the preset value, the CTU instruction
ep w
sets the done (DN) status bit. The accumulated value of the counter is retentive. The
accumulator is reset to zero using the reset (RES) instruction.
e
r R vi

Count Down Counter (CTD)

The count-down counter is represented by the CTD instruction in ladder logic. An


e

example of a CTD instruction is shown in Figure 169.


Fo R
ot or
F

Figure 169: CTD Instruction


N

The CTD instruction counts down over a range from +32,767 to -32,768. The
accumulator decrements by one unit each time the input to the instruction goes from
false to true. The done (DN) status bit is set as long as the accumulated value is
greater than or equal to the preset value. The DN bit is reset to zero when the
accumulated value is less than the preset value. The accumulated value of the counter
is retentive. The accumulator is reset to zero using the reset (RES) instruction.

185
Introduction to Programmable Logic
Controllers

Counter Address

Each counter has a unique address in the data table of the PLC-5 memory. Data file C5
is reserved for counters. There is room for 1000 counters in data file C5 numbered from
C5:0 to C5:999. Use the lowest available number when programming a new counter in
order to conserve memory space.

Each counter address references three words of data table memory. One of these
words holds the counter preset value, one word holds the accumulated value, and one
word holds the status bits that are used for output control of the counter.

Counter Preset Value

n
ct ,
du nly
io
The counter preset specifies the target to which the counter is counting. Acceptable
preset values are integer numbers ranging from -32,768 to +32,767, regardless of
whether the counter is counting up or down. You cannot enter a preset value that

ro O
contains a decimal point.

Counter Accumulator Value


ep we
The accumulator stores the current value of the counter. The accumulator either
increments (for up counters) or decrements (for down counters) each time the counter is
r R vi

triggered. The accumulator continues to change with each trigger, even though the
preset value is exceeded.
e
Fo R

Counter Status Bits

There are five status bits in the counter status word. These status bits can be used in
ot or

the ladder program to trigger some event. The processor changes the state of status
bits depending on the condition of the counter. Counters have the following status bits:
F

• Count Up Enable Bit (CU) (bit 15) is set when the rung goes true to indicate that
the counter is enabled as an up counter. The CU bit is reset when the rung goes
false or when reset by a RES instruction.
N

• Count Down Enable Bit (CD) (bit 14) is set when the rung goes true to indicate
that the counter is enabled as a down counter. The CD bit is reset when the rung
goes false or when reset by a RES instruction.

186
Introduction to Programmable Logic
Controllers

• Done Bit (DN) (bit 13) is set by the processor when the accumulated value is
greater than or equal to the preset value. This means that the DN bit is set (on)
for a down counter while a down counter is in the process of counting down to
the preset value. The DN bit is reset (off) for an up counter while the counter is
in the process of counting up to the preset. The done bit is reset when the
accumulated value count is less than the preset value. The done bit is also reset
by the RES instruction.

• Count Up Overflow Bit (OV) (bit 12) is set by the processor to show that the up
counter has exceeded the upper limit of +32,767 and has wrapped around to -
32,768. The CTU instruction continues to count up from there.

n
ct ,
du nly
• Count Down Underflow Bit (UN) (bit 11) is set by the processor to show that the

io
down counter has exceeded the lower limit of -32,768 and has wrapped around
to +32,767. The CTD instruction continues to count down from there.

ro O
All of the bits are reset with a RES instruction that has the same address as the counter
instruction. Wrapping around to -32,768 with a CTU instruction can reset the underflow
ep w
bit, and wrapping around to +32767 with a CTD instruction can reset the overflow bit.
e
USING COUNTER INSTRUCTIONS
r R vi

This section of the module discusses programming with counters. This includes
dragging a counter into a program, and resetting the counter. Creating a counter that
e

counts up and down is also discussed.


Fo R

How to Insert a New Counter into a Program


ot or

A counter is a type of output instruction. This means it is programmed on the right side
of the ladder logic.
F

1. Left click the TIMER/COUNTER tab on the instruction menu. This displays all of
the timer and counter instructions under the tab as shown in Figure 170. If you
forget the name of a particular instruction, holding the mouse pointer over the
instruction will display the name in a popup window.
N

Figure 170: Counter Instruction Icons under TIMER/COUNTER Tab of Instruction


Toolbar

187
Introduction to Programmable Logic
Controllers

2. Hold the left mouse button down over the specific counter instruction in the
instruction toolbar. A CTU instruction (located third from the right side of the
instruction toolbar) is used in the following steps.

3. Drag the mouse into the ladder window. A series of red boxes appears in the
ladder logic as soon as you drag the mouse into the window. These red boxes,
shown in Figure 171, represent possible positions at which you can place the
instruction. You will also notice that the mouse pointer changes to the CTU icon
as soon as the pointer is over the ladder logic. As you move the mouse around
the window, you will see that one of the red boxes changes color from red to
green and contains a small “X” within the box. This green box represents the
point at which the instruction will be inserted. In this example, the insertion point

n
ct ,
du nly
for the instruction is rung 0012. Since the counter is an output instruction, the

io
insertion point is to the right of the box on the far right side of the rung.

ro O
ep we
r R vi
e
Fo R
ot or
F
N

Figure 171: Insertion Point for CTU Instruction

188
Introduction to Programmable Logic
Controllers

4. Release the left mouse button. This inserts the instruction on rung 0012 as
shown in Figure 172. The small question mark in the “Counter” field means that
an address has not yet been assigned to the instruction.

n
ct ,
du nly
io
ro O
ep we
r R vi
e
Fo R

Figure 172: CTU Instruction Inserted into Ladder Logic


ot or
F
N

189
Introduction to Programmable Logic
Controllers

How to Assign or Modify a Counter Address

Timer addresses are entered in the “Counter” field of the instruction. This address links
the counter to a specific location in the C5 data file.

There is more than one way to assign an address to a counter. The example searches
for an unused address in the C5 data file and then assigns that address to the counter
by typing it into the “Counter” field of the instruction.

1. Double click the C5 file from the Data Files folder in the project window of
RSLogix. This opens the C5 data file popup window shown in Figure 173.

n
ct ,
du nly
io
ro O
ep we
r R vi
e
Fo R
ot or

Figure 173: C5 Data File Popup Window


N F

190
Introduction to Programmable Logic
Controllers

2. Left click the USAGE button from the bottom of the data table window. This
changes the display to reflect the logical address usage as shown in Figure 174.
Counter addresses are indicated under the “Offset” column. A “W” in the column
labeled “FW” indicates counters that are already used in a program.

n
ct ,
du nly
io
ro O
ep we
Figure 174: Counter Usage
r R vi

3. Scroll the data file window down, if necessary, to locate an unused counter.
e

Since there are already several available counters in the window, this example
Fo R

uses timer C5:2 as shown in Figure 174.


ot or

4. Double click the “Counter” field from the counter instruction whose logical
address is being assigned. This opens a dialog box, shown in Figure 175, in
which the logical address of the counter is entered.
N F

Figure 175: Dialog Box for Logical Address Entry

191
Introduction to Programmable Logic
Controllers

5. Type the first letter of the logical address of the counter, which in this example is
the letter “C.” This opens a small popup menu shown in Figure 176 from which
you can select from a list of instruction types and other instructions beginning
with that letter.

n
ct ,
du nly
io
ro O
Figure 176: Instruction Type Popup Menu
ep w
6. Double click the “C, Counter” instruction type from the popup menu. This opens
another popup menu, shown in Figure 177, that shows the available logical
e
addresses for the counter. The entry in the list is that of the first open C5 data
r R vi

file address, C5:2, which is what is being assigned in this example.


e
Fo R
ot or
F

Figure 177: Logical Address Popup Menu


N

192
Introduction to Programmable Logic
Controllers

7. Double click the “5:2” entry from the popup menu, then left click the mouse
anywhere in an open area of the ladder logic. This assigns the logical address
for the counter as shown in Figure 178.

n
ct ,
du nly
Figure 178: Completed Logical Address Assignment

io
How to Assign or Modify a Preset Value at the Instruction

ro O
1. Double click the value in the “Preset” field. This opens the field for editing as
illustrated in Figure 179.
ep we
r R vi
e
Fo R
ot or

Figure 179: “Preset” Field Open for Editing


N F

193
Introduction to Programmable Logic
Controllers

2. Enter the new value for the preset using the keyboard as shown in Figure 180.
Acceptable preset values are integer numbers ranging from -32,768 to +32,767,
regardless of whether the counter is counting up or down. You cannot enter a
preset value that contains a decimal point.

n
ct ,
du nly
io
Figure 180: New Value Typed into “Preset” Field

3. Left click the mouse in a blank area of the ladder logic. This enters the new

ro O
preset into the counter as shown in Figure 181.
ep we
r R vi
e
Fo R

Figure 181: New Preset Entered


ot or
F
N

194
Introduction to Programmable Logic
Controllers

How to Assign or Modify a Preset Value using the C5 Data File

1. Double click the C5 file from the Data Files folder in the project window of
RSLogix. This opens the C5 data file popup window shown in Figure 182.

n
ct ,
du nly
io
ro O Figure 182: C5 Data File Popup Window
ep we
r R vi
e
Fo R
ot or
F
N

195
Introduction to Programmable Logic
Controllers

2. If necessary, scroll the data file window down to the counter being changed. This
example uses counter at logical address C5:2.

3. Double click the value in the “PRE” field for the counter whose preset value is
being changed. This opens a dialog box, shown in Figure 183, in which to enter
the logical address of the timer.

n
ct ,
du nly
io
ro O
ep we
Figure 183: Preset Field Open for Editing
r R vi
e
Fo R
ot or
F
N

196
Introduction to Programmable Logic
Controllers

4. Type the new preset value into the “pre” field then press the enter key on the
keyboard. This enters the new preset value into the data file. The change is also
reflected at the counter as shown in Figure 184.

n
ct ,
du nly
io
ro O Figure 184: New Preset Value Entered
ep we
r R vi
e
Fo R
ot or
F
N

197
Introduction to Programmable Logic
Controllers

How to Create an Up/Down Counter

A counter that counts up and counts down can be created with a CTU instruction and a
CTD instruction that have the same logical address. This allows both counters to share
the same preset, accumulator, and status bits. When the CTU rung goes true, the
accumulator value will increase and when the CTD rung goes true, the same
accumulator value will decrease. It is important to discriminate between the inputs to
the two different counters. Poor programming could cause both counters to try to count
up and count down at the same time. The ladder logic in Figure 185 shows how the
count up/count down counters are programmed.

n
ct ,
du nly
io
ro O
ep we
r R vi
e
Fo R
ot or

Figure 185: Count Up/Count Down Ladder Logic


N F

198
Introduction to Programmable Logic
Controllers

TROUBLESHOOTING
This section introduces a variety of tools available through RSLogix that enable you to
quickly locate and isolate problems. These tools allow you to search for specific
instructions; override, or force bit inputs and outputs in the ladder logic; and trend the
flow of information almost anywhere in a project.

SYSTEMATIC TROUBLESHOOTING
The following steps outline a systematic method of locating and isolating control system
faults. Keep in mind that the majority of problems will be in the plant, not in a PLC

n
ct ,
program.

du nly
io
1. Locate the output in the ladder logic that is not energizing.

ro O
2. Trace the output backwards across the rung to the input instruction that is
breaking logical continuity.
ep w
3. Right click the mouse over the input instruction that is breaking continuity and
select FIND ALL from the popup menu. This displays all instances of the logical
e
address in the Search Results window located at the bottom of the display.
r R vi

4. Left click the instance in the Search Results window where the logical address is
e

attached to an output instruction. This moves the cursor to that instruction in the
ladder logic.
Fo R

5. Repeat from step 1 until you find the “real world” input device causing the
ot or

problem.
N F

199
Introduction to Programmable Logic
Controllers

There are a few exceptions to the systematic troubleshooting process. Make sure none
of these exceptions apply before using the systematic process.

• If the output that is not energizing is located within a subroutine, make sure the
subroutine is actually being called. None of the instructions within a subroutine
will execute until the main program calls the subroutine.

• Make sure the output being investigated is not within an active JMP to LBL zone
or MCR zone. Any instructions within these active zones will be skipped.

• If the address attached to an instruction being investigated is a status bit

n
address, make sure to search for the full address and not the status bit address

ct ,
du nly
(For example, instead of searching for T4:0/TT, search for T4:0 because a timer

io
is an output instruction).

CLEARING PROCESSOR MEMORY

ro O
Clearing processor memory removes any program currently running on the processor,
ep w
and switches the processor offline. You must be online with the processor with the
processor in program mode before you can clear memory. You will then have to
e
download a project to the processor to resume operation.
r R vi
e
Fo R
ot or
F
N

200
Introduction to Programmable Logic
Controllers

How to Clear Processor Memory

Clearing memory erases any project that is currently running on the


processor. This will stop production if the line is operating normally.

1. Go online with the processor whose memory is being cleared.

2. Open the on-line drop down menu as shown in Figure 186.

n
ct ,
du nly
io
ro O
ep we
r R vi
e
Fo R

Figure 186: On-Line Drop Down Menu


ot or

3. Select PROGRAM from the drop down menu. This opens the confirmation
popup window shown in Figure 187.
N F

Figure 187: Change Mode Confirmation Popup Window

201
Introduction to Programmable Logic
Controllers

4. Left click the YES button from the popup window. This switches the processor to
the program mode as indicated by the on-line bar shown in Figure 188.

n
ct ,
du nly
io
ro O
ep w
Figure 188: Processor in Program Mode
e
r R vi

5. Open the Comms drop down menu as shown in Figure 189.


e
Fo R
ot or
F
N

Figure 189: Comms Drop Down Menu

202
Introduction to Programmable Logic
Controllers

6. Select CLEAR PROCESSOR MEMORY from the drop down menu. This opens
the confirmation popup window shown in Figure 190.

Figure 190: Clear Memory Confirmation Popup Window

n
ct ,
du nly
io
7. Left click the OK button from the popup window. This clears processor memory
and takes the processor off line. Another confirmation popup opens asking if you
want to save changes to your program. Make the appropriate selection from the

ro O
confirmation window. You may then go online with the processor or download
another project to the controller.
ep we
r R vi
e
Fo R
ot or
F
N

203
Introduction to Programmable Logic
Controllers

FORCING I/O BITS


Use extreme caution when forcing I/O bits. Forcing a point may cause
sudden or unexpected movement in associated equipment. This could
cause injury to nearby personnel or damage to the equipment.

Forcing I/O turns specific I/O bits on or off and they remain in that state until the force is
removed. A force can be thought of as a software jumper because it allows you to
bypass a device. If an input sensor fails during production, for example, the input could
be forced in the software in order to complete the production run. The faulty sensor can

n
then be replaced during the down turn.

ct ,
du nly
io
ro O
ep we
r R vi
e
Fo R
ot or
F
N

204
Introduction to Programmable Logic
Controllers

RSLogix uses force tables to keep track of the points that are forced in the software.
These force tables, which are similar to data tables, are logically located between the
I/O modules and the image tables. The positioning of the force tables relative to the
image tables is illustrated in Figure 191.

INPUT IMAGE TABLE OUTPUT IMAGE TABLE


0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
00
0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

n
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

ct ,
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

du nly
io
OUTPUT MODULE

INPUT MODULE

ro O
........ ........ ........ .......
. . . . . . . . . . . . . .0 .
........ .......
. . . . . . . . 1. . . . . . .
ep w
1
e
r R vi

INPUT FORCE TABLE OUTPUT FORCE TABLE


e

LOAD
Fo R

PB

I:002 O:003
ot or

01 07
OFF ON
F

Figure 191: Force Table Positioning Diagram

The position of the force tables has a significant impact on the program execution in the
following ways:
N

• Input instructions that examine the input image table are affected by what is in
the input force table.

• Output instructions that control a bit/bits in the output image table do not affect
the output force table.

• Input instructions that examine the output image table cannot be forced.

• Output instructions that control a bit in the input image table cannot be forced.

205
Introduction to Programmable Logic
Controllers

Only live I/O points can be forced (bits that are in an input or an output word). Live I/O
points are those I/O points that are physically attached to and configured in the system.
Forces cannot be applied to timers, counters, binary, or integer bits.

There are two steps involved in forcing a bit in a project. These are:

• Install the force.


• Enable the force.

Forces are installed individually at each instruction in the ladder logic. When you
enable forces, however, all of the forces installed in the project become active at the

n
same time.

ct ,
du nly
io
Forces should be removed from the software when no longer needed. Any
forces that are not removed become active again when forces are enabled.

ro O
ep w
How to Determine the Status of Forces in a Project
e
Always check the status of forces before installing a new force. Enabling
forces with other forces previously installed may cause immediate and
r R vi

unexpected equipment motion.


e
Fo R

The status of forces is displayed in two status lines of the on-line bar as shown in
Figure 192. The upper status line identifies whether a project has forces installed or
not. The bottom status line identifies whether the forces are enabled or disabled.
ot or

Figure 192 illustrates a project with no forces installed.


N F

Figure 192: Force Status Indications

206
Introduction to Programmable Logic
Controllers

The online bar for a project with at least one force installed but not enabled is shown in
Figure 193. The upper force status line indicates “Forces Installed” and the background
color changes from white to green.

n
ct ,
du nly
io
Figure 193: Forces Installed but Not Enabled

The online bar for a project with at least one force installed and enabled is shown in

ro O
Figure 194. The lower force status line indicates “Forces Enabled” and the background
color changes from white to yellow.
ep we
r R vi
e
Fo R
ot or

Figure 194: Forces Installed and Enabled


N F

207
Introduction to Programmable Logic
Controllers

How to Install and Remove a Force Using Popup Menus

Installing a force at one logical address forces the instruction everywhere it


is used in the project.

1. Move the part being forced into the ladder logic display.

2. Install the force. Right click the mouse over the part being forced. This opens
the popup menu shown in Figure 195. The actual menu selections will depend
on the status of the instruction. An instruction that is not already forced, as in this

n
ct ,
du nly
example, has two options: FORCE ON and FORCE OFF located at the bottom of

io
the popup menu.

ro O
ep we
r R vi
e
Fo R
ot or
F
N

Figure 195: Popup Menu with Install Force Selections

208
Introduction to Programmable Logic
Controllers

3. Choose the appropriate selection from the popup menu. Note that forcing an
XIO instruction ON will turn the instruction OFF. Likewise, forcing an XIO
instruction OFF will turn the instruction ON. This example forces ON the input
instruction at address I:000/4. The instruction on rung 0003 is an XIC, and the
instruction on rung 0004 is an XIO. However, both instructions share the same
logical address. Figure 196 illustrates the appearance of an instruction that is
forced ON. The label “ON” appears at the bottom of the part, just to the left of
the bit number. The online bar has been moved into the ladder logic to show
how RSLogix reflects the status of the installed forces.

n
ct ,
du nly
io
ro O
ep we
r R vi

Figure 196: Inputs Forced ON


e
Fo R

4. Enable the force. Left click the mouse over the “Forces Disabled” down-arrow
from the online bar. This opens the drop down menu shown in Figure 197.
ot or
F
N

Figure 197: Drop Down Menu with Enable Force Selection

209
Introduction to Programmable Logic
Controllers

5. Left click ENABLE ALL FORCES. This opens the confirmation popup window
shown in Figure 198.

Figure 198: Enable Forces Confirmation Popup Window

n
ct ,
du nly
io
6. Left click the YES button from the confirmation window. All of the installed forces
in the project now become active as illustrated in Figure 199. The “ON” text
below the instruction changes color from black to red, and a “>” (greater than)

ro O
symbol appears next to the text indicating the part is now forced ON. Highlight
bars also appear on either side of the instruction to reflect the current status, and
ep w
the online bar indicates that forces are enabled in the project. Notice the
difference between the XIO and XIC instructions in Figure 199, even though both
e
parts are forced ON.
r R vi
e
Fo R
ot or
F
N

Figure 199: Forces Enabled

210
Introduction to Programmable Logic
Controllers

7. Remove the force. You may remove any force without first disabling it. This
allows all of the other forces in the project to remain active while you remove only
the forces that are no longer required. The I:000/5 instruction on rung 0003 has
been forced OFF, as shown in Figure 200, to illustrate the response of RSLogix
when selected forces are removed.

n
ct ,
du nly
io
ro O
ep we
r R vi

Figure 200: Multiple Forces in Project


e
Fo R
ot or
F
N

211
Introduction to Programmable Logic
Controllers

8. Right click the mouse over the part whose force is being removed. This opens
the popup menu shown in Figure 201. The actual menu selections will depend
on the status of the instruction. An instruction that is already forced ON, as in
this example, has two options: REMOVE FORCE and FORCE OFF located at
the bottom of the popup menu.

n
ct ,
du nly
io
ro O
ep we
r R vi
e
Fo R
ot or
F

Figure 201: Popup Menu with Remove Force Selections


N

212
Introduction to Programmable Logic
Controllers

9. Select REMOVE FORCE from the popup window. This removes the force from
the selected logical address, but leaves other forces in the project active as
indicated in Figure 202.

n
ct ,
du nly
io
ro O
ep we
Figure 202: Selected Force Removed
r R vi
e
Fo R
ot or
F
N

213
Introduction to Programmable Logic
Controllers

How to Install and Remove a Force Using the Force Tables

Forces can be installed using the two force files located in the Force Files folder of the
Project window as shown in Figure 203. The two force files are labeled O0 (output
force file) and I1 (input force file).

n
ct ,
du nly
io
ro O
ep we
r R vi

Figure 203: Force Files in Project Window


e
Fo R
ot or
F
N

214
Introduction to Programmable Logic
Controllers

1. Double click the O0 (output force file) or I1 (input force file) icon in the Force Files
folder of the Project window. This opens a popup window for the respective force
file. The Output Force File is shown in Figure 204 as an example. A “1” in the
display means that the corresponding logical address is forced ON, and a “0”
means the corresponding address is forced OFF. A “.” (period) represents an
address that is not forced.

n
ct ,
du nly
io
ro O
ep we
r R vi

Figure 204: O0 (Output Force File) Popup Window


e
Fo R
ot or
F
N

215
Introduction to Programmable Logic
Controllers

2. Scroll down in the popup window until you see the address being forced. This
example uses output address O:015/7 as shown in Figure 205.

n
ct ,
du nly
io
ro O
ep we
r R vi

Figure 205: Output Address to Force


e
Fo R

3. Left click the address being forced in the popup window.


ot or
F
N

216
Introduction to Programmable Logic
Controllers

4. Install the force. Type a “1” or a “0” to set the force ON or OFF, respectively, and
then press the ENTER key on the keyboard. The force data is reflected in both
the popup window and at the instruction in the ladder logic as shown in
Figure 206. Notice how the force installation is reflected in the online bar.

n
ct ,
du nly
io
ro O
ep we
Figure 206: Force Installed
r R vi

5. Enable the force. Left click the ENABLE button from the popup window. This
e

opens the confirmation popup window shown in Figure 207.


Fo R
ot or
F

Figure 207: Enable Forces Confirmation Popup Window


N

217
Introduction to Programmable Logic
Controllers

6. Left click the YES button from the confirmation window. All of the installed forces
in the project now become active as illustrated in Figure 208. The “ON” text
below the instruction changes color from black to red, and a “>” (greater than)
symbol appears next to the text indicating the part is now forced ON. All of the
status information in the popup window changes color from black to red,
indicating forces are enabled.

n
ct ,
du nly
io
ro O
ep we
r R vi

Figure 208: Force Enabled


e
Fo R
ot or
F
N

218
Introduction to Programmable Logic
Controllers

7. Remove the force. You may remove any force without first disabling it. This
allows all of the other forces in the project to remain active while you remove only
the forces that are no longer required. Right click the mouse over the address of
the instruction with the force being removed. This opens the popup menu shown
in Figure 209. The actual menu selections will depend on the status of the
instruction. An instruction that is already forced OFF as in this example, has
several options including removing or changing the force at the selected address,
removing all forces, or disabling all forces.

n
ct ,
du nly
io
ro O
ep we
r R vi
e
Fo R

Figure 209: Popup Menu with Remove Force Selections


ot or
F
N

219
Introduction to Programmable Logic
Controllers

8. Select REMOVE FORCE – O:015/7 from the popup menu. This removes the
force from the instruction as shown in Figure 210. The force indication on the
online bar also changes since this was the only force in the software.

n
ct ,
du nly
io
ro O
ep w
Figure 210: Force Removed
e
r R vi
e
Fo R
ot or
F
N

220
Introduction to Programmable Logic
Controllers

CROSS REFERENCING INSTRUCTIONS


The cross-reference report is a list of all instances of a given logical address in the
ladder logic. The cross-reference list, shown in Figure 211, includes the project file
number, rung number, description, and symbolic address of each instruction the project.

n
ct ,
du nly
io
ro O
ep we
r R vi
e
Fo R

Figure 211: Cross Reference Report – Sorted by Address


ot or
F
N

221
Introduction to Programmable Logic
Controllers

How to Open the Cross Reference Report

The cross-reference report opens from either the ladder window or the project window.

From the Ladder Window

1. Scroll the ladder window to the instruction being cross-referenced.

2. Right-click the mouse over the address of the instruction. This opens the popup
menu for the instruction as shown in Figure 212. If you are opening the popup
from an instruction containing multiple data fields, as with the timer in Figure 212,
make sure you highlight the address of the instruction and not some other data

n
ct ,
du nly
field. You will not get the cross-reference option in the popup menu if the mouse

io
is not over the address.

ro O
ep we
r R vi
e
Fo R
ot or
F

Figure 212: Cross Reference Popup Window


N

222
Introduction to Programmable Logic
Controllers

3. Select CROSS REFERENCE from the popup window. This selection will also
indicate the target address of the cross-reference report. The cross-reference
report opens with the target address at the top of the window as shown in
Figure 213.

n
ct ,
du nly
io
ro O
ep we
r R vi

Figure 213: Cross-Reference Report for Address Selected in Ladder Window


e
Fo R
ot or
F
N

223
Introduction to Programmable Logic
Controllers

From the Project Window

1. Open the Data Files folder in the project window. The cross-reference selection
is the first file in the folder as shown in Figure 214.

n
ct ,
du nly
io
ro O
ep we
r R vi
e
Fo R
ot or
F

Figure 214: Data Files Folder Open in Project Window


N

224
Introduction to Programmable Logic
Controllers

2. Double click the CROSS REFERENCE file. This opens the cross-reference
report shown in Figure 215.

n
ct ,
du nly
io
ro O
ep w
Figure 215: Cross Reference Report Open
e
r R vi

3. Scroll the display in the cross-reference report down until the desired address is
in the display.
e
Fo R
ot or
F
N

225
Introduction to Programmable Logic
Controllers

4. Double click the rung number for the instruction. This moves the cursor in the
ladder window over the instruction at the selected rung as shown in Figure 216.

n
ct ,
du nly
io
ro O
ep w
Figure 216: Address in Ladder Window Selected from Cross-Reference Report
e
r R vi
e
Fo R
ot or
F
N

226
Introduction to Programmable Logic
Controllers

DATA TABLE MONITORING


The data table files are all of the files within the Data File folder in the Project window.
Each file contains information specific to the logical addresses contained within the file.
Any data table file can be used to monitor or change the information stored at a specific
address. You can also use the data tables to determine which logical addresses are
used in the ladder logic.

An example of a data table is shown in Figure 217. Each data table consists of a grid of
logical addresses that displays the data stored at each address. The data table also
displays any symbolic address or description associated with a selected address.

n
ct ,
du nly
io
ro O
ep we
r R vi
e
Fo R
ot or
F

Figure 217: Data Table


N

227
Introduction to Programmable Logic
Controllers

How to Open a Data Table

The data tables open from either the ladder window or the project window.

From the Ladder Window

1. Scroll the ladder window to the instruction for which the data table is being
opened.

2. Right-click the mouse over the address of the instruction. This opens the popup
menu for the instruction as shown in Figure 218.

n
ct ,
du nly
io
ro O
ep we
r R vi
e
Fo R
ot or
F

Figure 218: Data Table Popup Window


N

228
Introduction to Programmable Logic
Controllers

3. Select GO TO DATA TABLE from the popup window. This selection will also
indicate the target address of the data table. The data table opens with the
target address highlighted in the as shown in Figure 219.

n
ct ,
du nly
io
ro O
ep we
r R vi
e
Fo R

Figure 219: Data Table for Address Selected in Ladder Window


ot or
F
N

229
Introduction to Programmable Logic
Controllers

From the Project Window

1. Open the Data Files folder in the project window. The data files are listed below
the cross-reference file as shown in Figure 214.

n
ct ,
du nly
io
ro O
ep we
r R vi

Figure 220: Data Files Folder Open in Project Window


e
Fo R
ot or
F
N

230
Introduction to Programmable Logic
Controllers

2. Double click the desired data file. The file type abbreviations are described in
Table 21

Table 21: Data File Type Abbreviations

File File Type Notes


No.
O0 Output image table Bits in this memory area control the status of all outputs.
I1 Input image table Bits in this memory area indicate the status of all inputs.
S2 Status Processor configuration and status report.

n
ct ,
B3 Bit or binary Binary (0 or 1) information.

du nly
T4 Timers Timer information.

io
C5 Counters Counter information.
R6 Control Used for advanced file instructions.
N7 Integer Integer values in the range -32,768 to +32,767.
F8
9 - 999 ro O
Floating-point
User assigned
Numbers containing a decimal point such as 5.6 or 6.2.
User assigned file types as needed. Timers and
ep w
counters may also use these file numbers.
e
Double clicking any abbreviation opens a data file for the corresponding
r R vi

selection. An example of the T4 (timer) data table is shown in Figure 221.


e
Fo R
ot or
F
N

Figure 221: Data Table Open

231
Introduction to Programmable Logic
Controllers

How to Change Values Using a Data Table

1. Open the data table and locate the desired address within the table. The N10
(integer) data table is shown in Figure 222 as an example. Figure 222 shows
address N10:22 contains the value “10” which is being used in a division
instruction.

n
ct ,
du nly
io
ro O
ep we
r R vi
e
Fo R

Figure 222: N10 Data Table for Address N10:22


ot or
F
N

232
Introduction to Programmable Logic
Controllers

2. Left click the mouse over the value in the data table that is being changed.

3. Type the new value. As an example, type “1550” as illustrated in Figure 223.

n
ct ,
du nly
io
ro O Figure 223: New Value in Data Table
ep w
4. Press the ENTER key on the keyboard. This changes the value in the data table,
e
which changes the data at the instruction as shown in Figure 224.
r R vi
e
Fo R
ot or
F
N

Figure 224: Value Changed through Data Table

233
Introduction to Programmable Logic
Controllers

SEARCHING
Search functions allow you to locate specific addresses, data types, or descriptions
within the ladder logic, and then navigate to the various instances returned by the
search. There are a variety of ways to perform a search. These include using popup
menus at the instruction, using drop down menus from the Windows toolbar, and using
specific buttons on the standard toolbar.

How to Search using Popup Menus at an Instruction

1. Right click the mouse over an instruction in the ladder logic. This opens a popup

n
window at the instruction as shown in Figure 225. The output instruction at

ct ,
du nly
logical address O:011/16 is used in this example.

io
ro O
ep we
r R vi
e
Fo R
ot or
F
N

Figure 225: Find All Popup Menu

234
Introduction to Programmable Logic
Controllers

2. Select FIND ALL from the popup menu. This opens the Search Results window
at the bottom of the display. The results window, shown in Figure 226, displays
all instances of the address in the project. The results contain the project file
number and rung number of the instruction, and the instruction type.

n
ct ,
du nly
io
Figure 226: Search Results Window for O:011/16

ro O
ep we
r R vi
e
Fo R
ot or
F
N

235
Introduction to Programmable Logic
Controllers

3. Left click any instance in the Search Results window to go to the instruction in
the ladder logic. An example is shown in Figure 227, in which the XIC instruction
of rung 0148 was selected from the Search Results window.

n
ct ,
du nly
io
ro O
ep we
r R vi
e
Fo R
ot or

Figure 227: Going to an Instruction in the Ladder Logic from a Search Result
N F

236
Introduction to Programmable Logic
Controllers

How to Search using Drop Down Menus from the Windows Toolbar

Left click the SEARCH selection from the Windows toolbar located at the top of the
RSLogix window. This opens the Search drop down menu shown in Figure 228. There
are several functions available through the drop down menu including: FIND,
REPLACE, GOTO, FIND NEXT, and FIND PREVIOUS.

n
ct ,
du nly
io
ro O
ep we

Figure 228: Search Drop Down Menu


r R vi
e
Fo R
ot or
F
N

237
Introduction to Programmable Logic
Controllers

Find

Selecting FIND from the Search drop down menu opens the Find popup menu shown in
Figure 229.

n
ct ,
du nly
io
ro O
ep we
r R vi
e

Figure 229: Find Popup Window


Fo R

1. Enter the address or mnemonic of the instruction into the “Find What:” field.
ot or

2. Select the “Direction” as either UP or DOWN. When initiated, the search will
proceed in the selected direction from the current location of the cursor in the
F

ladder logic.

3. Select the “Scope” as either GLOBAL if you want to search all program files in
the project, or LOCAL if you want to restrict the search to the ladder file that is
currently open in the display.
N

4. Selecting the various items in the “Advanced” field allows you to search for more
than one item at a time. You cannot search for a field if it is not checked.

238
Introduction to Programmable Logic
Controllers

5. Left click the FIND NEXT button to search for the next instance of the instruction,
or FIND ALL to locate all instances of the instruction. Selecting FIND ALL opens
the Search Results window at the bottom of the display with all instances of the
instruction. The results of a FIND ALL search are shown in Figure 230.
Selecting any entry from the Search Results window moves the cursor to that
location in the ladder logic.

n
ct ,
du nly
io
ro O
ep we
r R vi
e
Fo R
ot or
F

Figure 230: FIND ALL Search Results


N

239
Introduction to Programmable Logic
Controllers

Replace

Selecting REPLACE from the Search drop down menu opens the Replace popup menu
shown in Figure 231. The functions in the Replace window are similar to that of the
Search window, with the exception of the “Replace With:” field, and the REPLACE and
REPLACE ALL buttons. The search criteria that you enter into the “Find What:” window
will be replaced with the entry in the “Replace With:” field when you start the
replacement function. The REPLACE button replaces only one instance at a time. The
REPLACE ALL button replaces every instance at one time.

n
ct ,
du nly
io
ro O
ep we
r R vi
e
Fo R
ot or

Figure 231: Replace Popup Window


N F

240
Introduction to Programmable Logic
Controllers

Go To

Selecting GOTO from the Search drop down menu opens the popup window shown in
Figure 232. The Go To popup window allows you to quickly find a specific project file;
data table file; rung or address in the ladder logic; or cross-reference report.

n
ct ,
du nly
io
ro O Figure 232: Go To Popup Window
ep w
1. Enter the search criteria into the “Enter program location:” field. RSLogix
e
recognizes the format of the search criteria and will change the “Go to What:”
r R vi

button to match the format of your input. However, you open the cross-reference
report by first clicking the CROSS REFERENCE button. The symbolic name
e

“PL8” is entered as an example of a program location as shown in Figure 233.


The “Go to What:” button automatically changes to ADDRESS/SYMBOL.
Fo R
ot or
F
N

Figure 233: Go To Example

241
Introduction to Programmable Logic
Controllers

2. Left click the GOTO button. This opens the selected file. The Address/Symbol
Editor popup window opens if, as in this example, a symbolic name is entered as
the go to target. The popup window opens with the desired symbol highlighted in
the display as shown in Figure 234.

n
ct ,
du nly
io
ro O
ep w
Figure 234: Address/Symbol Editor Popup Window
e
r R vi

3. Right click the mouse over the selected address to open a popup menu, shown
in Figure 235, with additional options for data manipulation and searching.
e
Fo R
ot or
F
N

Figure 235: Additional Options Available through Popup Menu

242
Introduction to Programmable Logic
Controllers

4. Selecting FIND ALL from the popup menu opens the Search Results window,
which displays all instances of the selected instruction. An example of the
Search Results window is shown in Figure 236. You can select from any entry in
the Search Results window and navigate to that instruction in the ladder logic.
Note that you may have to close the Address/Symbol Editor window, or drag the
window out of the way, to view the ladder logic behind it.

n
ct ,
du nly
io
ro O
ep we
r R vi
e
Fo R
ot or
F

Figure 236: Search Results from Address/Symbol Editor


N

243
Introduction to Programmable Logic
Controllers

How to Search Using the Standard Toolbar

Searches can be performed from the standard toolbar using the search entry box in
combination with the three FIND buttons shown in Figure 237. The FIND buttons are
FIND PREVIOUS, FIND NEXT, and FIND ALL.

n
ct ,
du nly
io
ro O
Figure 237: Search Entry Box and FIND Buttons
ep we
r R vi
e
Fo R
ot or
F
N

244
Introduction to Programmable Logic
Controllers

1. Type the search criteria into the search entry box. The search criteria can be a
specific address (such as B3:000/1) or an instruction type (such as TON or XIC).
Consider an example that searches for a delay timer-on instruction as shown in
Figure 238. Notice that TON is entered for the search criteria, and the current
position of the cursor in the ladder logic is over the TON on rung 0105.

n
ct ,
du nly
io
ro O
ep we
r R vi
e
Fo R

Figure 238: Searching for TON Instruction


ot or
F
N

245
Introduction to Programmable Logic
Controllers

2. Left click FIND NEXT button or FIND PREVIOUS button to search the ladder
logic forward or backward, respectively, for the next instance of the search
criteria. The search proceeds from the current position of the cursor. Figure 239
illustrates the results after selecting FIND NEXT. The cursor has moved from
TON instruction on rung 0105 to the TON instruction on rung 0112.

n
ct ,
du nly
io
ro O
ep we
r R vi
e
Fo R

Figure 239: Result of FIND NEXT for TON Instruction


ot or
F
N

246
Introduction to Programmable Logic
Controllers

3. Left click the FIND ALL button to locate all instances of the selected search
criteria. Selecting FIND ALL opens the Search Results window, shown in
Figure 240, below the display with a list of everything meeting the search criteria.
Selecting any instance of the instruction from the Search Results window moves
the cursor to that location in the ladder logic.

n
ct ,
du nly
io
ro O
ep we
r R vi
e
Fo R
ot or

Figure 240: Result of FIND ALL for TON Instruction


N F

247
Introduction to Programmable Logic
Controllers

HISTOGRAMS
A histogram is a graph of how the data is changing at a particular location in the ladder
logic. A histogram can only be developed for one word address at time. Histogram
data can either be viewed on the display or saved in a file on disk for later analysis. An
example of a histogram is shown in Figure 241.

n
ct ,
du nly
io
ro O
ep we
r R vi
e
Fo R
ot or

Figure 241: Histogram


F

The histogram contains the following components:

• START/STOP buttons: These buttons start or stop the development of the trend
in the lower portions of the window.
N

• Address field: The address contains the address of the word being trended by
the histogram. You may type this directly, or drag an address from a data file.

• Mask field: The mask allows you to inhibit trending of specific bits within a word
of data. The mask is a hexadecimal-format number (FH = 11112, and FFFFH =
11111111111111112). A “1” in the mask allows trending, and a “0” in the mask
inhibits trending.

248
Introduction to Programmable Logic
Controllers

• Radix field: The radix is the base of the number being trended in the top half of
the split window. Selections available through the drop down menu are decimal,
binary, octal, and hexadecimal.

• Time Base field: The time base defines how often the address is examined in
order to build the histogram. The maximum rate of sampling is 10 ms.

• Elapsed Time field: Identifies the time elapsed from when the START button was
pressed. The elapsed time will reset to zero if the histogram is stopped then
restarted.

n
ct ,
Log to File/Log to View: These fields allow you to save to disk or view on the

du nly
display the histogram. When saved to disk the default file name of the histogram

io
is Hist.log. This history log will continue to grow until the hard disk is filled, if the
histogram is selected to run that long.


ro O
Split window display: The upper half of the split window displays the raw data of
the target address, and the lower half is a graphical display of how the data
ep w
changes at each bit within the target.
e
How to Create a Histogram
r R vi

1. Open the Comms drop down menu from the Windows toolbar as shown in
Figure 242.
e
Fo R
ot or
F
N

Figure 242: Comms Drop Down Menu

249
Introduction to Programmable Logic
Controllers

2. Left click HISTOGRAM from the Comms drop down menu. This opens the
Histogram popup window shown in Figure 243.

n
ct ,
du nly
io
ro OFigure 243: Histogram Popup Window
ep we
r R vi
e
Fo R
ot or
F
N

250
Introduction to Programmable Logic
Controllers

3. Enter the target address of the data being sampled in the “Address” field. You
may type the address directly, or drag an address from the ladder logic or data
file as shown in Figure 244.

n
ct ,
du nly
io
ro O
ep we
r R vi
e
Fo R

Figure 244: Entering Target Address


ot or

4. Change the mask, radix, time base, and log destination options as necessary.
N F

251
Introduction to Programmable Logic
Controllers

5. Right click the mouse while the mouse pointer is over the Histogram popup
window. This opens the Histogram Properties popup menu shown in Figure 245.

n
ct ,
du nly
io
ro O
ep we

Figure 245: Histogram Popup Menu


r R vi
e
Fo R
ot or
F
N

252
Introduction to Programmable Logic
Controllers

6. Left click PROPERTIES from the Histogram popup window. This opens the
Histogram Properties popup window shown in Figure 246. You may change the
target destination of the log file if the histogram is being saved to disk, change
graph colors, and assign names to each pen through the Histogram Properties
popup window. Pen names are assigned by left clicking the desired bit, entering
the new name, then pressing the ENTER key on the keyboard. The default
name of “Bit 0” is changed to “Test Bit” in the example shown in Figure 246.

n
ct ,
du nly
io
ro O
ep we
r R vi
e
Fo R
ot or
F

Figure 246: Histogram Properties Popup Window


N

7. Left click the OK button from the Histogram Properties popup window when you
are satisfied with the setup. This closes the window and returns you to the
Histogram window.

253
Introduction to Programmable Logic
Controllers

8. Left click the START button to begin trending. The raw data will scroll in the
upper half of the split window, and the histogram begins building in the lower half
of the window as shown in Figure 247. Notice the label for bit 0 reflects the text
that was entered in the Histogram Properties window.

n
ct ,
du nly
io
ro O
ep we
r R vi

Figure 247: Creating Histogram Trends


e
Fo R

9. Left click the STOP button to halt the histogram.


ot or
F
N

254

You might also like