Programmable Controllers 075065757X-ch000-prelims.fm Page i Saturday, June 28, 2003 4:46 PM In memory of Arthur Parr, 1913–1992. Man is still the most extraordinary computer of all. John F. Kennedy 21 May 1963 075065757X-ch000-prelims.fm Page ii Saturday, June 28, 2003 4:46 PM Programmable Controllers An engineer’s guide Third edition E.A. Parr, MSc, CEng, MIEE, MInstMC AMSTERDAM BOSTON HEIDELBERG LONDON NEW YORK OXFORD PARIS SAN DIEGO SAN FRANCISCO SINGAPORE SYDNEY TOKYO Newnes 075065757X-ch000-prelims.fm Page iii Saturday, June 28, 2003 4:46 PM Newnes An imprint of Elsevier Linacre House, Jordan Hill, Oxford OX2 8DP 200 Wheeler Road, Burlington, MA 01803 A division of Reed Educational and Professional Publishing Ltd A member of the Reed Elsevier plc group First published 1993 Second edition 1999 Third edition 2003 Copyright © E.A. Parr 1993, 1999, 2003. All rights reserved. The right of E.A. Parr to be identified as the author of this work has been asserted in accordance with the Copyright, Designs and Patents Act 1988 No part of this publication may be reproduced in any material form (including photocopying or storing in any medium by electronic means and whether or not transiently or incidentally to some other use of this publication) without the written permission of the copyright holder except in accordance with the provisions of the Copyright, Designs and Patents Act 1988 or under the terms of a licence issued by the Copyright Licensing Agency Ltd, 90 Tottenham Court Road, London, England W1T 4LP. Applications for the copyright holder’s written permission to reproduce any part of this publication should be addressed to the publishers British Library Cataloguing in Publication Data A catalogue record for this book is available from the British Library ISBN 0 7506 5757 X Typeset by Integra Software Services Pvt. Ltd, Pondicherry, India www.integra-india.com Printed and bound in Great Britain For information on all Newnes publications visit our website at: newnespress.com 075065757X-ch000-prelims.fm Page iv Saturday, June 28, 2003 4:46 PM Contents Preface xi 1 Computers and industrial control 1 1.1 Introduction 1 1.2 Types of control strategies 1 1.2.1 Monitoring subsystems 2 1.2.2 Sequencing subsystems 2 1.2.3 Closed loop control subsystems 4 1.2.4 Control devices 5 1.3 Enter the computer 6 1.3.1 Computer architectures 7 1.3.2 Machine code and assembly language programming 11 1.3.3 High level languages 11 1.3.4 Application programs 14 1.3.5 Requirements for industrial control 14 1.3.6 The programmable controller 18 1.4 Input/output connections 21 1.4.1 Input cards 21 1.4.2 Output connections 22 1.4.3 Input/output identification 28 1.5 Remote I/O 29 1.6 The advantages of PLC control 31 075065757X-ch000-prelims.fm Page v Saturday, June 28, 2003 4:46 PM vi Contents 2 Programming techniques 33 2.1 Introduction 33 2.2 The program scan 36 2.3 Identification of input/output and bit addresses 40 2.3.1 Racks, cards and signals 40 2.3.2 Allen Bradley PLC-5 41 2.3.3 Siemens SIMATIC S5 42 2.3.4 CEGELEC GEM-80 42 2.3.5 ABB Master 45 2.3.6 Mitsubishi F2 47 2.3.7 Internal bit storage 48 2.4 Programming methods 48 2.4.1 Introduction 48 2.4.2 Ladder diagrams 49 2.4.3 Logic symbols 52 2.4.4 Statement list 55 2.5 Bit storage 58 2.6 Timers 63 2.7 Counters 67 2.8 Numerical applications 72 2.8.1 Numeric representations 72 2.8.2 Data movement 75 2.8.3 Data comparison 77 2.8.4 Arithmetical operations 78 2.9 Combinational and event-driven logic 81 2.9.1 Combinational logic 81 2.9.2 Event-driven logic 86 2.10 Micro PLCs 95 2.11 IEC 1131-3, towards a common standard 99 2.12 Programming software 105 2.13 Programming software tools 109 3 Programming style 115 3.1 Introduction 115 3.2 Software engineering 116 3.3 Top-down design 118 075065757X-ch000-prelims.fm Page vi Saturday, June 28, 2003 4:46 PM Contents vii 3.4 Program structure in various PLCs 119 3.5 Housekeeping and good software practice 128 3.6 Speeding up the PLC scan time 135 4 Analog signals, closed loop control and intelligent modules 140 4.1 Introduction 140 4.2 Common analog signals 140 4.2.1 Temperature 140 4.2.2 Pressure 142 4.2.3 Flow 144 4.2.4 Speed 146 4.2.5 Weighing systems 146 4.2.6 Level 147 4.2.7 Position 148 4.2.8 Output signals 149 4.3 Signals and standards 149 4.4 Analog interfacing 151 4.4.1 Resolution 151 4.4.2 Multiplexed inputs 152 4.4.3 Conversion times 153 4.4.4 Channel selection and conversion to engineering units 156 4.4.5 Analog input cards 158 4.4.6 Filtering 160 4.5 Analog output signals 160 4.6 Analog-related program functions 163 4.7 Closed loop control 164 4.7.1 Introduction to control theory 164 4.7.2 Stability and loop tuning 167 4.7.3 Closed loop control and PLCs 168 4.8 Specialist control processors 172 4.9 Bar codes 173 4.10 High-speed counters 178 4.11 Intelligent modules 178 4.12 Installation notes 179 075065757X-ch000-prelims.fm Page vii Saturday, June 28, 2003 4:46 PM viii Contents 5 Distributed systems 182 5.1 Parallel and serial communications 182 5.2 Serial standards 185 5.2.1 Introduction 185 5.2.2 Synchronization 185 5.2.3 Character codes 186 5.2.4 Transmission rates 186 5.2.5 Modulation of digital signals 189 5.2.6 Standards and protocols 191 5.2.7 Error control 196 5.2.8 Point to point communication 202 5.3 Area networks 205 5.3.1 Introduction 205 5.3.2 Transmission lines 205 5.3.3 Network topologies 207 5.3.4 Network sharing 209 5.3.5 A communication hierarchy 210 5.4 The ISO/OSI model 212 5.5 Proprietary systems 214 5.5.1 Introduction 214 5.5.2 Allen Bradley Data Highway 215 5.5.3 Gem-80 Starnet, ESP and CORONET 217 5.5.4 Siemens SINEC 218 5.5.5 Ethernet 218 5.5.6 Towards standardization 219 5.5.7 Profibus 223 5.6 Safety and practical considerations 224 5.7 Fibre optics 227 6 The man–machine interface 232 6.1 Introduction 232 6.2 Simple digital control and indicators 234 6.3 Numerical outputs and inputs 236 6.3.1 Numerical outputs 236 6.3.2 Multiplexed outputs 237 6.3.3 Leading zero suppression 240 6.3.4 Numerical inputs 240 6.4 Alarm annunciation 242 075065757X-ch000-prelims.fm Page viii Thursday, July 3, 2003 3:59 PM Contents ix 6.5 Analog indication 247 6.6 Computer graphics 250 6.6.1 Introduction 250 6.6.2 The Allen Bradley Panelview 254 6.6.3 Pixel graphics; the CEGELEC Imagem 256 6.6.4 The Siemens Simatic HMI family 265 6.6.5 Practical considerations 267 6.6.6 Data entry 270 6.7 Message displays 271 6.8 SCADA packages 271 7 Industrial control with conventional computers 276 7.1 Introduction 276 7.2 Bus-based machines 277 7.2.1 Introduction 277 7.2.2 IEEE-488 parallel interface bus 278 7.2.3 Backplane bus systems 281 7.2.4 IBM PC clones 282 7.3 Programming for real time control 285 7.4 Soft PLCs 292 8 Practical aspects 293 8.1 Introduction 293 8.2 Safety 293 8.2.1 Introduction 293 8.2.2 Risk assessment 294 8.2.3 PLCs, computers and safety 296 8.2.4 Emergency stops 308 8.2.5 Guarding 312 8.2.6 Safety legislation 314 8.2.7 IEC 61508 315 8.3 Design criteria 320 8.4 Constructional notes 322 8.4.1 Power supplies 322 8.4.2 Equipment protection 325 8.5 Maintenance and fault finding 331 8.5.1 Introduction 331 8.5.2 Statistical representation of reliability 332 075065757X-ch000-prelims.fm Page ix Saturday, June 28, 2003 4:46 PM x Contents 8.5.3 Maintenance philosophies 335 8.5.4 Designing for faults 337 8.5.5 Documentation 339 8.5.6 Training 344 8.5.7 Fault-finding aids, EDDI and FIMs 348 8.6 Electromagnetic compatibility (EMC) and CE marking 354 8.7 Other programmable devices 359 9 Sample ladder logic 362 9.1 Introduction 362 9.2 One Shot 364 9.3 Toggle action 365 9.4 Alarm annunciator 368 9.5 First order filter 370 9.6 Level control 373 9.7 Linearization 380 9.8 Flow totalization 385 9.9 Scaling 391 9.10 Gray code conversion 394 9.11 BCD to Binary conversion 398 9.12 Binary to BCD conversion 400 9.13 A hydraulic system 403 Appendix Number systems 416 Index 421 075065757X-ch000-prelims.fm Page x Saturday, June 28, 2003 4:46 PM [...]... them (the manufacturers would no doubt disagree!) The guideline is therefore choose a machine that suits you, and do not change manufacturers for purely economic reasons Knowledge, consistency of spares and a good relationship with a manufacturer are very valuable A book like this requires much assistance, and I would like to thank Peter Bark and Dave Wilson of ABB, Adrian Bishop, Bob Hunt, Julian Fielding,... of a manufacturer’s range In ‘previous lives’ I have worked with PLCs from AEG, GE, Landys and Gyr, Modicon, Telemecanique, Texas Instruments and many other companies To these manufacturers I offer my sincere apologies for not giving them more coverage, but to do so would have made a tedious book and masked the application points I have tried to make I could happily use any of these machines, and there... The resultant source file is saved to disk The compiler is loaded from disk and run The source file is loaded from disk Compilation starts (this can take several minutes) If any errors are found go back to step 1 7 An object program is produced which can be saved to disk and/or run If any runtime errors are found, go back to step 1 An interpreted language is much easier to use, and for many applications... installation, consisting of a plant connected to a control system This acts to translate the commands of the human operator into the required actions, and to display the plant status back to the operator At the simplest level, the plant could be an electric motor driving a cooling fan Here the control system would be an electrical starter with protection against motor overload and cable faults The operator... typical analog alarm conditions The operator could be informed of these via warning lamps and an audible alarm A monitoring system often keeps records of the consumption of energy and materials for accountancy purposes, and produces an event/ alarm log for historical maintenance analysis A pump, for example, may require maintenance after 5000 hours of operation 1.2.2 Sequencing subsystems Many processes... safely and economically In recent years a specialist control computer, called a programmable controller, has evolved and revolutionized control engineering by combining computing power and immense flexibility at a reasonable price This book is concerned with the application and use of programmable controllers It is not an instructional book in programming, and is certainly not a comparative guide to... Hanscombe, Hugh Pickard, Jennie Holmes and Hennie Jacobs of Allen Bradley, Peter Backenist, David Slingsby and Stuart Webb of GEC/CEGELEC, Peter Houldsworth, Paul Judge, Allan Norbury, Dickon Purvis, Paul Brett and Allan Roworth of Siemens, and Craig Rousell who all assisted with information on their machines, commented constructively on my thoughts and provided material and photographs My fellow engineers... the value of the controlled PV can be made to track a changing SP The air/gas ratio for a burner can thus be maintained despite changes in the burner firing rate 1.2.4 Control devices The three types of control strategy outlined above can be achieved in many ways Monitoring/alarm systems can often be achieved by connecting plant sensors to displays, indicators and alarm annunciators Sometimes the alarm... assembly language instruction for each machine code instruction 1.3.3 High level languages Assembly language programming is still relatively difficult to write, so ways of writing computer programs in a style more akin to English were developed This is achieved with so-called ‘high level languages’ of which the best known are probably Pascal, FORTRAN and the ubiquitous BASIC (and there are many, many languages:... (ready experience in the engineering or maintenance staff, equipment being supplied by an outside contractor and similar considerations), there are good and bad points with all (the really bad machines left the market years ago) At the Sheerness Steel Company where I work, the plant control is based on about sixty programmable controllers consisting of Allen Bradley PLC 2s and 5s, GEC (now CEGELEC) . of a manufacturer’s range. In ‘previous lives’ I have worked with PLCs from AEG, GE, Landys and Gyr, Modicon, Telemecanique, Texas Instruments and many other. requires much assistance, and I would like to thank Peter Bark and Dave Wilson of ABB, Adrian Bishop, Bob Hunt, Julian Fielding, John Hanscombe, Hugh Pickard,