Title | LEC-02 IEC 61131-3 Programming Standard Rev3 |
---|---|
Author | Frank Nguyen |
Course | ELEX |
Institution | British Columbia Institute of Technology |
Pages | 17 |
File Size | 1 MB |
File Type | |
Total Downloads | 3 |
Total Views | 128 |
Download LEC-02 IEC 61131-3 Programming Standard Rev3 PDF
21/09/2015
2
IEC 61131-3 Standard Programming Environment for Industrial Control Applications
Information courtesy of PLCopen (www.plcopen.org)
02 – IEC 61131-3 Standard ELEX 4221
1
Yesterday’s Reality • Industrial control of a plant was not unique to one manufacturer’s equipment. • Even when manufacturer’s used the same programming language the differences in syntax were significant. (eg. PLC ladder logic I/O addressing) • Development of software in one vendor’s equipment could not be easily transported to another vendor’s equipment.
02 – IEC 61131-3 Standard ELEX 4221
2
1
21/09/2015
How to solve the problem? • Standards – agreement by all players in the industrial control business to comply with an international programming standards. • Standard is rigid enough to ensure consistency of the programming environment while not constraining vendors from producing unique product. • Strongly supported by end-users. Why?
02 – IEC 61131-3 Standard ELEX 4221
3
Benefits of a Standard • Programming techniques learned for one environment are easily transportable to new environments. • A common programming standard reduces the time required for training, troubleshooting or maintaining industrial control systems. Avoids need for re-training. • Allows control systems experts to focus on solving a problem via software and allows this software to be re-used (reduces dependency on one supplier). • Improves the ability to integrate components from different vendors, locations, projects or countries. 02 – IEC 61131-3 Standard ELEX 4221
4
2
21/09/2015
What exactly is IEC? • International Electrotechnical Commission (IEC) – Non-profit; not government related; • Produces standards that provide guidelines for virtually every aspect of electrical, electronics and related technologies. • IEC membership: representatives from over 70 countries. Each country is represented by its “national committee”. • Standards are prepared by people that are working in the relevant industry and knowledgeable about the technology and users’ needs. 02 – IEC 61131-3 Standard ELEX 4221
5
IEC 61131-3 • Programming Languages / Industrial Control Programming • 61131 Standard is comprised (at this time) of 7 parts: 1. 2. 3. 4. 5. 7. 8.
General Overview / Definitions Hardware Programming Languages User Guidelines Communication (Messaging Service Spec) Fuzzy Logic Implementation Guidelines
02 – IEC 61131-3 Standard ELEX 4221
6
3
21/09/2015
Consistency / Reliability The programming standard significantly contributes to the consistent and reliable execution of industrial software configurations because it addresses key issues such as:
execution control
structured software software encapsulation (re-use code) data type definitions and constraints addresses complex sequential behaviour
02 – IEC 61131-3 Standard ELEX 4221
7
Components of IEC 61131-3
1. Programming Languages
Ladder Logic Diagram (LD) Instruction List (IL) Structured Text (ST) Function Block Diagrams (FBD) Sequential Function Charts (SFC)
2. Common Elements (re: the programming languages)
Data types Standard Functions Function Blocks 02 – IEC 61131-3 Standard ELEX 4221
8
4
21/09/2015
Ladder Logic Diagram • Based on the well-known North American PLC programming language. • The standard specifies a standardized, rationalized set of relay ladder logic programming symbols.
02 – IEC 61131-3 Standard ELEX 4221
9
Instruction List • Similar to assembly language programming. • Single accumulator-based execution model. • Only one operation is allowed per line of code (eg. Loading a value into the accumulator)
02 – IEC 61131-3 Standard ELEX 4221
10
5
21/09/2015
Structured Text • • • •
High level language, block structured. Includes functions such as ABS(), SIN(), SQRT() Similar to Pascal (or Basic). Complex statements and nested instructions are possible (supports if-then-else, while-do, etc.)
02 – IEC 61131-3 Standard ELEX 4221
11
Function Block Diagram • Graphical language • Similar to LabView • Allows program elements which appear as blocks to be “wired” together. • Used in many applications that involve the flow of data between control components.
02 – IEC 61131-3 Standard ELEX 4221
12
6
21/09/2015
Sequential Function Chart • Graphical language showing logic flow sequence (flowchart like). • Basic elements are steps with action blocks and transitions. • Steps are program code that is executed until transition occurs. • Complex task broken down into smaller parts. 02 – IEC 61131-3 Standard ELEX 4221
13
Standard Data Types • • • • • •
Bit string types: BOOL, BYTE, WORD, DWORD, LWORD Integer types: INT, SINT, DINT, LINT Unsigned Integer types: USINT, UINT, UDINT, ULINT Real types: REAL, LREAL Time/Date types: TIME, DATE, TIME_OF_DAY Character types: STRING, WSTRING
• Vendor and user defined data types are possible.
02 – IEC 61131-3 Standard ELEX 4221
14
7
21/09/2015
Variables • • • • •
Global Direct (local) I/O Mapping Input, Output, I/O External Temporary
02 – IEC 61131-3 Standard ELEX 4221
15
Standard Functions (Program Organization Units) • • • • • •
Bit string functions: AND, OR, NOT, XOR, SHL, SHR, ROR, etc. Numerical Functions: ADD, SUB, MUL, DIV, ABS, SQRT, LN, etc. Type conversions: USINT_TO_DINT, BOOL_TO_BYTE, etc. Selection functions: MIN, MAX, LIMIT, MUX, SEL Comparison functions: GT, GE, EQ, LT, LE, NE String functions: LEFT, RIGHT, MID, CONCAT, INSERT, DELETE, etc.
Vendor and user defined functions are possible.
02 – IEC 61131-3 Standard ELEX 4221
16
8
21/09/2015
Standard Function Blocks • Bistables (latches or flipflops):
SR, RS
• Edge detection: R_TRIG, F_TRIG • Counters:
CTU, CTD, CTUD
• Timers:
TP, TON, TOF, RTC
• Vendor and user defined functions are possible (custom).
02 – IEC 61131-3 Standard ELEX 4221
17
IEC 61131-3 Software Model from presentation by Eelco van der Wal (PLCopen) Configuration Resource
Variable access path
Resource
Task
Task
Task
Task
Program
Program
Program
Program
FB FB
Function FB Block Variable
FB FB
Global and direct variables
Execution control path
Access path Communication Function 02 – IEC 61131-3 Standard ELEX 4221
18
9
21/09/2015
IEC 61131-3 Software Model
A typical microprocessor-based system could be viewed as being a resource (the microprocessor) with a task (the program it executes).
02 – IEC 61131-3 Standard ELEX 4221
19
IEC 61131-3 Software Model Configuration
The complete software package / database required to solve the industrial control problem is referred to as the “configuration”. Communication Function 02 – IEC 61131-3 Standard ELEX 4221
20
10
21/09/2015
IEC 61131-3 Software Model - DeltaV Example Configuration
DeltaV Configuration (all hardware, software and field devices).
This would be like a complete DeltaV configuration including all hardware and software.
Communication Function 02 – IEC 61131-3 Standard ELEX 4221
21
IEC 61131-3 Software Model Configuration
Resource
Resource
The “resources” are the hardware (computational) components of the system).
Communication Function 02 – IEC 61131-3 Standard ELEX 4221
22
11
21/09/2015
IEC 61131-3 Software Model - DeltaV Example Configuration
ProPlus Station
DeltaV Hardware (CPU & I/O Rack) Resource
Resource
The resources, in a DeltaV configuration , could be multiple DeltaV hardware racks (controller and I/O, the ProPlus and/or intelligent field devices.
Communication Function 23
02 – IEC 61131-3 Standard ELEX 4221
IEC 61131-3 Software Model Configuration Resource Task
Resource Task
Task
Task
A “task” controls the different parts (sections) of a program required to accomplish the industrial control objective.
Access path Communication Function 02 – IEC 61131-3 Standard ELEX 4221
24
12
21/09/2015
IEC 61131-3 Software Model - DeltaV Example Configuration Resource
Resource
Task
Task
Control Module
Control Module
KC-1107
FC-1115
Task
Task
Control
Control Module
Module ZC-2128
TC-2104
Access path Communication Function 25
02 – IEC 61131-3 Standard ELEX 4221
IEC 61131-3 Software Model Configuration Resource
Resource
Task
Task
Task
Task
Program
Program
Program
Program
A “program” is the software written to execute the industrial control strategy and may be in any one of the 5 programming languages. Execution control path
Access path Communication Function 02 – IEC 61131-3 Standard ELEX 4221
26
13
21/09/2015
IEC 61131-3 Software Model - DeltaV Example Configuration Resource
Resource
Task
Task
Task
Task
Program
Program PID FBD
Program Struct. Text
Program
SFC
PID FBD Execution control path
Access path Communication Function 27
02 – IEC 61131-3 Standard ELEX 4221
IEC 61131-3 Software Model from presentation by Eelco van der Wal (PLCopen) Configuration Resource
Variable access path
Resource
Task
Task
Task
Task
Program
Program
Program
Program
FB FB
Variable
FB FB
Global and direct variables
Access path Communication Function 02 – IEC 61131-3 Standard ELEX 4221
Function Block FB
Execution control path
Data is exchanged using global or direct variables.
28
14
21/09/2015
IEC 61131-3 Software Model from presentation by Eelco van der Wal (PLCopen) Configuration Resource
Variable access path
Resource
Task
Task
Task
Task
Program
Program
Program
Program
FB FB
Function Block FB Variable
FB FB Execution control path
Global and direct variables
Access path Communication Function
This would be an early model PLC.
29
02 – IEC 61131-3 Standard ELEX 4221
Example
Fermentation Control System
courtesy of Omron Electronics
02 – IEC 61131-3 Standard ELEX 4221
30
15
21/09/2015
Fermentation Process Agitator
Feed valve Acidic reagent Alkali reagent
Temperature sensor pH sensor
Heater band
Harvest valve
31
02 – IEC 61131-3 Standard ELEX 4221
Fermentation Control Decomposition • MainSequence • Valve control
e.g. top level process steps - filling, heating, agitating, fermenting, harvesting, cleaning. e.g. operating valves used to fill and empty the fermentation vessel
• Temperature control for monitoring the temperature of the vessel and modulating the heater. • Agitator control for the agitator motor activated as demanded by the main process sequence.
• pH Control
02 – IEC 61131-3 Standard ELEX 4221
for monitoring the acidity of the fermentation contents and adding acidic or alkali reagents.
32
16
21/09/2015
Fermentation Control Program
Function Block Programming
33
02 – IEC 61131-3 Standard ELEX 4221
Main Sequence SFC S1
Sequential Function Chart Programming
02 – IEC 61131-3 Standard ELEX 4221
N
Initialisation
S2
N
Filling
S3
N
Heating
S4
N
Fermenting
S5
N
Harvesting
S6
N
Cleaning
Shows the main process states Indicates current active state and transition condition to be completed
34
17...