[Frank D. Petruzella] Programmable Logic Controlle(BookSee.org) PDF

Title [Frank D. Petruzella] Programmable Logic Controlle(BookSee.org)
Author Saul Carrera
Pages 414
File Size 90.2 MB
File Type PDF
Total Downloads 40
Total Views 150

Summary

P ROGR A MM A BLE L OGIC C ONTROLLER S pet10882_fm_i-xviii.indd i 7/30/10 5:56 PM This page intentionally left blank pet10882_fm_i-xviii.indd ii 7/30/10 5:56 PM P ROGR A MM A BLE L OGIC C ONTROLLER S Fourth Edition Frank D. Petruzella pet10882_fm_i-xviii.indd iii 7/30/10 5:56 PM PROGRAMMABLE LOGIC ...


Description

P ROGR A MM A BLE L OGIC C ONTROLLER S

pet10882_fm_i-xviii.indd i

7/30/10 5:56 PM

This page intentionally left blank

pet10882_fm_i-xviii.indd ii

7/30/10 5:56 PM

P ROGR A MM A BLE L OGIC C ONTROLLER S Fourth Edition

Frank D. Petruzella

pet10882_fm_i-xviii.indd iii

7/30/10 5:56 PM

PROGRAMMABLE LOGIC CONTROLLERS Published by McGraw-Hill, a business unit of The McGraw-Hill Companies, Inc., 1221 Avenue of the Americas, New York, NY, 10020. Copyright © 2011 by The McGraw-Hill Companies, Inc. All rights reserved. Previous editions © 1989, 1998, and 2005. No part of this publication may be reproduced or distributed in any form or by any means, or stored in a database or retrieval system, without the prior written consent of The McGraw-Hill Companies, Inc., including, but not limited to, in any network or other electronic storage or transmission, or broadcast for distance learning. Some ancillaries, including electronic and print components, may not be available to customers outside the United States. This book is printed on acid-free paper. 1 2 3 4 5 6 7 8 9 0 DOW/DOW 1 0 9 8 7 6 5 4 3 2 1 0 ISBN 978-0-07-351088-0 MHID 0-07-351088-2 Vice president/Editor in chief: Elizabeth Haefele Vice president/Director of marketing: John E. Biernat Director of Development: Sarah Wood Freelance developmental editor: Kirsten Guidero Editorial coordinator: Vincent Bradshaw Marketing manager: Kelly Curran Lead digital product manager: Damian Moshak Digital development editor: Kevin White Director, Editing/Design/Production: Jess Ann Kosic Project manager: Jean R. Starr Buyer II: Debra R. Sylvester Senior designer: Srdjan Savanovic Senior photo research coordinator: Lori Hancock Photo researcher: Danny Meldung Cover design: George Kokkonas Interior design: Kay Lieberherr Typeface: 11/13 Times Compositor: MPS Limited, A Macmillan Company Printer: R. R. Donnelley Cover credit: Cover Image Used with Permission of Rockwell Automation, Inc. Library of Congress Cataloging-in-Publication Data Petruzella, Frank D. Programmable logic controllers / Frank D. Petruzella. — 4th ed. p. cm. Includes index. ISBN-13: 978-0-07-351088-0 (alk. paper) ISBN-10: 0-07-351088-2 (alk. paper) 1. Programmable controllers. I. Title. TJ223.P76P48 2011 629.8’95—dc22 2010025533 The Internet addresses listed in the text were accurate at the time of publication. The inclusion of a Web site does not indicate an endorsement by the authors or McGraw-Hill, and McGraw-Hill does not guarantee the accuracy of the information presented at these sites.

www.mhhe.com

pet10882_fm_i-xviii.indd iv

7/30/10 5:56 PM

Contents Preface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ix Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . . . . . . xii About the Author . . . . . . . . . . . . . . . . . . . . . . . . . . . . .xiii Walkthrough. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xiv Chapter 1

Programmable Logic Controllers (PLCs): An Overview

1

1.1 Programmable Logic Controllers . . . . . . . . . . . 2 1.2 Parts of a PLC . . . . . . . . . . . . . . . . . . . . . . . . . . 4 1.3 Principles of Operation . . . . . . . . . . . . . . . . . . . 8 1.4 Modifying the Operation . . . . . . . . . . . . . . . . 11 1.5 PLCs versus Computers . . . . . . . . . . . . . . . . . 11 1.6 PLC Size and Application. . . . . . . . . . . . . . . . 12 Review Questions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 Problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 Chapter 2

PLC Hardware Components

2.1 2.2 2.3 2.4 2.5

17

The I/O Section. . . . . . . . . . . . . . . . . . . . . . . . Discrete I/O Modules . . . . . . . . . . . . . . . . . . . Analog I/O Modules . . . . . . . . . . . . . . . . . . . . Special I/O Modules . . . . . . . . . . . . . . . . . . . . I/O Specifications . . . . . . . . . . . . . . . . . . . . . . Typical Discrete I/O Module Specifications . . Typical Analog I/O Module Specifications . . . 2.6 The Central Processing Unit (CPU) . . . . . . . . 2.7 Memory Design . . . . . . . . . . . . . . . . . . . . . . . 2.8 Memory Types . . . . . . . . . . . . . . . . . . . . . . . . 2.9 Programming Terminal Devices . . . . . . . . . . . 2.10 Recording and Retrieving Data. . . . . . . . . . . . 2.11 Human Machine Interfaces (HMIs) . . . . . . . . Review Questions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . Problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

18 22 27 29 32 32 33 33 35 36 37 38 38 40 42

Chapter 3

43

3.1 3.2 3.3 3.4 3.5 3.6 3.7

Number Systems and Codes

Decimal System . . . . . . . . . . . . . . . . . . . . . . . Binary System. . . . . . . . . . . . . . . . . . . . . . . . . Negative Numbers. . . . . . . . . . . . . . . . . . . . . . Octal System . . . . . . . . . . . . . . . . . . . . . . . . . . Hexadecimal System. . . . . . . . . . . . . . . . . . . . Binary Coded Decimal (BCD) System. . . . . . Gray Code . . . . . . . . . . . . . . . . . . . . . . . . . . . .

44 44 46 47 48 48 50

3.8 ASCII Code. . . . . . . . . . . . . . . . . . . . . . . . . . . 3.9 Parity Bit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.10 Binary Arithmetic . . . . . . . . . . . . . . . . . . . . . . Review Questions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . Problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

51 51 51 55 56

Chapter 4

57

Fundamentals of Logic

4.1 4.2

The Binary Concept . . . . . . . . . . . . . . . . . . . . AND, OR, and NOT Functions. . . . . . . . . . . . The AND Function . . . . . . . . . . . . . . . . . . . . . The OR Function. . . . . . . . . . . . . . . . . . . . . . . The NOT Function . . . . . . . . . . . . . . . . . . . . . The Exclusive-OR (XOR) Function. . . . . . . . . 4.3 Boolean Algebra . . . . . . . . . . . . . . . . . . . . . . . 4.4 Developing Logic Gate Circuits from Boolean Expressions . . . . . . . . . . . . . . . 4.5 Producing the Boolean Equation for a Given Logic Gate Circuit . . . . . . . . . . . . . . . . 4.6 Hardwired Logic versus Programmed Logic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.7 Programming Word Level Logic Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . Review Questions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . Problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

58 58 58 59 60 61 61

Chapter 5

71

5.1

Basics of PLC Programming

Processor Memory Organization . . . . . . . . . . Program Files . . . . . . . . . . . . . . . . . . . . . . . . . Data Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.2 Program Scan . . . . . . . . . . . . . . . . . . . . . . . . . 5.3 PLC Programming Languages . . . . . . . . . . . . 5.4 Relay-Type Instructions . . . . . . . . . . . . . . . . . 5.5 Instruction Addressing . . . . . . . . . . . . . . . . . . 5.6 Branch Instructions . . . . . . . . . . . . . . . . . . . . . 5.7 Internal Relay Instructions . . . . . . . . . . . . . . . 5.8 Programming Examine If Closed and Examine If Open Instructions . . . . . . . . . . . . . 5.9 Entering the Ladder Diagram . . . . . . . . . . . . . 5.10 Modes of Operation . . . . . . . . . . . . . . . . . . . . Review Questions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . Problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

63 63 64 67 69 69

72 72 72 76 79 81 84 85 87 88 89 91 92 93

v

pet10882_fm_i-xviii.indd v

7/30/10 5:56 PM

Chapter 6 Developing Fundamental PLC Wiring Diagrams and Ladder Logic Programs

Chapter 9 95

6.1 6.2 6.3 6.4 6.5 6.6

Electromagnetic Control Relays . . . . . . . . . . . 96 Contactors . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97 Motor Starters . . . . . . . . . . . . . . . . . . . . . . . . . 98 Manually Operated Switches . . . . . . . . . . . . . 99 Mechanically Operated Switches . . . . . . . . . 100 Sensors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101 Proximity Sensor . . . . . . . . . . . . . . . . . . . . . . 101 Magnetic Reed Switch. . . . . . . . . . . . . . . . . . 104 Light Sensors. . . . . . . . . . . . . . . . . . . . . . . . . 104 Ultrasonic Sensors . . . . . . . . . . . . . . . . . . . . 106 Strain/Weight Sensors . . . . . . . . . . . . . . . . . . 106 Temperature Sensors . . . . . . . . . . . . . . . . . . . 107 Flow Measurement . . . . . . . . . . . . . . . . . . . . 107 Velocity and Position Sensors . . . . . . . . . . . . 108 6.7 Output Control Devices . . . . . . . . . . . . . . . . 108 6.8 Seal-In Circuits . . . . . . . . . . . . . . . . . . . . . . . 110 6.9 Latching Relays . . . . . . . . . . . . . . . . . . . . . . 111 6.10 Converting Relay Schematics into PLC Ladder Programs. . . . . . . . . . . . . . . . . . . . . . 116 6.11 Writing a Ladder Logic Program Directly from a Narrative Description . . . . . 119 Review Questions. . . . . . . . . . . . . . . . . . . . . . . . . . . . 122 Problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123 Chapter 7 Programming Timers

7.1 Mechanical Timing Relays . . . . . . . . . . . . . . 7.2 Timer Instructions. . . . . . . . . . . . . . . . . . . . . 7.3 On-Delay Timer Instruction . . . . . . . . . . . . . 7.4 Off-Delay Timer Instruction . . . . . . . . . . . . . 7.5 Retentive Timer. . . . . . . . . . . . . . . . . . . . . . . 7.6 Cascading Timers . . . . . . . . . . . . . . . . . . . . . Review Questions. . . . . . . . . . . . . . . . . . . . . . . . . . . . Problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Chapter 8 Programming Counters

8.1 8.2

Counter Instructions . . . . . . . . . . . . . . . . . . . Up-Counter . . . . . . . . . . . . . . . . . . . . . . . . . . One-Shot Instruction. . . . . . . . . . . . . . . . . . . 8.3 Down-Counter. . . . . . . . . . . . . . . . . . . . . . . . 8.4 Cascading Counters . . . . . . . . . . . . . . . . . . . 8.5 Incremental Encoder-Counter Applications . . . . . . . . . . . . . . . . . . . . . . . . . 8.6 Combining Counter and Timer Functions . . . Review Questions. . . . . . . . . . . . . . . . . . . . . . . . . . . . Problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

vi

pet10882_fm_i-xviii.indd vi

125

126 128 129 133 136 140 144 144 149

150 152 155 159 162 165 166 171 171

Program Control Instructions

9.1 9.2 9.3 9.4

Master Control Reset Instruction . . . . . . . . . Jump Instruction . . . . . . . . . . . . . . . . . . . . . . Subroutine Functions . . . . . . . . . . . . . . . . . . Immediate Input and Immediate Output Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . 9.5 Forcing External I/O Addresses . . . . . . . . . . 9.6 Safety Circuitry. . . . . . . . . . . . . . . . . . . . . . . 9.7 Selectable Timed Interrupt . . . . . . . . . . . . . . 9.8 Fault Routine. . . . . . . . . . . . . . . . . . . . . . . . . 9.9 Temporary End Instruction . . . . . . . . . . . . . . 9.10 Suspend Instruction. . . . . . . . . . . . . . . . . . . . Review Questions. . . . . . . . . . . . . . . . . . . . . . . . . . . . Problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Chapter 10

Data Manipulation Instructions

10.1 Data Manipulation . . . . . . . . . . . . . . . . . . . . 10.2 Data Transfer Operations . . . . . . . . . . . . . . . 10.3 Data Compare Instructions . . . . . . . . . . . . . . 10.4 Data Manipulation Programs . . . . . . . . . . . . 10.5 Numerical Data I/O Interfaces . . . . . . . . . . . 10.6 Closed-Loop Control . . . . . . . . . . . . . . . . . . Review Questions. . . . . . . . . . . . . . . . . . . . . . . . . . . . Problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Chapter 11

Math Instructions

11.1 Math Instructions . . . . . . . . . . . . . . . . . . . . . 11.2 Addition Instruction . . . . . . . . . . . . . . . . . . . 11.3 Subtraction Instruction . . . . . . . . . . . . . . . . . 11.4 Multiplication Instruction . . . . . . . . . . . . . . . 11.5 Division Instruction . . . . . . . . . . . . . . . . . . . 11.6 Other Word-Level Math Instructions . . . . . . 11.7 File Arithmetic Operations . . . . . . . . . . . . . . Review Questions. . . . . . . . . . . . . . . . . . . . . . . . . . . . Problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Chapter 12

176

177 180 181 184 187 190 193 194 194 195 196 196 200

201 201 209 213 216 218 222 223 226

227 227 229 230 231 233 235 237 238

Sequencer and Shift Register Instructions

242

12.1 Mechanical Sequencers. . . . . . . . . . . . . . . . . 12.2 Sequencer Instructions . . . . . . . . . . . . . . . . . 12.3 Sequencer Programs . . . . . . . . . . . . . . . . . . . 12.4 Bit Shift Registers . . . . . . . . . . . . . . . . . . . . . 12.5 Word Shift Operations . . . . . . . . . . . . . . . . . Review Questions. . . . . . . . . . . . . . . . . . . . . . . . . . . . Problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

243 245 248 254 260 264 264

Contents

7/30/10 5:56 PM

Chapter 13

PLC Installation Practices, Editing, and Troubleshooting

13.1 13.2 13.3 13.4 13.5 13.6 13.7 13.8 13.9

PLC Enclosures. . . . . . . . . . . . . . . . . . . . . . . Electrical Noise. . . . . . . . . . . . . . . . . . . . . . . Leaky Inputs and Outputs . . . . . . . . . . . . . . . Grounding . . . . . . . . . . . . . . . . . . . . . . . . . . . Voltage Variations and Surges. . . . . . . . . . . . Program Editing and Commissioning. . . . . . Programming and Monitoring . . . . . . . . . . . Preventive Maintenance . . . . . . . . . . . . . . . . Troubleshooting . . . . . . . . . . . . . . . . . . . . . . Processor Module . . . . . . . . . . . . . . . . . . . . . Input Malfunctions . . . . . . . . . . . . . . . . . . . . Output Malfunctions . . . . . . . . . . . . . . . . . . . Ladder Logic Program . . . . . . . . . . . . . . . . . 13.10 PLC Programming Software. . . . . . . . . . . . . Review Questions. . . . . . . . . . . . . . . . . . . . . . . . . . . . Problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Chapter 14

Process Control, Network Systems, and SCADA

14.1 14.2 14.3 14.4 14.5 14.6

Types of Processes . . . . . . . . . . . . . . . . . . . . Structure of Control Systems . . . . . . . . . . . . On/Off Control . . . . . . . . . . . . . . . . . . . . . . . PID Control. . . . . . . . . . . . . . . . . . . . . . . . . . Motion Control . . . . . . . . . . . . . . . . . . . . . . . Data Communications. . . . . . . . . . . . . . . . . . Data Highway . . . . . . . . . . . . . . . . . . . . . . . . Serial Communication . . . . . . . . . . . . . . . . . DeviceNet . . . . . . . . . . . . . . . . . . . . . . . . . . . ControlNet. . . . . . . . . . . . . . . . . . . . . . . . . . . EtherNet/IP . . . . . . . . . . . . . . . . . . . . . . . . . . Modbus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Fieldbus. . . . . . . . . . . . . . . . . . . . . . . . . . . . . PROFIBUS-DP . . . . . . . . . . . . . . . . . . . . . . . 14.7 Supervisory Control and Data Acquisition (SCADA) . . . . . . . . . . Review Questions. . . . . . . . . . . . . . . . . . . . . . . . . . . . Problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Chapter 15

ControlLogix Controllers

Part 1 Memory and Project Organization . . . . . . Memory Layout . . . . . . . . . . . . . . . . . . . . . . Configuration . . . . . . . . . . . . . . . . . . . . . . . . Project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Tasks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

268

269 271 272 272 274 275 276 278 279 279 279 281 281 286 288 288

Part 2

Part 3

291

292 294 296 297 301 303 308 308 308 310 311 311 312 313 313 315 316 317

318 318 318 319 320

Part 4

Part 5

Part 6

Programs . . . . . . . . . . . . . . . . . . . . . . . . . . . . Routines . . . . . . . . . . . . . . . . . . . . . . . . . . . . Tags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Structures . . . . . . . . . . . . . . . . . . . . . . . . . . . Creating Tags . . . . . . . . . . . . . . . . . . . . . . . . Monitoring and Editing Tags . . . . . . . . . . . . Array . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Review Questions . . . . . . . . . . . . . . . . . . . . . Bit-Level Programming . . . . . . . . . . . . . . . Program Scan . . . . . . . . . . . . . . . . . . . . . . . . Creating Ladder Logic . . . . . . . . . . . . . . . . . Tag-Based Addressing . . . . . . . . . . . . . . . . . Adding Ladder Logic to the Main Routine. . Internal Relay Instructions . . . . . . . . . . . . . . Latch and Unlatch Instructions . . . . . . . . . . . One-Shot Instruction. . . . . . . . . . . . . . . . . . . Review Questions . . . . . . . . . . . . . . . . . . . . . Problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . Programming Timers . . . . . . . . . . . . . . . . . Timer Predefined Structure . . . . . . . . . . . . . . On-Delay Timer (TON) . . . . . . . . . . . . . . . . Off-Delay Timer (TOF) . . . . . . . . . . . . . . . . Retentive Timer On (RTO) . . . . . . . . . . . . . . Review Questions . . . . . . . . . . . . . . . . . . . . . Problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . Programming Counters . . . . . . . . . . . . . . . Counters . . . . . . . . . . . . . . . . . . . . . . . . . . . . Count-Up (CTU) Counter. . . . . . . . . . . . . . . Count-Down (CTD) Counter . . . . . . . . . . . . Review Questions . . . . . . . . . . . . . . . . . . . . . Problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . Math, Comparison, and Move Instructions . . . . . . . . . . . . . . . . . . . . . . . . . Math Instructions . . . . . . . . . . . . . . . . . . . . . Comparison Instructions . . . . . . . . . . . . . . . . Move Instructions . . . . . . . . . . . . . . . . . . . . . Review Questions . . . . . . . . . . . . . . . . . . . . . Problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . Function Block Programming . . . . . . . . . . Function Block Diagram (FBD) . . . . . . . . . . FBD Programming . . . . . . . . . . . . . . . . . . . . Review Questions . . . . . . . . . . . . . . . . . . . . . Problems . . . . . . . . . . . . . . . . . . . . . . . . . . . .

353 353 355 357 360 360 361 361 365 371 371

Glossary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 373 Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 385

Contents

pet10882_fm_i-xviii.indd vii

320 321 321 324 325 326 326 328 329 329 330 331 332 334 334 335 336 336 338 338 339 342 344 346 346 347 347 348 350 352 352

vii

7/30/10 5:56 PM

This page intentionally left blank

pet10882_fm_i-xviii.indd ii

7/30/10 5:56 PM

Preface Programmable logic controllers (PLCs) continue to evolve as new technologies are added to their capabilities. The PLC started out as a replacement for hardwired relay control systems. Gradually, various math and logic manipulation functions were added. Today PLCs are the controller of choice for the vast majority of automated processes. PLCs now incorporate smaller cases, faster CPUs, ne...


Similar Free PDFs