Sei sulla pagina 1di 10

Course T300, Engineering an 800xA System

Chapter 4 IEC61131-3 concept

TABLE OF CONTENTS
Chapter 4 IEC61131-3 concept...................................................................................................................................................... 4-1
4.1 General Information ............................................................................................................................................................. 4-3
4.1.1 Description .................................................................................................................................................................... 4-3
4.1.2 Reference Documentation............................................................................................................................................. 4-3
4.2 IEC 61131-3, the Concept and Common Elements ............................................................................................................ 4-4
4.2.1 Description .................................................................................................................................................................... 4-4
4.2.2 IEC 61131-3 Overview.............................................................................................................................................. 4-4
4.2.3 The 5 Languages of IEC 61131-3................................................................................................................................. 4-4
4.2.4 IEC 61131-3 Common Elements: Variables ................................................................................................................ 4-6
4.2.5 IEC 61131-3 Standard Datatypes ................................................................................................................................. 4-6
4.3 Software Model and Compliance ........................................................................................................................................ 4-7
4.3.1 Description .................................................................................................................................................................... 4-7
4.3.2 IEC 61131-3 Software Model....................................................................................................................................... 4-7
4.3.3 Control Builder M Professional Software Model ..................................................................................................... 4-7
4.3.4 IEC 61131-3 Standard Functions ................................................................................................................................. 4-7
4.3.5 IEC 61131-3 Standard Functions Blocks ..................................................................................................................... 4-8
4.3.6 IEC 61131-3 POU = Program Organization Unit ........................................................................................................ 4-8
4.4 ABB Extensions and Simplifications of IEC 61131-3........................................................................................................ 4-9
4.4.1 Description .................................................................................................................................................................... 4-9
4.4.2 Configuration ................................................................................................................................................................ 4-9
4.4.3 Program Organization Units (POU) ............................................................................................................................. 4-9
4.4.4 Task Connections........................................................................................................................................................ 4-10
4.4.5 Project Constants......................................................................................................................................................... 4-10

4-1

Course T300, Engineering an 800xA System

4-2

Engineering an 800xA System

4.1 General Information


4.1.1 Description
This chapter contains the IEC 61131-3 standard and extensions and simplifications of
this standard implemented by ABB in Control Builder.

4.1.2 Reference Documentation

www.plcopen.org

Online Manual: IEC 61131-3 Control Languages

4-3

Engineering an 800xA System


Chapter 4 IEC61131-3 concept

4.2 IEC 61131-3, the Concept and Common Elements


4.2.1 Description
These lessons contain the basic concept and Common Elements of the IEC 61131-3
standard.

4.2.2 IEC 61131-3 Overview


The 5 parts of the IEC 61131 Standard
1

General overview, definitions

IS, International Standard

Hardware

IS

Programming Languages

IS

User Guidelines

Messaging Service Specification

4.2.3 The 5 Languages of IEC 61131-3


Instruction List
LD

ANDN

ST

Structured Text
C:= A AND NOT B;

Ladder Diagram
A B

Step 1

FILL

Transition 1

Function Block Diagram

AND

Sequential Function Chart

Step 2

-| |--|/|----------------( )

S Empty
Transition 2

Step 3

4.2.3.1 Instruction List (IL)

4-4

Single Accumulator based execution model

Based upon the German Anweisungsliste, AWL

One operation such as storing a value in the accumulator register, is allowed per
line
LD

ANDN

ST

Engineering an 800xA System

4.2.3.2 Structured Text (ST)

High level language, block structured

Syntax resembles PASCAL

Complex statements and nested instructions possible

Support for

Iteration loops (REPEAT-UNTIL; WHILE-DO)

Conditional execution (IF-THEN-ELSE; CASE)

Functions (SQRT(), SIN())

C:=A AND NOT B;

4.2.3.3 Ladder Diagram (LD)

Standardised, rationalised set of relay


ladder programming symbols

Based on well-known North American style of programming, resembling US-type


of electrical drawing standard
A

| |---|/|--------------( )

4.2.3.4 Function Block Diagram (FBD)

Graphical language, widely used in Europe

Allows program elements which appear as blocks to be "wired" together in a form


analogous to a circuit diagram

Used in many applications that involve the flow of information or data between
control components

AND

chemistry

4.2.3.5 Sequential Function Chart, SFC

Powerful graphical technique for describing the sequential behaviour of a control


program

Used to partition a control problem

Shows overview, also suitable for rapid diagnostics

4-5

Engineering an 800xA System


Chapter 4 IEC61131-3 concept

The basic elements are STEPS with ACTION BLOCKS and TRANSITIONS

Support for alternative and parallel sequences

Step 1

FILL

Transition 1
Step 2

S Empty
Transition 2

Step 3

4.2.4 IEC 61131-3 Common Elements: Variables

Symbolic representation via labels

Restricted area for I/O mapping

Hardware independent of code

4.2.5 IEC 61131-3 Standard Datatypes

4-6

Bit string types (BOOL, BYTE, WORD, DWORD, LWORD)

Integer types (SINT, INT, DINT, LINT)

Unsigned integer types (USINT, UINT, UDINT, ULINT)

Real types (REAL, LREAL)

Time types (TIME, DATE, TIME_OF_DAY, DATE_AND_TIME)

Character types (STRING)

Vendor and user defined data types are possible

Direct derived, sub range, enumeration

Array, structure

Engineering an 800xA System

4.3 Software Model and Compliance


4.3.1 Description
These lessons contain details about the Software Model and Compliance of the IEC
61131-3 standard.

4.3.2 IEC 61131-3 Software Model


Configuration
Resource
Task

Variable
access path

Resource
Task

Task

Task

FB
Function
Block

Program

Program
FB

Program

Program

FB

FB

FB

Global and direct variables

Variable

Execution
control path

Access path
Communication Function

4.3.3 Control Builder M Professional Software Model


Application
Variable
access path
Task

Task . . . 16

Task

FB
Function
Block

Program

Program

Program

FB

FB

FB

. . . 64

FB

Global variables

Variable

Execution
control path

Access path
Communication Function

4.3.4 IEC 61131-3 Standard Functions

Bit string functions

Numerical functions
(ADD, SUB, MUL, DIV, MOD, EXPT, ABS, SQRT,
LN, LOG, EXP, SIN, COS, TAN, ASIN, ACOS, ATAN)

(AND, OR, XOR, NOT, SHL, SHR, ROL, ROR)

4-7

Engineering an 800xA System


Chapter 4 IEC61131-3 concept

Type conversions

(e.g. USINT_TO_DINT, BOOL_TO_BYTE)

Selection functions

(SEL, MIN, MAX, LIMIT, MUX)

Comparison functions (GT, GE, EQ, LT, LE, NE)

String functions
(LEN, LEFT, RIGHT, MID, CONCAT, INSERT,
DELETE, REPLACE, FIND)

Vendor and user defined functions are possible

4.3.5 IEC 61131-3 Standard Functions Blocks

Bistables

(SR, RS, SEMA)

Edge detection

(R_TRIG, F_TRIG)

Counters

(CTU, CTD, CTUD)

Timers

(TP, TON, TOF, RTC)

Vendor and user defined function blocks are possible.

4.3.6 IEC 61131-3 POU = Program Organization Unit


POUs enable re-use of software from macro level (Programs) to micro level (FB and
Functions). A POU consists of a header (variable declaration) and the body
(instructions).
POU Type

4-8

Replicated as:

Comments

Program

Program instance

Main program

Function Block

FB instance

Subroutine with own


memory, several in- and
outputs possible

Function

Function

Subroutine without memory


only one output possible

Engineering an 800xA System

4.4 ABB Extensions and Simplifications of IEC 61131-3


4.4.1 Description
This lesson contains the extensions and simplifications of the IEC 61131-3 standard
implemented by ABB in the Control Builder.

4.4.2 Configuration
The term Configuration is not used in the software model of the Control Builder
Professional. The Resource has also been excluded. Instead the Application replaces
both Configuration and Resource. The Application is discussed below.

4.4.3 Program Organization Units (POU)


4.4.3.1 Overview: Control Modules and Function Blocks

4-9

Engineering an 800xA System


Chapter 4 IEC61131-3 concept

4.4.3.2 Applications
An Application is a code container replacing the combination of Configuration and
Resource of the IEC 61131 Software model. There is however, no direct correlation
between an application and a controller. An application can contain Programs and
Control Modules and these can be downloaded to different controllers independently.

4.4.3.2.1 Variables in the Application Editor


To handle communication between top level Control Modules, it is possible to declare
variables in the application editor. These variables only serve the Control Modules, i.e.
they are not used for communicating between programs. Use Global Variables for this.

4.4.3.3 Control Modules


Control Modules are code containers replacing both first level (Programs) and second
level units (Function blocks) of the IEC software model. Control Modules display
several improvements compared to IEC POU:s , e.g. code sorting and a graphical
interface. Control Modules will be discussed in detail in chapter 17.

4.4.4 Task Connections


4.4.4.1 Task Connections to Function Blocks
Function blocks within function blocks can be connected to tasks independent of the
task of the program or of the first level function block. This is an extension to the IEC
standard, which requires individual connections only for first level function blocks.

4.4.4.2 Task Connections to Control Modules


Control Modules at any depth can be individually task-connected.

4.4.5 Project Constants


Project Constants are extensions to the standard. The standard requires the possibility
to lock the value of variables by declaring them as constants. Project Constants are
discussed in chapter 6.

4-10

Potrebbero piacerti anche