Suchen und Finden
Service
Programmable Logic Controllers - A Practical Approach to IEC 61131-3 using CoDeSys
Dag H. Hanssen
Verlag Wiley, 2015
ISBN 9781118949238 , 416 Seiten
Format PDF, OL
Kopierschutz DRM
Title Page
5
Copyright Page
6
Contents
7
Programmable Logic Controllers
15
Preface
16
Part 1 Hardware
19
Chapter 1 About PLCs
21
1.1 History
22
1.1.1 More Recent Developments
24
1.2 Structure
25
1.2.1 Inputs and Outputs
28
1.3 PLC Operation
31
1.3.1 Process Knowledge
32
1.3.2 Standard Operations
34
1.3.3 Cyclic, Freewheeling, or Event-Controlled Execution
36
1.4 Test Problems
37
Chapter 2 Digital Signals and Digital Inputs and Outputs
38
2.1 Introduction
38
2.2 Terminology
39
2.2.1 Discrete, Digital, Logical, and Binary
39
2.2.2 Sensors, Transducers, and Transmitters
40
2.3 Switches
42
2.3.1 Limit Switches
42
2.3.2 Safety Devices
42
2.3.3 Magnetic Switches
43
2.4 Logical Sensors
44
2.4.1 Inductive Sensors
45
2.4.2 Capacitive Sensors
47
2.4.3 Photocells
48
2.4.4 Ultrasonic Sensors
51
2.4.5 Rotating Sensors (Encoders)
52
2.4.6 Other Detection Principles and Sensors
55
2.5 Connection of Logical Sensors
57
2.5.1 Sink/Source
59
2.5.2 Selecting a Sensor with the Proper Type of Output
61
2.6 Properties of Discrete Inputs
62
2.7 Discrete Actuators
63
2.7.1 Relays and Contactors
64
2.7.2 Solenoids and Magnetic Valves
65
2.7.3 Transistor Outputs versus Relay Outputs
67
2.8 Test Problems
68
Chapter 3 Analog Signals and Analog I/O
70
3.1 Introduction
70
3.2 Digitalization of Analog Signals
71
3.2.1 Filtering
71
3.2.2 A/D Conversion
73
3.3 Analog Instrumentation
76
3.3.1 About Sensors
76
3.3.2 Standard Signal Formats
77
3.3.3 On the 4–20mA Standard
77
3.3.4 Some Other Properties of Sensors
79
3.4 Temperature Sensors
79
3.4.1 Thermocouple
79
3.4.2 PT100/NI1000
80
3.4.3 Thermistors
82
3.5 Connection
82
3.5.1 About Noise, Loss, and Cabling
82
3.5.2 Connecting Sensors
85
3.5.3 Connection of a PT100 (RTD)
86
3.5.4 Connecting Thermocouples
90
3.6 Properties of Analog Input Modules
90
3.6.1 Measurement Ranges and Digitizing: Resolution
90
3.6.2 Important Properties and Parameters
92
3.7 Analog Output Modules and Standard Signal Formats
93
3.8 Test Problems
94
Part 2 Methodic
97
Chapter 4 Structured Design
99
4.1 Introduction
99
4.2 Number Systems
100
4.2.1 The Decimal Number Systems
100
4.2.2 The Binary Number System
100
4.2.3 The Hexadecimal Number System
101
4.2.4 Binary-Coded Decimal Numbers
103
4.2.5 Conversion between Number Systems
104
4.3 Digital Logic
105
4.4 Boolean Design
109
4.4.1 Logical Functional Expressions
109
4.4.2 Boolean Algebra
111
4.5 Sequential Design
115
4.5.1 Flowchart
115
4.5.2 Example: Flowchart for Mixing Process
117
4.5.3 Example: Flowchart for an Automated Packaging Line
119
4.5.4 Sequence Diagrams
125
4.5.5 Example: Sequence Diagram for the Mixing Process
128
4.5.6 Example: Batch Process
130
4.6 State-Based Design
131
4.6.1 Why Use State Diagrams?
132
4.6.2 State Diagrams
132
4.6.3 Example: Batch Process
135
4.6.4 Example: Level Process
136
4.6.5 Example: Packing Facility for Apples
139
4.7 Summary
142
4.8 Test Problems
143
Part 3 IEC 61131-3
149
Chapter 5 Introduction to Programming and IEC 61131-3
151
5.1 Introduction
151
5.1.1 Weaknesses in Traditional PLCs
152
5.1.2 Improvements with IEC 61131-3
154
5.1.3 On Implementation of the Standard
155
5.2 Brief Presentation of the Languages
156
5.2.1 ST
156
5.2.2 FBD
156
5.2.3 LD
157
5.2.4 IL
157
5.2.5 SFC
159
5.3 Program Structure in IEC 61131-3
159
5.3.1 Example of a Configuration
163
5.4 Program Processing
164
5.4.1 Development of Programming Languages
164
5.4.2 From Source Code to Machine Code
165
5.5 Test Problems
169
Chapter 6 IEC 61131-3: Common Language Elements
170
6.1 Introduction
170
6.2 Identifiers, Keywords, and Comments
171
6.2.1 Identifiers
171
6.2.2 Keywords
172
6.2.3 Comments
172
6.3 About Variables and Data Types
174
6.4 Pragmas and Literals
174
6.4.1 Literal
175
6.5 Data Types
176
6.5.1 Numerical and Binary Data Types
176
6.5.2 Data Types for Time and Duration
179
6.5.3 Text Strings
181
6.5.4 Generic Data Types
182
6.5.5 User-Defined Data Types
184
6.6 Variables
187
6.6.1 Conventional Addressing
188
6.6.2 Declaration of Variables with IEC 61131-3
189
6.6.3 Local Versus Global Variables
192
6.6.4 Input and Output Variables
193
6.6.5 Other Variable Types
194
6.7 Direct Addressing
194
6.7.1 Addressing Structure
194
6.7.2 I/O-Addressing
196
6.8 Variable versus I/O-Addresses
197
6.8.1 Unspecified I/O-Addresses
197
6.9 Declaration of Multielement Variables
198
6.9.1 Arrays
199
6.9.2 Data Structures
200
6.10 Test Problems
202
Chapter 7 Functions
205
7.1 Introduction
205
7.2 On Functions
206
7.3 Standard Functions
207
7.3.1 Assignment
208
7.4 Boolean Operations
209
7.5 Arithmetic Functions
210
7.5.1 Overflow
211
7.6 Comparison
212
7.7 Numerical Operations
213
7.7.1 Priority of Execution
214
7.8 Selection
215
7.9 Type Conversion
215
7.10 Bit-String Functions
217
7.11 Text-String Functions
218
7.12 Defining New Functions
220
7.13 EN/ENO
221
7.14 Test Problems
222
Chapter 8 Function Blocks
224
8.1 Introduction
224
8.1.1 The Standard’s FBs
225
8.2 Declaring and Calling FBs
225
8.3 FBs for Flank Detection
226
8.4 Bistable Elements
227
8.5 Timers
228
8.6 Counters
229
8.6.1 Up-Counter
230
8.6.2 Down-Counter
230
8.6.3 Up/Down-Counter
230
8.7 Defining New FBs
231
8.7.1 Encapsulation of Code
232
8.7.2 Other Nonstandardized FBs
234
8.8 Programs
235
8.8.1 Program Calls
236
8.8.2 Execution Control
237
8.9 Test Problems
238
Part 4 Programming
239
Chapter 9 Ladder Diagram (LD)*
241
9.1 Introduction
241
9.2 Program Structure
242
9.2.1 Contacts and Conditions
243
9.2.2 Coils and Actions
244
9.2.3 Graphical Elements: An Overview
245
9.3 Boolean Operations
245
9.3.1 AND/OR-Conditions
245
9.3.2 Set/Reset Coils
248
9.3.3 Edge Detecting Contacts
251
9.3.4 Example: Control of a Mixing Process
252
9.4 Rules for Execution
255
9.4.1 One Output: Several Conditions
255
9.4.2 The Importance of the Order of Execution
256
9.5 Use of Standard Functions in LD
258
9.6 Development and Use of FBs in LD
260
9.7 Structured Programming in LD
262
9.7.1 Flowchart versus RS-Based LD Code
266
9.7.2 State Diagrams versus RS-Based LD Code
271
9.8 Summary
277
9.9 Test Problems
278
Chapter 10 Function Block Diagram (FBD)
280
10.1 Introduction
280
10.2 Program Structure
281
10.2.1 Concepts
282
10.3 Execution Order and Loops
282
10.3.1 Labels and Jumps
283
10.4 User-Defined Functions and FBs
284
10.5 Integer Division
286
10.6 Sequential Programming with FBD
289
10.7 Test Problems
291
Chapter 11 Structured Text (ST)
296
11.1 Introduction
296
11.2 ST in General
297
11.2.1 Program Structure
298
11.3 Standard Functions and Operators
299
11.3.1 Assignment
300
11.4 Calling FBs
301
11.4.1 Flank Detection and Memories
302
11.4.2 Timers
305
11.4.3 Counters
306
11.5 IF Statements
306
11.6 CASE Statements
308
11.7 ST Code Based upon State Diagrams
310
11.7.1 Example: Code for the Level Process
313
11.8 Loops
316
11.8.1 WHILE … DO… END_WHILE
316
11.8.2 FOR … END_FOR
317
11.8.3 REPEAT … END_REPEAT
318
11.8.4 The EXIT Instruction
318
11.9 Example: Defining and Calling Functions
319
11.10 Test Problems
320
Chapter 12 Sequential Function Chart (SFC)
324
12.1 Introduction
324
12.1.1 SFC in General
325
12.2 Structure and Graphics
325
12.2.1 Overview: Graphic Symbols
327
12.2.2 Alternative Branches
327
12.2.3 Parallel Branches
329
12.3 Steps
330
12.3.1 Step Addresses
331
12.3.2 SFC in Text Form (for Those Specially Interested…)
332
12.4 Transitions
332
12.4.1 Alternative Definition of Transitions
333
12.5 Actions
335
12.5.1 Action Types
336
12.5.2 Action Control
337
12.5.3 Alternative Declaration and Use of Actions
339
12.6 Control of Diagram Execution
340
12.7 Good Design Technique
341
12.8 Test Problems
344
Chapter 13 Examples
349
13.1 Example 1: PID Controller Function Block: Structured Text
349
13.2 Example 2: Sampling: SFC
351
13.2.1 List of Variables
352
13.2.2 Possible Solution
352
13.3 Example 3: Product Control: SFC
355
13.3.1 Functional Description
356
13.3.2 List of Variables
356
13.3.3 Possible Solution
357
13.4 Example 4: Automatic Feeder: ST/SFC/FBD
360
13.4.1 Planning and Structuring
362
13.4.2 Alternative 1: SFC
363
13.4.3 Alternative 2: ST/FBD
365
Part 5 Implementation
369
Chapter 14 CODESYS 2.3
371
14.1 Introduction
371
14.2 Starting the Program
372
14.2.1 The Contents of a Project
374
14.3 Configuring the (WAGO) PLC
375
14.4 Communications with the PLC
378
14.4.1 The Gateway Server
379
14.4.2 Local Connection via Service Cable
380
14.4.3 Via Ethernet
381
14.4.4 Communication with a PLC Connected to a Remote PC
382
14.4.5 Testing Communications
383
14.5 Libraries
383
14.6 Defining a POU
385
14.7 Programming in FBD/LD
386
14.7.1 Declaring Variables
387
14.7.2 Programming with FBD
389
14.7.3 Programming with LD
390
14.8 Configuring Tasks
393
14.9 Downloading and Testing Programs
394
14.9.1 Debugging
395
14.10 Global Variables and Special Data Types
397
Chapter 15 CODESYS Version 3.5
399
15.1 Starting a New Project
399
15.1.1 Device
400
15.1.2 Application
402
15.2 Programming and Programming Units (POUs)
404
15.2.1 Declaration of Variables
406
15.3 Compiling and Running the Project
407
15.3.1 Start Gateway Server and PLS and Set Up Communications
408
15.4 Test Problems
411
Bibliography
413
Index
414
EULA
419