practical programmable logic controllers for automation ... · of 6 pocket guides used by ... 15.5...

24
Practical Programmable Logic Controllers for Automation and Process Control

Upload: others

Post on 01-Mar-2021

10 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: Practical Programmable Logic Controllers for Automation ... · of 6 Pocket Guides used by ... 15.5 Profibus 229 15.6 Foundation Fieldbus 233 16 Operator Interfaces 239 16.1 Introduction

Practical Programmable Logic Controllers for Automation and Process Control

Page 2: Practical Programmable Logic Controllers for Automation ... · of 6 Pocket Guides used by ... 15.5 Profibus 229 15.6 Foundation Fieldbus 233 16 Operator Interfaces 239 16.1 Introduction

WHO ARE WE? IDC Technologies is internationally acknowledged as the premier provider of practical, technical training for engineers and technicians. We specialize in the fields of electrical systems, industrial data communications, telecommunications, automation and control, mechanical engineering, chemical and civil engineering, and are continually adding to our portfolio of over 60 different workshops. Our instructors are highly respected in their fields of expertise and in the last ten years have trained over 200,000 engineers, scientists and technicians. With offices conveniently located worldwide, IDC Technologies has an enthusiastic team of professional engineers, technicians and support staff who are committed to providing the highest level of training and consultancy. TECHNICAL WORKSHOPS TRAINING THAT WORKS We deliver engineering and technology training that will maximize your business goals. In today’s competitive environment, you require training that will help you and your organization to achieve its goals and produce a large return on investment. With our ‘training that works’ objective you and your organization will:

• Get job-related skills that you need to achieve your business goals • Improve the operation and design of your equipment and plant • Improve your troubleshooting abilities • Sharpen your competitive edge • Boost morale and retain valuable staff • Save time and money

EXPERT INSTRUCTORS We search the world for good quality instructors who have three outstanding attributes:

1. Expert knowledge and experience – of the course topic 2. Superb training abilities – to ensure the know-how is transferred effectively and quickly to you in

a practical, hands-on way 3. Listening skills – they listen carefully to the needs of the participants and want to ensure that you

benefit from the experience. Each and every instructor is evaluated by the delegates and we assess the presentation after every class to ensure that the instructor stays on track in presenting outstanding courses. HANDS-ON APPROACH TO TRAINING All IDC Technologies workshops include practical, hands-on sessions where the delegates are given the opportunity to apply in practice the theory they have learnt. REFERENCE MATERIALS A fully illustrated workshop book with hundreds of pages of tables, charts, figures and handy hints, plus considerable reference material is provided FREE of charge to each delegate. ACCREDITATION AND CONTINUING EDUCATION Satisfactory completion of all IDC workshops satisfies the requirements of the International Association for Continuing Education and Training for the award of 1.4 Continuing Education Units. IDC workshops also satisfy criteria for Continuing Professional Development according to the requirements of the Institution of Electrical Engineers and Institution of Measurement and Control in the UK, Institution of Engineers in Australia, Institution of Engineers New Zealand, and others.

THIS BOOK WAS DEVELOPED BY IDC TECHNOLOGIES

Page 3: Practical Programmable Logic Controllers for Automation ... · of 6 Pocket Guides used by ... 15.5 Profibus 229 15.6 Foundation Fieldbus 233 16 Operator Interfaces 239 16.1 Introduction

CERTIFICATE OF ATTENDANCE Each delegate receives a Certificate of Attendance documenting their experience. 100% MONEY BACK GUARANTEE IDC Technologies’ engineers have put considerable time and experience into ensuring that you gain maximum value from each workshop. If by lunchtime on the first day you decide that the workshop is not appropriate for your requirements, please let us know so that we can arrange a 100% refund of your fee. ONSITE WORKSHOPS All IDC Technologies Training Workshops are available on an on-site basis, presented at the venue of your choice, saving delegates travel time and expenses, thus providing your company with even greater savings. OFFICE LOCATIONS

AUSTRALIA • CANADA • INDIA • IRELAND • MALAYSIA • NEW ZEALAND • POLAND • SINGAPORE • SOUTH AFRICA • UNITED KINGDOM • UNITED STATES

On-Site Training

All IDC Technologies Training Workshops are available on an on-site basis, presented at the venue of your choice, saving delegates travel time and expenses, thus providing your company with even

greater savings. For more information or a FREE detailed proposal contact Kevin Baker by e-mailing:

[email protected]

[email protected] www.idc-online.com

Visit our website for FREE Pocket Guides IDC Technologies produce a set of 6 Pocket Guides used by

thousands of engineers and technicians worldwide. Vol. 1 – ELECTRONICS Vol. 4 – INSTRUMENTATION Vol. 2 – ELECTRICAL Vol. 5 – FORMULAE & CONVERSIONS Vol. 3 – COMMUNICATIONS Vol. 6 – INDUSTRIAL AUTOMATION

To download a FREE copy of these internationally best selling pocket guides go to:

www.idc-online.com/downloads/

SAVE MORE THAN 50% OFF the per person

cost

CUSTOMISE the training to YOUR WORKPLACE!

Have the training delivered WHEN

AND WHERE you need it!

Page 4: Practical Programmable Logic Controllers for Automation ... · of 6 Pocket Guides used by ... 15.5 Profibus 229 15.6 Foundation Fieldbus 233 16 Operator Interfaces 239 16.1 Introduction

IDC TECHNOLOGIES

Worldwide Offices

AUSTRALIA Telephone: 1300 138 522 • Facsimile: 1300 138 533

West Coast Office

1031 Wellington Street, West Perth, WA 6005 PO Box 1093, West Perth, WA 6872

East Coast Office

PO Box 1750, North Sydney, NSW 2059

CANADA Toll Free Telephone: 1800 324 4244 • Toll Free Facsimile: 1800 434 4045

Suite 402, 814 Richards Street, Vancouver, NC V6B 3A7

INDIA Telephone : +91 444 208 9353

35 4th Street, Kumaran Colony, Vadapalani, Chennai 600026

IRELAND Telephone : +353 1 473 3190 • Facsimile: +353 1 473 3191

PO Box 8069, Shankill Co Dublin

MALAYSIA Telephone: +60 3 5192 3800 • Facsimile: +60 3 5192 3801

26 Jalan Kota Raja E27/E, Hicom Town Center Seksyen 27, 40400 Shah Alam, Selangor

NEW ZEALAND

Telephone: +64 9 263 4759 • Facsimile: +64 9 262 2304 Parkview Towers, 28 Davies Avenue, Manukau City

PO Box 76-142, Manukau City

POLAND Telephone: +48 12 6304 746 • Facsimile: +48 12 6304 750

ul. Krakowska 50, 30-083 Balice, Krakow

SINGAPORE Telephone: +65 6224 6298 • Facsimile: + 65 6224 7922

100 Eu Tong Sen Street, #04-11 Pearl’s Centre, Singapore 059812

SOUTH AFRICA Telephone: +27 87 751 4294 or +27 79 629 5706 • Facsimile: +27 11 312 2150

68 Pretorius Street, President Park, Midrand PO Box 389, Halfway House 1685

UNITED KINGDOM

Telephone: +44 20 8335 4014 • Facsimile: +44 20 8335 4120 Suite 18, Fitzroy House, Lynwood Drive, Worcester Park, Surrey KT4 7AT

UNITED STATES

Toll Free Telephone: 1800 324 4244 • Toll Free Facsimile: 1800 434 4045 7101 Highway 71 West #200, Austin TX 78735

Website: www.idc-online.com

Email: [email protected]

Page 5: Practical Programmable Logic Controllers for Automation ... · of 6 Pocket Guides used by ... 15.5 Profibus 229 15.6 Foundation Fieldbus 233 16 Operator Interfaces 239 16.1 Introduction

Presents

Practical

Programmable Logic Controllers (PLCs) for Automation and Process Control

Revision 4.1

Written by Dinesh Patil B.E. (Instrumentation & Control) 1st Class, Dip Industrial Electronics

Latest Revision by Rodney Jacobs, NH Dip, M Dip Tech, Pr Tech Eng, BA (Hons), D Tech

Website: www.idc-online.com E-mail: [email protected]

Page 6: Practical Programmable Logic Controllers for Automation ... · of 6 Pocket Guides used by ... 15.5 Profibus 229 15.6 Foundation Fieldbus 233 16 Operator Interfaces 239 16.1 Introduction

IDC Technologies Pty Ltd PO Box 1093, West Perth, Western Australia 6872 Offices in Australia, New Zealand, Singapore, United Kingdom, Ireland, Malaysia, Poland, United States of America, Canada, South Africa and India Copyright © IDC Technologies 2013. All rights reserved. First published 2006 All rights to this publication, associated software and workshop are reserved. No part of this publication may be reproduced, stored in a retrieval system or transmitted in any form or by any means electronic, mechanical, photocopying, recording or otherwise without the prior written permission of the publisher. All enquiries should be made to the publisher at the address above. Disclaimer Whilst all reasonable care has been taken to ensure that the descriptions, opinions, programs, listings, software and diagrams are accurate and workable, IDC Technologies do not accept any legal responsibility or liability to any person, organization or other entity for any direct loss, consequential loss or damage, however caused, that may be suffered as a result of the use of this publication or the associated workshop and software.

In case of any uncertainty, we recommend that you contact IDC Technologies for clarification or assistance.

Trademarks All logos and trademarks belong to, and are copyrighted to, their companies respectively. Acknowledgements IDC Technologies expresses its sincere thanks to all those engineers and technicians on our training workshops who freely made available their expertise in preparing this manual.

Page 7: Practical Programmable Logic Controllers for Automation ... · of 6 Pocket Guides used by ... 15.5 Profibus 229 15.6 Foundation Fieldbus 233 16 Operator Interfaces 239 16.1 Introduction

Contents 1 Introduction to the PLC 1

1.1 Introduction 1 1.2 Basic Block Diagram of the PLC 2 1.3 Size of the PLC System 3 1.4 Components of the PLC Systems 3 1.5 PLC and Process Interaction 5 1.6 Number Systems and Codes 8

2 Processors, Power Supply and Programming Devices 13

2.1 Introduction To The PLC Hardware 13 2.2 Processors (CPU) 13 2.3 PLC Power Supply 17 2.4 Programming Device 17

3 Memory System and I/O Interaction 21

3.1 Memory Systems 21 3.2 Digital I/O Interaction 24 3.3 Analog I/O Interaction 26

4 Digital Input/Output Systems 29

4.1 Basics of Discrete I/O Systems 29 4.2 Types of Discrete Field Devices 30 4.3 Types of Discrete Input Modules 31 4.4 Types of Discrete Output Modules 34

5 Analog Input/ Output Systems 39

5.1 Basic of Analog I/O Systems 39 5.2 Types of Analog Field Devices 40 5.3 Types of Analog Input Modules 41 5.4 Types of Analog Output Modules 47

6 Special Function I/O and Serial Communication

Interfacing 53 6.1 Introduction 53 6.2 Fast Response Input Module 54 6.3 Counter Module 55 6.4 Positioning Module 58 6.5 Stepper Motor Positioning Module 61

7 Good Installation Practices 67

7.1 Introduction 67 7.2 PLC Modules 69 7.3 PLC Rack 71 7.4 PLC Panel Internal Wiring 72 7.5 PLC Panel Power Supply 72 7.6 Cabling Between PLC And Field Devices 74

Page 8: Practical Programmable Logic Controllers for Automation ... · of 6 Pocket Guides used by ... 15.5 Profibus 229 15.6 Foundation Fieldbus 233 16 Operator Interfaces 239 16.1 Introduction

7.7 Cabling PLC And Control Room Computers 78 7.8 PLC Earthing 78 7.9 Specific PLC Installation Requirements 81 7.10 Control Room Requirements 83

8 Fundamentals of PLC Programming 87

8.1 Introduction 87 8.2 PLC Programming Steps 89 8.3 Programming Languages 91 8.4 Basic Logic Instructions 101 8.5 Timers 103 8.6 Counter 107 8.7 Program Flow Control Instructions 111 8.8 Data Load and Transfer Instructions 114 8.9 Arithmetic or Math Instructions 117

9 Data Acquisition 123

9.1 Introduction 123 9.2 A Typical Data Acquisition System 123 9.3 Aliasing and the Sampling Theorem 124 9.4 Data Coding System 127

10 Analog and Digital Control 135

10.1 Introduction 135 10.2 Analog Inputs 135 10.3 Signal Filtering 136 10.4 Analog Display 137 10.5 Analog Control 137 10.6 Application of PID Control 139 10.7 Alternative Forms of Analog Control 145

11 Fault Tolerance - Spreading the Risk 147

11.1 How Reliable Is Our Equipment? 147 11.2 Project Planning 147 11.3 Key Questions 147 11.4 Two Key Strategies 147 11.5 The People! 149 11.6 Primary Loop Control and Interlocking 149 11.7 The Field Devices 149 11.8 Communications 149 11.9 DCS Structure 150 11.10 PLC System Options 151 11.11 The Costs 151 11.12 Utilities 151 11.13 Spare PLCs 151 11.14 I/O Allocation 152 11.15 Backing up Current Plant Data 152 11.16 Power Supplies 152

Page 9: Practical Programmable Logic Controllers for Automation ... · of 6 Pocket Guides used by ... 15.5 Profibus 229 15.6 Foundation Fieldbus 233 16 Operator Interfaces 239 16.1 Introduction

12 Peripheral Equipment 153 12.1 Future Directions with Smart Instruments 153 12.2 Highway Addressable Remote Transducer (HART) 154 12.3 ASCII Communications Devices 158 12.4 Intelligent Communication Devices 158

13 Data Communications 159

13.1 Introduction 159 13.2 RS-232 159 13.3 RS-485 164 13.4 Modbus Serial 169

14 Ethernet and TCP/IP 181

14.1 Introduction 181 14.2 10 Mbps Ethernet 181 14.3 100 Mbps Ethernet (‘Fast Ethernet’) 184 14.5 Gigabit Ethernet 185 14.6 Industrial Ethernet 186 14.7 IP (Internet Protocol) 193 14.8 ARP and RARP 203 14.9 TCP 205 14.10 UDP 212

15 Field buses 215

15.1 Background 215 15.2 Plant Automation Hierarchies 216 15.3 HART 218 15.4 DeviceNet 221 15.5 Profibus 229 15.6 Foundation Fieldbus 233

16 Operator Interfaces 239

16.1 Introduction 239 16.2 Ergonomic Considerations 239

17 High Security PLC Systems 247

17.1 Introduction and Terminology 247 17.2 Background to Safety Control Systems 251 17.3 Safety Systems Concepts 251 17.4 Resistance to Random Hardware Failures 260 17.5 Architectures for Safety PLCs 262 17.6 Objections to Standard PLCs Used for Safety 263 17.7 Characteristics of Safety PLCs 267 17.8 Hardware Characteristics of a Safety PLC 267 17.9 Software Characteristics of a Safety PLC 268 17.10 Design Safety PLCs 269 17.11 Redundant Architectures for PLCs- High Availability with

High Integrity 271 17.12 Conclusion of Safety PLCs 276 17.13 Application Software 276 17.14 Safe Networking 277

Page 10: Practical Programmable Logic Controllers for Automation ... · of 6 Pocket Guides used by ... 15.5 Profibus 229 15.6 Foundation Fieldbus 233 16 Operator Interfaces 239 16.1 Introduction

17.15 Classifications and Certification 280 17.16 Summary of High Security PLCs 281

18 System Programming and Implementation 283

18.1 Introduction 283 18.2 Taking Process Inputs 283 18.3 Creating I/O List 284 18.4 Deciding Hardware Configuration of PLC system 286 18.5 I/O Address Assignment 288 18.6 Developing Program Structure 291 18.7 Tips for Developing a PLC Program 293 18.8 Program Verification and Simulation 295 18.9 Creating Documentation 297

19 Best Practice Documentation 299

19.1 What Is a Manual? 300 19.2 Types of Manuals 300 19.3 Planning the Manual 302 19.4 Drafting the Manual 307 19.5 Reviewing the Manual 310

20 HMI (Human Machine Interface) 315

20.1 Introduction 315 20.2 Design Consideration of HMI 317 20.3 Hardware Interface Between PLC and HMI 325 20.4 Software Interface Between PLC and HMI 326

21 Electrical Design and Construction 327

21.1 Introduction 327 21.2 PLC Enclosure 327 21.3 Panel Layout 329 21.4 Electrical Wiring of Panel 331 21.5 Gudielines for Panel Electrial Design 332

22 Functional Specification of the System 335

22.1 Introduction 335 22.2 System Requirement Specification 337 22.3 Function Specification of the System 342 22.4 Hitech Mining 346 22.5 Circulation of the Functional Specification 376 22.6 Checklist of Factors for Selection of an I/O Module 376 22.7 Selection of the System 378 22.8 Testing of the System 379

23 Fuzzy Logic 381 23.1 Introduction 381 23.2 Understanding Fuzzy Logic 382 23.3 The Rules of Fuzzy Logic 383 23.4 Fuzzy Logic Example Using Rules And Patches 385 23.5 The Achilles Heel of Fuzzy Logic 387

Page 11: Practical Programmable Logic Controllers for Automation ... · of 6 Pocket Guides used by ... 15.5 Profibus 229 15.6 Foundation Fieldbus 233 16 Operator Interfaces 239 16.1 Introduction

24 Configuration of the System 389 24.1 Initial Concepts 389 24.2 Training on the System 389 24.3 Input/Output Database Creation 390 24.4 General Database Design Tips 398

25 Installation and Commissioning 399

25.1 Introduction 399 25.2 Control Room MCC Requirements 399 25.3 Installation of Equipment 400 25.4 Loop Testing 400 25.5 Manual Control 400 25.6 Automatic Control 401 25.7 System Handover 401 25.8 Maintenance and Training 402

26 Working Example of PLC Programs 403

26.1 Introduction 403 26.2 Control Philosophy 403 26.3 Typical PLC Program for Drives 405 26.4 Understanding Advanced Programming Techniques 413

Bibliography 419 Appendices

Appendix A Glossary 421 Appendix B ASCII Table 437 Appendix C Number Systems 439 Appendix D Logic Fundamentals 449 Appendix E Practicals: Part 1 453 Appendix F Basic Program 471 Appendix G Functional Logic Diagrams 479 Appendix H Practicals: Part 2 483

Page 12: Practical Programmable Logic Controllers for Automation ... · of 6 Pocket Guides used by ... 15.5 Profibus 229 15.6 Foundation Fieldbus 233 16 Operator Interfaces 239 16.1 Introduction
Page 13: Practical Programmable Logic Controllers for Automation ... · of 6 Pocket Guides used by ... 15.5 Profibus 229 15.6 Foundation Fieldbus 233 16 Operator Interfaces 239 16.1 Introduction

1

Introduction to the PLC

In this chapter, we will learn the following: • Introduction to the PLC • Basic block diagram of the PLC • Size of the PLC system • Components of the PLC system • PLC and process interaction • Number system and codes

1.1 Introduction to the PLC In the past, processes were controlled manually, which was a very tedious job. During the early years of control, man constructed hardware relay wiring to control the same process. However, relays could not meet all the needs of modern times, and a faster solution was required. Simply, when a change of control logic was required, the entire hardware wiring needed to be changed. This was time consuming as well as tiresome. After a lot of toil, man finally designed the PLC. He overcame all the constraints and attained flexibility to carry out the necessary modifications. “PLC” means “Programmable Logic Controller”. The word “Programmable” differentiates it from the conventional hard-wired relay logic. It can be easily programmed or changed as per the application’s requirement. The PLC also surpassed the hazard of changing the wiring. The PLC as a unit consists of a processor to execute the control action on the field data provided by input and output modules. In a programming device, the PLC control logic is first developed and then transferred to the PLC.

Page 14: Practical Programmable Logic Controllers for Automation ... · of 6 Pocket Guides used by ... 15.5 Profibus 229 15.6 Foundation Fieldbus 233 16 Operator Interfaces 239 16.1 Introduction

2 Practical Programmable Logic Controllers (PLCs) for Automation and Process Control

1.1.1 What can a PLC do? • It can perform relay-switching tasks. • It can conduct counting, calculation and comparison of analog process values. • It offers flexibility to modify the control logic, whenever required, in the

shortest time. • It responds to the changes in process parameters within fraction of seconds. • It improves the overall control system reliability. • It is cost effective for controlling complex systems. • Trouble-shooting becomes simpler and faster. • An operator can easily interact with the process with the help of the HMI

(Human-Machine Interface) computer.

1.2 Basic block diagram of the PLC Figure 1.1 shows the basic block diagram of a common PLC system.

Figure 1.1 Block diagram of a PLC

As shown in the above figure, you will find the heart of the “PLC” in the center, i.e., the Processor or CPU (Central Processing Unit).

• The CPU regulates PLC program, data storage, and data exchange with I//O modules.

“I/O Modules” are the second important and basic components of any PLC system.

• Input and output modules are the media for data exchange between field devices and CPU. It tells CPU the exact status of field devices and also acts as a tool to control them.

Page 15: Practical Programmable Logic Controllers for Automation ... · of 6 Pocket Guides used by ... 15.5 Profibus 229 15.6 Foundation Fieldbus 233 16 Operator Interfaces 239 16.1 Introduction

Introduction to the PLC 3

The programming device is the third significant component. • A programming device is a computer loaded with programming software,

which allows a user to create, transfer and make changes in the PLC software.

Memory is the fourth notable component. • Memory provides the storage media for PLC program as well as different

data. 1.3 Size of the PLC system

PLCs are classified on basis of their sizes: • A small system is one with less than 500 analog and digital I/Os. • A medium system has I/Os ranging from 500 to 5,000. • A system with over 5,000 I/Os is considered large.

1.4 Components of the PLC system

Figure 1.2 illustrates a sample PLC system and its components.

Figure 1.2 The main/chief components of a PLC

Page 16: Practical Programmable Logic Controllers for Automation ... · of 6 Pocket Guides used by ... 15.5 Profibus 229 15.6 Foundation Fieldbus 233 16 Operator Interfaces 239 16.1 Introduction

4 Practical Programmable Logic Controllers (PLCs) for Automation and Process Control

This is the actual system. What does it look like? Does it seem difficult to understand? Let us compare Fig. 1.2 component by component with Fig. 1.3, which is its simplified version.

Figure 1.3 Simplified component configuration of a PLC

1) CPU or processor The main processor (Central Processing Unit or CPU) is a microprocessor-based system that executes the control program after reading the status of field inputs and then sends commands to field outputs. It is easy to perform arithmetic functions, manipulate data and calculate Boolean logic. The PLC’s memory contains the manufacturer’s operating system and housekeeping functions. It also has program written by the user and data stored by the user related to the process or equipment being controlled. In Fig. 1.3, the processor module is plugged into the first slot of the central or local rack, which is the normal practice. The CPU card is connected with I/O modules through back-plane connections inside the rack or chassis. Hence, it is possible for the CPU to read the status of all input modules through the data bus. This is called local I/O chassis. If the I/Os are located at remote places, the CPU accesses them through a remote I/O chassis. In such a case, the remote chassis will have a remote I/O communication module. It collects the data from I/O modules and sends it to the CPU through an I/O rack communication link. This is particularly useful when the process is divided up, and located in remote parts.

Page 17: Practical Programmable Logic Controllers for Automation ... · of 6 Pocket Guides used by ... 15.5 Profibus 229 15.6 Foundation Fieldbus 233 16 Operator Interfaces 239 16.1 Introduction

Introduction to the PLC 5

The CPU card has ports for communicating with the programming device as well as the operator’s station. 2) I/O section The I/O section consists of a rack and individual I/O modules, which are plugged into the rack and a DC power supply. A standard approach is to connect to the main processor rack with communication cables to a series of other I/O racks. I/O modules act as “Real Data Interface” between field and PLC CPU. The PLC knows the real status of field devices, and controls the field devices by means of to the relevant I/O cards. Various I/O modules are available. Each one of these will be discussed in more detail in the following sections. 3) Programming device A CPU card can be connected with a programming device through a communication link via a programming port on the CPU. Thus, it is possible to transfer programs from the programming device to the CPU, monitor the CPU’s program online and make necessary changes in the CPU’s program. More details of a programming device will be discussed in the next chapter. 4) Operating station An operating station is commonly used to provide an "Operating Window" to the process. It is usually a separate device (generally a PC), loaded with HMI (Human Machine Software). This operating station can change any process set point, observe all process parameters, process alarms, etc.

1.5 PLC and process interaction

It is very interesting to see how the interaction between the PLC and the process takes place through I/O modules. This section will explain the role of different I/O modules as a part of PLC and process interaction. The field devices or field data are broadly classified as follows:

• Digital or discrete or on/off type field devices • Analog or continuous type field devices

For the sake of simplicity, the first examples of digital type field devices, PLC and process interaction can be studied.

1.5.1 Digital I/O and PLC

Fig. 1.4 shows how different types of digital or discrete field devices are connected to the PLC through digital I/O modules.

Page 18: Practical Programmable Logic Controllers for Automation ... · of 6 Pocket Guides used by ... 15.5 Profibus 229 15.6 Foundation Fieldbus 233 16 Operator Interfaces 239 16.1 Introduction

6 Practical Programmable Logic Controllers (PLCs) for Automation and Process Control

Figure 1.4 Digital I/O process interaction

Discrete or digital inputs are the most common types of field inputs. Selector switches, pushbuttons, limit switches, temperature switches, level switches, flow switches, etc., are common examples. All types of switches that permit digital contact are included in this class. Depending on the field device contacts, they are normally connected to 110VAC, 230V AC and, 24VDC types of digital input cards installed in PLC rack. It is assumed to be 24VDC in Fig. 1.4. Solenoid valves, relays and auxiliary contactors are discrete or digital output devices commonly used in the field. Depending on the field devices 110VAC, 230VAC and 24VDC types of digital output cards are installed in the PLC rack. It is assumed to be 24VDC in Fig. 1.4. Depending on the state of field devices, i.e., Logic 1 or Logic 0 (True/False) the corresponding voltage signal will be received at a digital input module. The CPU collects the status of ‘Logic 0 or Logic 1 status’ from I/P module for program execution. At the end of program execution, the CPU will release the On/Off command to the digital output module in form of Logic 0 or Logic 1.

Page 19: Practical Programmable Logic Controllers for Automation ... · of 6 Pocket Guides used by ... 15.5 Profibus 229 15.6 Foundation Fieldbus 233 16 Operator Interfaces 239 16.1 Introduction

Introduction to the PLC 7

The digital output module passes this status on to field devices in form of voltage so that they will be turned on/off depending on the state of the output.

1.5.2 Analog I/O and PLC

Figure 1.5 shows how different types of analog or continuous types of field devices are connected with the PLC through analog I/O modules.

Figure 1.5 Analog I/O process interaction

Analog or continuous devices are generally used for getting feedback of the process parameter control. For example, temperature transducers (RTDs, thermocouples), level, pressure, flow, etc., transmitters. Basically, all types of transducer devices giving continuous signal are included in this class. Depending on field transducer devices, they are normally connected to 0-20 or 4-20 mA DC, 0-10VDC, RTDs, thermocouples, etc., type of analog input card, installed in the PLC rack. Analog output actuators, commonly used in the field, include continuous actuators, I/P converter for valves, reference for drives, etc.

Page 20: Practical Programmable Logic Controllers for Automation ... · of 6 Pocket Guides used by ... 15.5 Profibus 229 15.6 Foundation Fieldbus 233 16 Operator Interfaces 239 16.1 Introduction

8 Practical Programmable Logic Controllers (PLCs) for Automation and Process Control

The corresponding signal received at the analog input module, depends on the value of field devices (i.e., either 4-20mA or some continuous value) and varies from a minimum to a maximum over the entire calibrated range.. This signal is converted by the input module, into a count using ADC (analog-to-digital converter). The CPU collects the same count from an analog I/P module for program execution. At the end of program execution, the CPU will once again release a count proportionate to the control value to the analog output module. The analog output module passes the same count (either as a 4-20mA or some continuous signal) using DAC (digital-to-analog converter) to the field actuating devices. The 4-20mA signal actuator will either open/close the valve depending on it’s setup.

1.6 Number systems and codes

The commonly used number systems can be listed as: • Decimal number system • Binary number system • Octal number system • Hexadecimal (Hex) number system

One may also encounter BCD (binary coded decimal) in codes. The following definitions / terms are commonly encountered:

• Bit: A single binary digit that can have either value 0 or 1.

• Base: This denotes the total number of digits used by the number system.

• LSB (Least Significant Bit): This is the bit that represents the smallest value.

• MSB (Most Significant Bit): This is the bit that represents the largest value.

• Byte: A group of 8 bits.

• Nibble: A group of 4 bits.

• Word: A group of 16 bits

1.6.1 Decimal number system The decimal number system is the most common number system (and one which we should all have learnt in school!). The decimal number system has a base of ‘10’. Base ‘10’ means it uses ten unique numbers (0 to 9) for the entire number system. A specific weight value is allocated to each digit from the right to the left. Therefore, the value of a decimal number depends on the digit as well as its location.

Page 21: Practical Programmable Logic Controllers for Automation ... · of 6 Pocket Guides used by ... 15.5 Profibus 229 15.6 Foundation Fieldbus 233 16 Operator Interfaces 239 16.1 Introduction

Introduction to the PLC 9

For example, If we take ‘2413’ as a decimal number, its weight can be shown as,

2 4 1 3

3 x 10 exp. 0 = 3x1 = 3 1 x 10 exp. 1 = 1x10 = 10 4 x 10 exp.2 = 4x100 = 400 2 x 10 exp.3 = 2x1000 = 2000 = 2413 (Decimal)

1.6.2 Binary number system

The most important base for the microprocessor is base 2. Normally, it is also known as ‘Binary’, since binary means only two values. The binary system uses only two digits – zero (0) and one (1) – to represent all numbers. Two states exists for any digital device – one as “On” state or Logic ‘1’ and other as “Off” state or Logic “0”. As the base was ‘10’ in the decimal system, here, the base is ‘2’ in the binary system. The weight of the digits is calculated in terms of base ‘2’ like for example,

1 0 0 1 1

1 x 2 exp. 0 = 1x1 = 1 1 x 2 exp .1 = 1x2 = 2 0 x 2 exp .2 = 0x4 = 0 0 x 2 exp .3 = 0x8 = 0 1 x 2 exp .4 = 1x16 = 16 = 19 (Decimal)

1.6.3 Octal number system

The base for this number system is ‘8’. That is why it is called ‘Octal’. The binary system uses eight digits – from zero (0) to seven (7) to represent all the numbers.

Octal Digit 0 1 2 3 4 5 6 7

Binary Equivalent. 000 001 010 011 100 101 110 111

Page 22: Practical Programmable Logic Controllers for Automation ... · of 6 Pocket Guides used by ... 15.5 Profibus 229 15.6 Foundation Fieldbus 233 16 Operator Interfaces 239 16.1 Introduction

10 Practical Programmable Logic Controllers (PLCs) for Automation and Process Control

Basically, it can be considered as a shorthand version of binary. Octal notation was used to provide an easy and more readable view of the binary data. But it is not frequently used, when compared to other number systems. For example, the octal number 24 is represented as,

2 4

4 x 8 exp.0 = 4x1 = 4 2 x 8 exp.1 = 2x8 = 16 = 20 (Decimal)

1.6.4 Hexadecimal (Hex) number system

The base of this number system is ‘16’. It provides a shorter notation of the numbers, compared octal system. It is very popular and was introduced by IBM. The hexadecimal number system uses 16 digits. These are: Numbers ‘0’ to ‘9’, and it uses letters A, B, C, D, E, and F to represent the decimal equivalents of 10, 11, 12, 13, 14 and 15.

Hex Digit 0 1 2 3 4 5 6 7 Binary Equivalent. 0000 0001 0010 0011 0100 0101 0110 0111

Hex Digit 8 9 A B C D E F Binary Equivalent. 1000 1001 1010 1011 1100 1101 1110 1111

As shown in above table, a hex digit is representing four binary digits (0000 to 1111). For example, the hex number 2F is represented as,

0 0 2 F

F x 16 exp.0 = Fx1 = 15 2 x 16 exp. 1 = 2x16 = 32

= 47 (Decimal) 1.6.5 Conversion of numbers

Table 1.1 gives an overview of all number systems we have seen so far. Note that all number systems start with digit ‘0’.

Page 23: Practical Programmable Logic Controllers for Automation ... · of 6 Pocket Guides used by ... 15.5 Profibus 229 15.6 Foundation Fieldbus 233 16 Operator Interfaces 239 16.1 Introduction

Introduction to the PLC 11

Table 1.1 Number formats

Decimal Binary Octal Hex

0 0000 0 0 1 0001 1 1 2 0010 2 2 3 0011 3 3 4 0100 4 4 5 0101 5 5 6 0110 6 6 7 0111 7 7 8 1000 10 8 9 1001 11 9

10 1010 12 A 11 1011 13 B 12 1100 14 C 13 1101 15 D 14 1110 16 E 15 1111 17 F

1.6.6 BCD (Binary Coded Decimal)

Binary coded decimal uses binary numbers in coded format to represent the decimal numbers (unlike the normal way; discussed in the earlier section). It is also called as 8421 BCD code. It basically employs four binary bits, with the weights 1, 2, 4 and 8 assigned to it. This is illustrated in the table given below:

Decimal Digit 0 1 2 3 4 5 6 7 BCD Equivalent. 0000 0001 0010 0011 0100 0101 0110 0111

Decimal Digit 8 9 BCD Equivalent. 1000 1001

For example, the decimal number 79 is represented in BCD format as,

0 1 1 1

‘7’ ‘9’

= 79 (Decimal)

1 0 0 1

Page 24: Practical Programmable Logic Controllers for Automation ... · of 6 Pocket Guides used by ... 15.5 Profibus 229 15.6 Foundation Fieldbus 233 16 Operator Interfaces 239 16.1 Introduction

12 Practical Programmable Logic Controllers (PLCs) for Automation and Process Control

Each decimal number is replaced by its BCD equivalent, which is a four-digit binary number. The BCD number format is useful for the PLC while handling a large number of input and output data. Nowadays, PLC’s possess a certain number format conversion programming instructions. One can easily convert numbers from one format to another with the help of these instructions. Should you wish to do some form of conversion, program the PLC with the necessary code…and it will be done.