0% found this document useful (1 vote)
851 views

Programmable Logic Controllers

Uploaded by

Alex Soulchild
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (1 vote)
851 views

Programmable Logic Controllers

Uploaded by

Alex Soulchild
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 14

Programmable Logic

Controllers:
An Emphasis on Design and Application
Second Edition

Kelvin T. Erickson
Missouri University of Science and Technology

Dogwood
Valley
Press, LLC
Copyright © 2011 Dogwood Valley Press, LLC. All rights reserved.
No portion of this book may be reproduced, stored in a retrieval system, or transmitted in
any form or by any means, including electronic, mechanical, photocopying, scanning,
recording or otherwise, except as permitted under the 1976 United States Copyright Act,
without explicit, prior written permission of the publisher except for brief passages
excerpted for review and critical purposes.

This book was set in Times New Roman and printed on acid-free paper.

Printed in the United States of America


ISBN 978-0-9766259-2-6

Dogwood Valley Press, LLC


1604 Lincoln Lane
Rolla, MO 65401
1-573-426-3507
http://www.DogwoodValleyPress.com
10 9 8 7 6 5 4 3 2 1
Dedicated to Fran, Esther, David and Amanda
CONTENTS
Preface vii

Chapter 1 Introduction to PLCs 1


1.1 Introduction 1
1.2 Automatic Control in Manufacturing 1
1.3 Control System Classifications 2
1.4 History of the PLC 6
1.5 PLC Versus Other Technologies 13
1.6 Basic PLC Architecture 15
1.7 Chapter Summary 20
References 20

Chapter 2 Basic Ladder Logic Programming 23


2.1 Introduction 24
2.2 Simple Ladder Logic 24
2.3 Basic Ladder Logic Synbols 29
2.4 Ladder Logic Diagram 38
2.5 PLC Processor Scan 44
2.6 Programming with NC Contact 53
2.7 Start/Stop 54
2.8 Transitional Contacts and Coils 60
2.9 Chapter Summary 66
References 66
Problems 67

Chapter 3 Memory Organization and Addressing 79


3.1 Introduction 80
3.2 IEC 61131-3 Memory Model 80
3.3 Modicon Unity Memory 82
3.4 A-B ControlLogix/CompactLogix Memory 92
3.5 A-B PLC-5 and SLC-500/MicroLogix Memory 99
3.6 Siemens S7 Memory 118
3.7 GE Memory 134
3.8 Chapter Summary 144
References 144
Problems 147
ii Contents

Chapter 4 Input/Output Modules and Installation 155


4.1 Introduction 156
4.2 Discrete Modules 158
4.3 Analog Modules 172
4.4 Specialized Modules 179
4.5 Installation Wiring 184
4.6 Chapter Summary 200
References 200
Problems 203

Chapter 5 Timers and Counters 205


5.1 Introduction 207
5.2 IEC Timers and Counters 207
5.3 Modicon Timers and Counters 208
5.4 A-B ControlLogix Timers and Counters 217
5.5 A-B PLC-5/SLC-500 Timers and Counters 227
5.6 Siemens S7 Timers and Counters 233
5.7 GE Timers and Counters 247
5.8 General Timer and Counter Situations 256
5.9 Examples 257
5.10 Chapter Summary 279
References 280
Problems 281

Chapter 6 Sequential Applications 309


6.1 Introduction 310
6.2 Function Chart 311
6.3 Implementing Function Chart in Ladder Logic 317
6.4 Complicated Reset Operation 340
6.5 Parallel Branching 361
6.6 Key Questions in the Sequential Design Process 371
6.7 Manual and Single-Step Sequential Operation 371
6.8 Transitions When PLC Has No Set/Reset Coils 374
6.9 Chapter Summary 374
References 379
Problems 380

Chapter 7 Comparison and Computation 437


7.1 Introduction 438
7.2 Conversion of Physical Quantity 438
7.3 IEC Comparison and Computation 442
7.4 Modicon Comparison and Computation 443
7.5 A-B ControlLogix Comparison and Computation 455
7.6 A-B PLC-5/SLC-500 Comparison and Computation 463
7.7 Siemens S7 Comparison and Computation 473
7.8 GE Comparison and Computation 485
7.9 Application Caveats 492
7.10 Examples 493
Contents iii

7.11 Chapter Summary 520


References 520
Problems 522

Chapter 8 Other Ladder Logic Blocks 573


8.1 Introduction 573
8.2 Other IEC Function Blocks 575
8.3 Other Modicon Function Blocks 575
8.4 Other ControlLogix Function Blocks 588
8.5 Other PLC-5/SLC-500/MicroLogix Function Blocks 606
8.6 Other Siemens S7 Function Blocks 625
8.7 Other GE Function Blocks 641
8.8 Examples 655
8.9 Chapter Summary 678
References 680
Problems 682

Chapter 9 Other Function Chart Implementations 687


9.1 Introduction 689
9.2 Counter-Based Sequence 689
9.3 Shift Register-Based Sequence 718
9.4 Sequencer Function Blocks 740
9.5 Unstructured Sequence 764
9.6 Chapter Summary 769
References 769
Problems 771

Chapter 10 PID Control 773


10.1 Introduction 776
10.2 Feedback Control Performance 780
10.3 PID Controller 784
10.4 PID Controller Tuning 793
10.5 PID Control Enhancements 813
10.6 Operational Aspects 825
10.7 PLC PID Function Blocks 826
10.8 Examples 848
10.9 Chapter Summary 864
References 864
Problems 866

Chapter 11 Function Block Diagram 879


11.1 Introduction 880
11.2 IEC 61131-3 Function Block Diagram 881
11.3 Modicon Function Block Diagram 884
11.4 ControlLogix Function Block Diagram 887
11.5 Siemens S7 Function Block Diagram 905
11.6 GE PACSystems Function Block Diagram 908
11.7 Examples 910
iv Contents

11.8 Chapter Summary 933


References 933
Problems 935

Chapter 12 Structured Text 941


12.1 Introduction 942
12.2 IEC 61131-3 Structured Text 942
12.3 Modicon Structured Text 951
12.4 ControlLogix Structured Text 951
12.5 PLC-5 Structured Text 953
12.6 Siemens S7 Structured Control Language 955
12.7 GE PACSystems Structured Text 957
12.8 Examples 959
12.9 Chapter Summary 971
References 971
Problems 972

Chapter 13 Instruction List 973


13.1 Introduction 973
13.2 IEC 61131-3 Instruction List 973
13.3 Modicon Instruction List 978
13.4 Siemens S7 Statement List Language 978
13.5 GE Instruction List 982
13.6 Examples 983
13.7 Chapter Summary 991
References 991
Problems 992

Chapter 14 Sequential Function Chart 993


14.1 Introduction 994
14.2 IEC 61131-3 Sequential Function Chart 994
14.3 Modicon Sequential Function Chart 1012
14.4 ControlLogix Sequential Function Chart 1021
14.5 PLC-5 Sequential Function Chart 1029
14.6 Siemens S7 Sequential Function Chart 1037
14.7 Examples 1046
14.8 Chapter Summary 1082
References 1082
Problems 1083

Chapter 15 Troubleshooting 1085


15.1 Introduction 1086
15.2 General Troubleshooting Procedures 1088
15.3 Troubleshooting I/O Modules 1091
15.4 Processor Status Indicators 1099
15.5 Program Problems 1103
15.6 Communication Problems 1105
15.7 Designing for Fault Diagnosis 1107
Contents v

15.8 Chapter Summary 1109


References 1109

Chapter 16 Sensors and Actuators 1111


16.1 Introduction 1113
16.2 Discrete Sensors 1113
16.3 Analog Sensors 1127
16.4 Discrete Actuators 1166
16.5 Analog Actuators 1173
16.6 Chapter Summary 1184
References 1184
Appendix - Thermocouple Conversion Polynomial Coefficients 1186
Problems 1192

Chapter 17 Communication Networks 1199


17.1 Introduction 1201
17.2 Network Protocols 1202
17.3 Ethernet 1209
17.4 Foundation Fieldbus 1210
17.5 CIP-Related Protocols 1213
17.6 PROFIBUS (DP, PA, PROFInet) 1220
17.7 P-NET 1226
17.8 WorldFIP 1229
17.9 INTERBUS 1233
17.10 SwiftNet 1235
17.11 AS-i 1237
17.12 Seriplex 1238
17.13 Modicon Protocols 1240
17.14 Allen-Bradley Proprietary Networks 1242
17.15 GE Proprietary Networks 1244
17.16 Ladder Logic Communication Blocks 1245
17.17 Heartbeat Logic 1274
17.18 Chapter Summary 1276
References 1276

Chapter 18 Human-Machine Interface 1281


18.1 Introduction 1283
18.2 HMI Types 1283
18.3 HMI Panel Design 1287
18.4 Graphical HMI Design 1290
18.5 Graphical HMI Development 1296
18.6 Chapter Summary 1305
References 1305

Chapter 19 Control System Security 1307


19.1 Introduction 1307
19.2 Factory Automation Network Security 1308
19.3 PLC Processor Security 1312
vi Contents

19.4 Chapter Summary 1325


References 1325

Chapter 20 Selecting a PLC 1327


20.1 Introduction 1328
20.2 Selection Factors 1329
20.3 PLC Families 1331
20.4 Chapter Summary 1337
References 1338

Chapter 21 Control Projects 1341


21.1 Introduction 1341
21.2 Typical Control Design Project 1342
21.3 Example Control Requirements Definition 1350
21.4 Standardization 1357
21.5 Testing 1414
21.6 Chapter Summary 1428
References 1428
Problems 1430

Chapter 22 Example Projects 1433


22.1 Introduction 1433
22.2 Coal Handling System 1433
22.3 Multi-Unit Chemical Process 1439
22.4 Chapter Summary 1444
References 1444

Appendix A Number Systems and Conversions 1445

Appendix B Electrical Diagram Symbols 1451

Appendix C Piping and Instrumentation Diagram (P&ID) Symbols 1454

Glossary 1457

Index 1473
PREFACE
The field of automatic control has been undergoing a transformation over the past
twenty years. Twenty years ago, the engineering undergraduate had a course in feedback
control theory and those interested in control engineering secured a position in the
aerospace or chemical industries. Due to various factors, the number of control engineering
positions in the aerospace industry has been declining, but the number of control
engineering positions in manufacturing has been dramatically increasing to the point that
the majority of control engineering positions is now in manufacturing and involves PLCs.
This book presents the subject of programming industrial controllers, called
programmable logic controllers (PLCs) with an emphasis on the design of the programs.
Many texts teach one how to program the PLC in its languages, but little, if any, attention is
paid to how does one attack the problem: “Given a set of operational specifications, how
does one develop the PLC program?” This book develops the design process: the tasks
involved, breaking the program into manageable pieces, standard code for the various parts,
and handling the sequential parts of the problem. The emphasis is toward those who will be
programming PLCs.
Because of its popularity (now and in the future), ladder logic is the language that is
used for the majority of the text. The industry trend is toward using the IEC 61131-3
(formerly IEC 1131-3) standard, and so it is the primary language. However, IEC 61131-3
is only a voluntary standard and individual manufacturers have some freedom in the
implementation. Therefore, the Allen-Bradley ControlLogix, Modicon, Siemens S7, and
GE implementations of the 61131-3 standard are covered. Because of their large installed
base, the Allen-Bradley PLC-5/SLC-500 PLC languages are also covered.
Due to the limitations of ladder logic, the IEC 61131-3 standard defines four other
languages: function block diagram, structured text, instruction list, and sequential function
chart. These four languages will become more popular in the future. Therefore, this text also
covers these languages.
Since a typical manufacturing plant may contain discrete, continuous, and batch
processes, all of these applications are treated in this text, although the emphasis is on
discrete and continuous processes. The emphasis is on a methodology that can be applied to
any automation project, regardless of the size.
Throughout, the book contains example problems demonstrating good design practice.
In addition, these problems are solved with each PLC covered in the book. The text
culminates in two full-length case studies where the application of the design techniques to
a large problem is illustrated.
This book takes a practical approach to the design of PLC control systems. Some
mathematical theory is used to backup the presentation on PID controllers. However, the
theory is not detailed and can be omitted.
Except for Chapters 1 and 13, every chapter begins with a scenario that reflects the
experience of the author and his colleagues in the challenging world of factory automation.

vii
viii Preface

These scenarios present a small problem and the solution and are intended to illustrate
troubleshooting techniques.

Objectives
The main objectives of this text are to teach:
• PLC programming languages (with emphasis on IEC 61131-3)
• Approach to sequential problems
• Good program design practice
• Simple PID control tuning
• Introduction to sensors and actuators
• Factory communications
• Human-machine interface (HMI) concepts

Content Overview
The book starts by introducing programmable logic controllers (PLCs) and their
distinguishing characteristics. Chapters 2 – 5 cover basic ladder logic programming:
contact, timer, and counter instructions. As part of the basics, the memory structure of the
five particular PLCs and installation topics are treated. Chapter 6 covers ladder logic
program design for sequential applications, probably the most significant contribution of
the text. Chapters 7 and 8 treat computation, comparison, and advanced ladder logic
instructions. Alternate sequential implementations in ladder logic are covered in Chapter 9
and PID controller tuning is covered in Chapter 10. Chapters 11 – 14 cover the other four
IEC programming languages: function block diagram, statement list, instruction list, and
sequential function chart. PLC troubleshooting is covered in Chapter 15. Sensors and
actuators appear in Chapter 16. Chapter 17 introduces factory communication networks.
Operator interface, often called human-machine interface (HMI), issues are treated in
Chapter 18. Control system security is addressed in Chapter 19 and PLC selection is
introduced in Chapter 20. Chapter 21 presents the perspective of an entire automation
project, bringing together the various pieces of PLC control design. Chapter 22 outlines two
full-length project case studies. One case study is for a process that is primarily discrete and
the other case study is for a process that is primarily continuous in nature. Details about
number systems and drawing symbols are included as appendices, rather than interrupt the
flow of the text material.

The Audience
This book primarily serves the academic market, at the junior or senior undergraduate
electrical, mechanical, or industrial engineering or engineering technology level. This text
is also suitable for the two-year technical school market. There is nothing in the material
that requires a college degree, though the material will be more challenging than the typical
PLC textbook for this level of student.
In addition, this text serves the professional market. Economic and regulatory pressures
in the manufacturing, chemical, petrochemical, pharmaceutical, and food industries have
forced control engineers to design new systems or retrofit existing control systems. Hence,
there are many control engineers (primarily chemical and electrical) who need to rapidly
Preface ix

educate themselves in an area of technology in which they are probably only somewhat
familiar. This book is valuable to this audience.

Second Edition
The second edition primarily updates the Modicon, Siemens, and GE controllers to the
current processors, but there are other changes throughout. The Modicon sections focus on
the Modicon Unity processors. For the older Modicon Quantum/Momentum processors,
see the first edition of this text. The Allen-Bradley material has been updated to focus on the
ControlLogix processor, though the PLC-5/SLC-500/MicroLogix processors are also
covered. Coverage of the ControlLogix add-on instruction (AOI) has been added. The
Siemens S7-1200 has been added to the Siemens sections and the material on the
S5-compatible timers and counters has been removed. The GE PACSystems processor has
been added and the material focuses on this processor with references to the earlier
processors as appropriate. The PLC history in Chapter 1 has been updated. In Chapter 2, the
section about converting relay logic to ladder logic has been removed and replaced with a
section on using the transitional contacts and coils. The examples in sections 9.2, 11.7 and
21.4 now utilize user-defined data types and user-defined function blocks. In addition, all of
the chapter problems have been replaced with new problems. Lastly, the accompanying CD
contains the PLC projects for each example problem and has an additional set of solved
problems.

Acknowledgements
The author wishes to acknowledge the beneficial suggestions and comments of many
colleagues. Steve Ingracia provided the sample panel specification in Chapter 4. Bill
Bichler, Dean Ford, and Esther Erickson reviewed drafts of the first edition of this book and
provided many suggestions and corrections to improve the final product. Ken Ball provided
more information on the history of the PLC and John Crabtree provided helpful suggestions
for the second edition. I especially thank Esther and Fran Erickson for correcting the entire
manuscript for grammatical errors, and Fran for doing the initial typesetting.
Portions of this material were taught in industrial short courses and university courses
and the students are acknowledged for their help in pointing out errors in the text and where
the presentation was unclear.
The following are trademarks or registered trademarks of Schneider Electric: 984,
BP85, Concept, FactoryCast, M340, Modbus, Modbus Plus, Modicon, Momentum, PL7,
Preventa, Quantum, TSX Micro, Twido, and Unity. The following are trademarks or
registered trademarks of Rockwell Automation and its various subsidiaries: Allen-Bradley,
CompactLogix, ControlLogix, Data Highway Plus, DH+, FlexLogix, Guard I/O,
GuardPLC, MicroLogix, Logix 5000, Pico, PLC-2, PLC-3, PLC-5, PLC-5/11, -5/12, -5/20,
-5/20C, -5/20E, -5/26, -5/40E, -5/46, -5/80E, -5/86, Point I/O, Rockwell Automation,
Rockwell Software, RSLinx, RSLogix 5, RSLogix 500, RSLogix 5000, RSNetWorx, SLC,
SLC-500 and SoftLogix. SIMATIC is a registered trademark of Siemens AG. The
following are trademarks of GE Intelligent Plarforms: CIMPLICITY, Logicmaster,
PACSystems, Series 90, VersaMax, and VersaPro. Foundation is a trademark of Fieldbus
Foundation. ControlNet is a trademark of ControlNet International, Ltd. DeviceNet is a
trademark of the Open DeviceNet Vendors Association (ODVA). PROFIBUS and
PROFInet are registered trademarks of Profibus Nutzerorganisation, e.V. P-NET is a
x Preface

registered trademark of the International P-NET User Organization. Seriplex is a registered


trademark of the Square D Company. Ethernet is a trademark of Digital Equipment
Corporation, Intel, and Xerox Corporation. Ethernet/IP is a trademark of ControlNet
International under license by ODVA. SERCOS interface is a trademark of the Interests
Group SERCOS interface e.V. (IGS). VisSim is a registered trademark of Visual Solutions,
Inc., Westford, Massachusetts. MATLAB and SIMULINK are registered trademarks of
The Mathworks, Inc., Natick, Massachusetts. Microsoft, Windows, and Visual Basic are
registered trademarks of Microsoft Corporation. NFPA 70, NFPA 70E, and National
Electrical Code are registered trademarks of the National Fire Protection Association.

Disclaimer
Information furnished herein is believed to be accurate and reliable; however no
responsibility is assumed for any errors. The user assumes full responsibility for the
accuracy and appropriateness of this information.

You might also like