Relay Configuration Tool Tutorial 1MRS751903 MEM

Embed Size (px)

Citation preview

  • 8/18/2019 Relay Configuration Tool Tutorial 1MRS751903 MEM

    1/100

    ABB Automation

    Tutorial

    1MRS751903-MENIssued: 30.10.2000

    Version: D

    Program revision: 1.3.2

    We reserve the right to change data without prior notice.

    Relay Configuration Tool

    Notice 1

    The information in this document is subject to change without notice and should not

    be construed as a commitment by ABB. ABB assumes no responsibility for any er-

    ror that may occur in this document.

    Notice 2

    This document complies with the program revision 1.3.2.

    Notice 3

    Additional information may be found in the Release Notes.

    Trademarks

    Microsoft is a registered trademark of Microsoft Corporation.

    Windows NT is a registered trademark of Microsoft Corporation.

    Other brand or product names are trademarks or registered trademarks of their respective holders.

    All Microsoft products referenced in this document are either trademarks or registered trademarks of Microsoft

    Corporation.

  • 8/18/2019 Relay Configuration Tool Tutorial 1MRS751903 MEM

    2/100

    ABB Automation

    1MRS751903-MENRelay Configuration Tool

    Tutorial

    LIB 500 manuals

    LIB 510 manuals

    SMS 510 manuals

    CAP 501 manuals

    CAP 505 manuals

    CAP 505/LIB 510/SMS 510 common manuals

    CAP 505/SMS 510 common manuals

    LIB 500 Configuration Manual 1MRS751880-MEN

    LIB 500 Operator’s Manual 1MRS751885-MUM

    LIB 510 Configuration 1MRS751886-MEN

    LIB 510 MV Process Configuration 1MRS751887-MEN

    LIB 510 MV Process Operator’s Manual 1MRS751891-MUM

    LIB 510 Operator’s Manual 1MRS751888-MUM

    SMS 510 Installation and Commisioning 1MRS751897-MEN

    SMS 510 Operator’s Manual 1MRS751898-MUM

    CAP 501 Installation and Commisioning 1MRS751899-MEN

    CAP 501 Operator’s Manual 1MRS751900-MUM

    CAP 505 Installation and Commissioning 1MRS751901-MEN

    CAP 505 Operator’s Manual 1MRS751902-MUM

    Relay Configuration Tool Tutorial 1MRS751903-MEN

    Relay Mimic Editor Configuration 1MRS751904-MEN

    Relay Configuration Quick Start Reference 1MRS751905-MEN

    SPTO Configuration Tool 1MRS751906-MEN

    Protocol Editing Tool Operator’s Manual 1MRS751982-MUM

    Tools for Relays and Terminals 1MRS752008-MUM

    SM/Gateways Configuration 1MRS751870-MEN

  • 8/18/2019 Relay Configuration Tool Tutorial 1MRS751903 MEM

    3/100

    1MRS751903-MEN

    ABB Automation

    Relay Configuration Tool

    Tutorial

    1

    2

    34

    5

    6

    7

    8

    9

    10

    11

    1 Introduction

    2 Getting familiar with IEC 1131

    3 Realization of the IEC 1131-3

    4 Getting started with Relay Configuration Tool

    5 Editing the project structure

    6 Declaring variables and user defined data types

    7 Editing in FBD

    8 Editing in SFC

    9 Editing in IL

    10 Compiling

    11 Printing your project with a stylish pagelayout

    12 Making a backup of your project files 12

  • 8/18/2019 Relay Configuration Tool Tutorial 1MRS751903 MEM

    4/100

  • 8/18/2019 Relay Configuration Tool Tutorial 1MRS751903 MEM

    5/100

    ABB Automation

    ContentsTutorial

    Contents:1. Introduction ...............................................................................7

    1.1. What is Relay Configuration Tool? ................................................7

    1.2. What kind of documentation do you get? ......................................71.3. Symbols and textual conventions ..................................................7

    2. Getting familiar with IEC 1131 ..................................................9

    2.1. What is IEC 1131? ........................................................................9

    2.2. Configuration elements .................................................................9

    2.3. POUs, Programs, function blocks and functions .........................10

    2.4. Variables and data types .............................................................12

    2.5. Programming languages .............................................................13

    3. Realization of the IEC 1131-3 .................................................15

    3.1. Project .........................................................................................153.2. Libraries ......................................................................................15

    3.3. Data types ...................................................................................16

    3.4. POUs in Relay Configuration Tool ..............................................16

    3.5. Configurations elements in Relay Configuration Tool .................17

    4. Getting started with Relay Configuration Tool .....................19

    4.1. Calling Relay Configuration Tool .................................................19

    4.2. Using mouse and keyboard ........................................................19

    4.3. User interface ..............................................................................19

    4.4. Menu ...........................................................................................20

    4.5. Using help for Relay Configuration Tool .....................................23

    4.6. Editors in Relay Configuration Tool .............................................25

    5. Editing the project structure ..................................................29

    5.1. Relay Configuration Tool start-up ...............................................29

    5.2. Changing the properties of existing POUs ..................................30

    5.3. Inserting new POUs ....................................................................31

    5.4. Inserting worksheets ...................................................................32

    5.5. Announcing libraries ....................................................................33

    5.6. Deleting worksheets, POUs or libraries ......................................34

    6. Declaring variables and user defined data types .................35

    6.1. Ways how to declare variables in Relay Configuration Tool .......35

    6.2. Symbolic and located variables ...................................................35

    6.3. Global and local variables ...........................................................36

    6.4. Variable declaration keywords ....................................................36

    6.5. Declaring variables via dialog .....................................................37

    6.6. Instantiation .................................................................................38

    7. Editing in FBD .........................................................................41

    7.1. Calling the graphic editor with a FBD worksheet ........................41

    Relay Configuration Tool1MRS751903-MEN

  • 8/18/2019 Relay Configuration Tool Tutorial 1MRS751903 MEM

    6/100

    ABB Automation

    1MRS751903-MENRelay Configuration Tool

    Contents Tutorial

    7.2. Inserting functions and function blocks .......................................42

    7.3. Inserting variables .......................................................................42

    7.4. Connecting objects .....................................................................43

    7.5. Saving the contents ....................................................................45

    7.6. Exiting the worksheet .................................................................. 45

    8. Editing in SFC ......................................................................... 47

    8.1. Calling the graphic editor with a SFC worksheet ........................47

    8.2. Introduction to SFC networks .....................................................48

    8.3. Inserting a first SFC network ......................................................48

    8.4. Inserting more steps and transitions ...........................................49

    8.5. Changing an initial step into a normal step or vice versa ...........50

    8.6. Inserting an alternative branch ................................................... 51

    8.7. Inserting a simultaneous branch .................................................52

    8.8. Connecting variables to actions ..................................................53

    8.9. Connecting variables to transitions .............................................558.10.Action and transition details ....................................................... 57

    8.11.Saving the contents .................................................................... 58

    8.12.Exiting the worksheet ................................................................. 59

    9. Editing in IL ............................................................................. 61

    9.1. Calling the text editor with an IL worksheet ................................61

    9.2. Editing instructions ......................................................................61

    9.3. Using jumps and labels ...............................................................63

    9.4. Calling functions or function blocks ............................................ 63

    9.5. Saving the contents ....................................................................64

    9.6. Exiting the worksheet .................................................................. 65

    10.Compiling ............................................................................... 67

    10.1.Inserting configurations, resources and tasks ............................ 67

    10.2.Associating programs to tasks ................................................... 68

    10.3.Compiling the project ................................................................. 68

    11.Printing your project with a stylish pagelayout .................. 71

    11.1.Calling the pagelayout editor ...................................................... 71

    11.2.Creating a new pagelayout ........................................................ 72

    11.3.Editing the pagelayout ................................................................ 73

    11.4.Editing environment items .......................................................... 75

    11.5.Saving the contents .................................................................... 78

    11.6.Exiting the worksheet ................................................................. 79

    11.7.Assigning the pagelayout to the project ..................................... 79

    11.8.Printing the project ..................................................................... 80

    12.Making a backup of your project files ................................. 83

    12.1.Zipping the project files .............................................................. 83

    12.2.Unzipping the project files .......................................................... 84

  • 8/18/2019 Relay Configuration Tool Tutorial 1MRS751903 MEM

    7/100

    1MRS751903-MEN

    ABB Automation 7

    Relay Configuration Tool

    Tutorial 1. Introduction

    11. Introduction

    Relay Configuration Tool

    • The documentation for Relay Configuration Tool.

    • Conventions used in this tutorial.

    1.1. What is Relay Configuration Tool?

    Relay Configuration Tool is a standard programming system for IEC designed PLCs

    and traditional PLCs. It is based on the standard IEC 1131-3 and includes the full

    range of IEC features.

    Relay Configuration Tool allows especially handling several configurations and

    resources within one project, including libraries. A comfortable tool for project

    documentation is implemented and all features of a system based on windows

    technology can be used, such as zooming, scrolling, toolbar and drag & drop.

    Relay Configuration Tool consists of a PLC independent kernel for programming in

    the various IEC programming languages. The independent kernel is completed with

    specific parts adapted to the different PLCs.

    1.2. What kind of documentation do you get?

    The documentation for Relay Configuration Tool is divided into several parts. For

    an understanding of all parts, we are assuming knowledge about using Microsoft®1

    Windows®2.

    The  gives you a short introduction on how Relay

    Configuration Tool works and how you can start working with it. The Quick Start

    Reference is dedicated to people who want to start quickly without reading too

    much.

    The  provides all background information for a better

    understanding of the concepts of the Relay Configuration Tool and of the operations

    to be done. All steps from calling Relay Configuration Tool, editing worksheets up

    to exiting Relay Configuration Tool are described with several examples and

    figures. The tutorial should be used by people wishing to get a complete overview

    about what to do with Relay Configuration Tool for realizing a PLC program.

    The  which can be called everywhere in Relay Configuration

    Tool by pressing F1, provides detailed and reference information for all parts inRelay Configuration Tool. It should be used by an experienced user having a

    concrete problem and searching for detailed information.

    1.3. Symbols and textual conventions

    The following symbols are used in this tutorial:

    1. Microsoft is a registered trademark of Microsoft Corporation.

    2. Windows is a registered trademark of Microsoft Corporation.

  • 8/18/2019 Relay Configuration Tool Tutorial 1MRS751903 MEM

    8/100

    8 ABB Automation

    1MRS751903-MENRelay Configuration Tool

    1. Introduction Tutorial

    is used for enumeration and for an operation which has to be

    done.

    is used for an operation which is optional.

    is used for a sequence of operations to be done with the mouse.

    is used for a sequence of operations to be done with the

    keyboard.

    is used to provide important information.

    The following textual conventions have been set up for this tutorial:

    ’ commas are used for names of icons, menu items or proper

    names of objects e.g. menu item ’Cut’; function block ’Level’.

    brackets are used for the name of keys on your keyboard and for

    words, you have to enter.

    + is used if you have to press two keys at the same time.

    editor name  Italic letters are used as place holders for proper names.

  • 8/18/2019 Relay Configuration Tool Tutorial 1MRS751903 MEM

    9/100

    1MRS751903-MEN

    ABB Automation 9

    Relay Configuration Tool

    Tutorial 2. Getting familiar with IEC1131

    2

    2. Getting familiar with IEC 1131

    • Purpose and contents of IEC 1131.

    • Configuration elements.

    • POUs, programs, function blocks and functions.

    • Variables and data types.

    • Programming languages.

    2.1. What is IEC 1131?

    The standard IEC 1131 has been established to standardize the multiple languages,

    sets of instructions and different concepts existing in the field of automatization

    systems. The great variety of PLC concepts has led to an incompatibility between

    the different PLC platforms and manufacturers. The result was a great effort to be

    made for trainings, hard- and software investments.

    IEC 1131 standardizes the programming languages, the interfaces between PLC and

    programming system, the sets of instructions and the handling and structuring of

    projects. The advantage of using IEC 1131 conform PLCs and programming

    systems is a portability of all platforms and the use of same concepts reducing costs

    for automatization systems.

    The standard consists of several parts and technical reports. The third part of the

    standard is dedicated to programming languages.

    Obviously this standard must have a great influence on the concept, structure,

    features and their handling of a programming system such as Relay Configuration

    Tool and of the manner of programming with it.

    The main changes that have come with IEC 1131-3 are:

    • Declaration of variables is similar to the variable declaration in higher

    programming languages.

    • Declaration of data types is possible.

    • Global and local data can be differentiated.

    • Programming means symbolic programming.

    For a better comprehension of Relay Configuration Tool and an easier

    programming, some IEC basis and their realization are described in the following

    sections.

    2.2. Configuration elements

    An IEC 1131-3 conform PLC programming system should try to reflect the

    hardware structure or the structure of automatization problems. Therefore, IEC

    1131-3 prescribes configuration elements, which have to be declared in the PLC

    program to reflect this structure.

    These configuration elements are basically:

    • Configurations

  • 8/18/2019 Relay Configuration Tool Tutorial 1MRS751903 MEM

    10/100

    10 ABB Automation

    1MRS751903-MENRelay Configuration Tool

    2. Getting familiar withIEC 1131

    Tutorial

    • Resources

    • Tasks

    2.2.1. Configurations

    A configuration can be compared to a programmable controller system, e.g. a rack.

    In a configuration, global variables can be declared. The communication between

    several configurations is done with access paths using VAR_ACCESS. A

    configuration consists of one or several resources.

    2.2.2. Resources

    A resource can be compared to a CPU which can be inserted in the rack. In a

    resource, global variables can be declared. In a resource, one or several tasks can be

    executed.

    2.2.3. Tasks

    Tasks determine the time scheduling of the invocation of different programsassociated with them. This means that programs have to be associated to tasks. The

    properties of the task determine the time scheduling. The information for the time

    scheduling is not available in programs and function blocks, but it is stored in the

    associated task.

    IEC 1131-3 describes different time scheduling which lead to three different task

    types:

    •    are activated in a certain time interval and the program is executed

    periodically.

    •    will be activated if an error occurs in a different task.

    •    are activated if a certain event has happened, e.g. avariable has reached a certain value.

    2.3. POUs, Programs, function blocks and functions

    2.3.1. Program organization units - POUs

    Program organization units or POUs are the language elements of a PLC program.

    They are small, independent software units containing the program code. The name

    of a POU should be unique within the project. POUs must not be recursive. This

    means that the invocation of a POU should not cause the invocation of a POU of the

    same type. Formerly POUs were called program modules

    In IEC 1131-3 three types of POUs are distinguished referring to their different use:

    • Functions

    • Function blocks

    • Programs

    2.3.1.1. Functions

    Functions are POUs with multiple input parameters and exactly one output

    parameter. They do not have any internal memory. Consequently, calling a function

  • 8/18/2019 Relay Configuration Tool Tutorial 1MRS751903 MEM

    11/100

    1MRS751903-MEN

    ABB Automation 11

    Relay Configuration Tool

    Tutorial 2. Getting familiar with IEC1131

    2

    with the same values always results in the same return value. The return values can

    be either single data types or multi-element data types such as arrays or structures.

    IEC 1131-3 lists different types of standard functions:

    • Type conversion functions, such as INT_TO_REAL

    • Numerical functions, such as ABS.• Standard arithmetic functions, such as ADD and MUL.

    • Bit-string functions, such as AND and OR.

    • Selection and comparison functions, such as SEL and GE.

    2.3.1.2. Function blocks

    Function blocks are POUs with multiple input and output parameters. They do have

    an internal memory. The value that a function block returns depends of the value of

    its internal memory.

    IEC 1131-3 lists different types of standard function blocks:

    • Bistable elements such as SR and RS.

    • Edge detection function blocks, such as R_TRIG and F_TRIG.

    • Counters such as CTU and CTD.

    • Timer function blocks such as TON and TOF.

    2.3.1.3. Programs

    Programs are POUs which contain a logical combination of functions and function

    blocks according to the needs of the controller process. The behaviour and the use

    of programs are similar to function blocks. Programs can have input and output

    parameters as well as internal memories or variables. Programs must be assigned to

    tasks.

     

    2.3.2. Instantiation

    For reusing function block definitions IEC 1131-3 provides the possibility of

    instantiation. This means that the function block code body or a program is defined

    once and that its internal memory is allocated to different instances, different

  • 8/18/2019 Relay Configuration Tool Tutorial 1MRS751903 MEM

    12/100

    12 ABB Automation

    1MRS751903-MENRelay Configuration Tool

    2. Getting familiar withIEC 1131

    Tutorial

    memory regions. Each instance has an associated identifier and contains the input

    and output parameter and the internal memory of the function block or program. A

    function block can be instantiated in another function block or in a program. The

    instance name of a function block has to be declared in the VAR declaration of the

    program or function block where it is going to be used. Programs can only be

    instantiated within resources.

    2.3.3. Declaration and instruction part of a POU

    Every POU consists of two different parts: The declaration part and the code body

    part.

    In the  all necessary variables are declared. These variables are all

    variables, which are used while editing the PLC program.

    The  of a POU is the part in which the instructions

    are programmed in the desired programming language.

    2.4. Variables and data types are used instead of direct addressing of memory regions in IEC 1131-3

    conform programming systems. Variables are names or placeholders, which are

    given by the user and which are representing the corresponding data. The variable is

    assigned automatically to a memory region while compiling. IEC 1131-3

    distinguishes different types of variable declarations e.g. VAR or VAR_INPUT.

    Variables with its properties are declared in the declaration part of a POU. The

    declaration consists basically of the variable name and the data type.

    The most important elements of a variable declaration are shown in the following

    example:

    VAR Variable type

    level : INT:=42 Name : data type := Initial value

    VAR_END End of variable declaration

     determine what kind of value the variable can have. Data types define

    the initial value, range of possible values and the number of bits.

    IEC 1131-3 distinguishes three kinds of data types:

    • Elementary data types.

    • Generic data types.

    • Derived data types.  are pre-defined data types whose range of possible values

    and number of bits is prescribed by IEC 1131-3. Elementary data types are e.g. BIT,

    WORD, BOOL or DATE.

     are data types, which include groups of elementary data types.

    They are called e.g. ANY_BIT or ANY_REAL. ANY_REAL includes e.g. the

    elementary data types REAL and LREAL. Generic data types are necessary to

    define what kind of elementary data types can be connected to inputs or outputs of

    functions or function blocks. If a function block can be connected with ANY_REAL

    it means that variables of the data types REAL and LREAL can be connected.

  • 8/18/2019 Relay Configuration Tool Tutorial 1MRS751903 MEM

    13/100

    1MRS751903-MEN

    ABB Automation 13

    Relay Configuration Tool

    Tutorial 2. Getting familiar with IEC1131

    2

     are user or manufacturer defined data types which can vary

    from PLC to PLC type. They are defined with a TYPE... END_TYPE declaration.

    Derived data types can be enumerated data types, subranges, structures or arrays.

    The most important elements of a user defined data type declaration are shown in

    the following example:

    TYPE Begin of data type declaration

    type1 : INT (-23..46) name1 : subrange data type

    type2 : type1 name2 : subrange data type

    END_TYPE End of data type declaration

    2.5. Programming languages

    IEC 1131-3 defines the syntax of 5 programming languages, prescribes a certain

    representation and describes the different elements that can be used in the language.

    The programming languages supported by Relay Configuration Tool can bedifferentiated by the physical appearance into 1 textual language and 2 graphical

    languages.

    The  is Instruction List (IL).

    The  are Function Block Diagram (FBD) and Sequential

    Function Chart (SFC).

    2.5.1. Instruction List - IL

    A code body programmed in the textual language IL is composed of a sequence of

    instructions. Each instruction begins at a new line and shall contain an operator.

    Modifier and one or more operands are optional. Comments can be inserted at theend of a line using asterisks and brackets. Labels can be added at the beginning of a

    line if jumps are used.

    The manner how to edit IL and the basic characteristics of the programming

    language are described in the chapter “Editing in IL” on page 61.

    2.5.2. Function Block Diagram - FBD

    A code body programmed in the graphical language FBD is composed of functions

    and function blocks which are connected with each other or with variables using

    lines. These lines can also be connected with each other putting together several

    information or multiplying the information. In FBD networks, it is not possible to

    connect outputs with outputs.

    The set of connected objects is called FBD network. Comments can be entered using

    asterisks and brackets.

    The programming language FBD has become a widely usable programming

    language for easy creating complicated networks with function or function blocks

    calls.

    The manner how to edit FBD and the basic characteristics of the programming

    language are described in the chapter “Editing in FBD” on page 41.

  • 8/18/2019 Relay Configuration Tool Tutorial 1MRS751903 MEM

    14/100

    14 ABB Automation

    1MRS751903-MENRelay Configuration Tool

    2. Getting familiar withIEC 1131

    Tutorial

    2.5.3. Sequential Function Chart - SFC

    A code body programmed in the graphic language SFC is composed of steps and

    transitions which are connected with directed links. Associated with each step is one

    or more actions and with each transition a transition condition.

    In a step the actions to be executed while the step is active are programmed. A stepcan be either active or inactive.

    A transition represents the condition in which the process can pass from one step to

    another.

    The action block can be any Boolean variable or another code body worksheet. The

    transition condition can be a directly connected Boolean expression or another code

    body worksheet. If you are editing another code body this code body is called detail.

    The set of connected objects is called SFC network. A typical SFC network forms a

    closed loop and should have one initial step. Simultaneous or alternative branches

    can be inserted in the SFC network. Comments can be entered using asterisks and

    brackets.The manner how to edit SFC and the basic characteristics of the programming

    language are described in the chapter “Editing in SFC” on page 47.

  • 8/18/2019 Relay Configuration Tool Tutorial 1MRS751903 MEM

    15/100

    1MRS751903-MEN

    ABB Automation 15

    Relay Configuration Tool

    Tutorial 3. Realization of the IEC1131-3

    3

    3. Realization of the IEC 1131-3

    • Projects

    • Libraries

    • Data types

    • POUs

    • Configuration elements

    3.1. Project

    Relay Configuration Tool is a programming system based on the windows

    technology using the graphic user interface of MS-Windows. Therefore the IEC

    1131-3 principles are mostly realized graphically with symbols and icons or dialogs

    are used where properties of elements can be set.

    A project represents the set of configuration elements, POUs, libraries and data

    types of one automatization system. This means that for realizing a PLC program

    you have to create a project, which contains all necessary elements. This project with

    its elements is represented in a tree structure, the project tree.

     

    The subtrees which are always parts of the project tree can have one or several child

    elements.

    3.2. Libraries

    Libraries in Relay Configuration Tool are other projects which have been announced

    as libraries. You can reuse the programs, function blocks, functions and the user

    defined data types of the library in the new project you are editing. Libraries have an

    own subtree in the project tree.

       

  • 8/18/2019 Relay Configuration Tool Tutorial 1MRS751903 MEM

    16/100

    16 ABB Automation

    1MRS751903-MENRelay Configuration Tool

    3. Realization of the IEC1131-3

    Tutorial

    The subtree ’Libraries’ consists of two or more icons. The first icon is a directory

    node. The child element of this directory node represents an announced library. In

    Figure 3.2.-1 you can see the announced library ’RECLIB01’.

    3.3. Data types

    Data types in Relay Configuration Tool are user defined or firmware data types.

    These data types have their subtree in the project tree where they can be viewed or

    edited.

       

    The subtree ’Data types’ consists of two or more icons. The first icon of the subtree

    ’Data types’ is a directory node. The child elements of the directory node are the data

    type worksheets where the data types are edited. In Figure 3.3.-1 you can see the data

    type worksheet ’type1’.

    3.4. POUs in Relay Configuration Tool

    In Relay Configuration Tool programs, function blocks and functions can be edited.

    These POUs are represented in the project tree with an own subtree: The subtree’Logical POUs’.

       

    A POU consists of several worksheets. One set of worksheets builds one POUs.

    These worksheets are:

    • A  where texts describing the POU for documentation

    purposes can be edited. These worksheets are optional.

  • 8/18/2019 Relay Configuration Tool Tutorial 1MRS751903 MEM

    17/100

    1MRS751903-MEN

    ABB Automation 17

    Relay Configuration Tool

    Tutorial 3. Realization of the IEC1131-3

    3

    • A   where the declaration of the local variables is done. This

    worksheet contains the declaration part described by IEC 1131-3.

    • A  where the instructions in the available programming

    languages can be edited. This worksheet contains the instruction part described in

    IEC 1131-3.

    These three worksheets are represented graphically in Relay Configuration Tool by

    icons:

     

    In the case of a SFC POU, you have two more icons, the directory nodes for actions

    and transitions:

       

    3.5. Configurations elements in Relay Configuration Tool

    Configuration elements are represented graphically in the project tree in Relay

    Configuration Tool. They are grouped together in the subtree 'Physical hardware'.

  • 8/18/2019 Relay Configuration Tool Tutorial 1MRS751903 MEM

    18/100

    18 ABB Automation

    1MRS751903-MENRelay Configuration Tool

    3. Realization of the IEC1131-3

    Tutorial

       

    Relay Configuration Tool reflects the structure of configuration elements

    determined by the PLC. Therefore, the configuration elements available in the

    subtree ’Physical Hardware’ may differ from PLC to PLC.

    In general one or several configurations can be used in Relay Configuration Tool. In

    every configuration, one or several resources can be declared. Several tasks with

    their associated programs can be used within the resources.

  • 8/18/2019 Relay Configuration Tool Tutorial 1MRS751903 MEM

    19/100

    1MRS751903-MEN

    ABB Automation 19

    Relay Configuration Tool

    Tutorial 4. Getting started withRelay Configuration Tool

    4

    4. Getting started with Relay Configuration Tool

    • Calling Relay Configuration Tool

    • Using mouse and keyboard

    • The user interface

    • Using help for Relay Configuration Tool

    • Editors in Relay Configuration Tool

    • Exiting Relay Configuration Tool

    • Exiting the worksheet

    4.1. Calling Relay Configuration Tool

    Relay Configuration Tool is started through the Project Structure Navigator’s object

    tool list.

    4.2. Using mouse and keyboard

    Relay Configuration Tool supports full use of the mouse or the keyboard. For

    beginners it may be easier to start working with the mouse because it does not make

    necessary to learn the keyboard shortcuts. In rough industrial environments, the

    keyboard may be more appropriate.

    This tutorial explains both: the use of mouse and keyboard. In the next sections the

    general use of mouse and keyboard for the menu and toolbar are described. The use

    of the mouse and the keyboard in the different editors is described in the following

    chapters.

    4.3. User interface

    The user interface you get having started Relay Configuration Tool consists

    basically of four parts: Menu, toolbar, main screen and status bar.

  • 8/18/2019 Relay Configuration Tool Tutorial 1MRS751903 MEM

    20/100

    20 ABB Automation

    1MRS751903-MENRelay Configuration Tool

    4. Getting started withRelay Configuration

    Tutorial

     

     

    4.4. Menu

    The menu is represented in the line below the title bar. In the menu bar you find

    several submenus.

    • The can be used to handle and to save all your projects. It

    contains also commands for printing, calling the pagelayout editor and preview.

    For the project tree editor the submenu 'File' has been extended with menu itemsfor special operations.

    • The contains all commands necessary for editing such as

    marking, choosing different working modes or cutting and pasting.

    • The  has been implemented for selecting objects.

    • The  is only available if you are using the graphic or the

    pagelayout editor. It is used to insert objects, which can be used in these editors.

    • The can be used for designing what you get on your screen.

    You can display e.g. page borders or a grid for better organizing the content of

    your worksheets.

  • 8/18/2019 Relay Configuration Tool Tutorial 1MRS751903 MEM

    21/100

    1MRS751903-MEN

    ABB Automation 21

    Relay Configuration Tool

    Tutorial 4. Getting started withRelay Configuration Tool

    4

    • The consists of different commands for starting the compilation

    after editing.

    • The offers you different commands for the online mode which

    is used for debugging.

    • The  can be used to arrange the windows and symbols on

    your screen.

    • The contains all commands for calling help.

    The menu items of these submenus change according to the program part or

    editor you are working with. In the context-sensitive help it is explained exactly

    where the different menu items are available.

    1. Do a left mouse click on the submenu 'Layout'. The submenu is opened and you

    can see the menu items.2. Do a left mouse click on the menu item 'Zoom in'. The project tree is zoomed in

    once.

     

    1. Press + . The submenu is opened and you can see the menu items

    2. Press as it is the underlined character of the menu item 'Zoom in'. The

    project tree is zoomed in.

    All submenus or menu items and dialog fields and boxes can be called pressing the

    underlined character of the corresponding word.

    4.4.1. Toolbar

    The toolbar is located below the menu bar. It consists of one or two lines of different

    icons. The icons differ from editor to editor. In the context-sensitive help, each icon

    is explained. The toolbar has been implemented for realizing quickly often used

    operations with the mouse. In those cases one mouse click on a toolbar icon leads to

    the same result as doing several steps without the toolbar.

    In the toolbar two different parts can be distinguished: The general part and the

    specific part.

    • The  contains icons, which are available everywhere in Relay

    Configuration Tool.

    • The  contains icons, which can be used only in the editors.

       

  • 8/18/2019 Relay Configuration Tool Tutorial 1MRS751903 MEM

    22/100

    22 ABB Automation

    1MRS751903-MENRelay Configuration Tool

    4. Getting started withRelay Configuration

    Tutorial

    1. Do a left mouse click on the icon ’Zoom in’. The project tree is zoomed in

    once.

    4.4.2. Keyboard Shortcuts

    The same idea of the toolbar minimizing the steps to do for reaching a certain

    function was the reason for implementing keyboard shortcuts. Keyboard Shortcuts

    can be used to reach the purpose with pressing only one key or a key combination.

    In Relay Configuration Tool, several keyboard shortcuts can be used. In the context-

    sensitive help function, a list of these shortcuts is available.

     

    1. Turn on ’Num Lock ’ on your keyboard if it is not activated.2. Press . The project tree is zoomed in once.

    4.4.3. Main screen and workspace

    On the main screen (see Figure 4.3.-1) of Relay Configuration Tool you find all

    opened windows. Normally you can always see the window of the project tree editor

    representing the project. Other windows on the main screen can be worksheets of the

    text editors or the graphic editor. You can change the size and position of these

    windows. It is also possible to arrange several windows in a desired combination and

    then save this arrangement as a workspace. This way you can easily create several

    workspaces for different phases of using Relay Configuration Tool.

    1. Choose the menu item ’Save Workspace’ in the submenu ’File’. The dialog ’Save

    Workspace as’ appears.

    2. Enter a name for the workspace.

    3. Do a left mouse click on the button ’OK’ to confirm the dialog.

     

    1. Press + . The submenu is opened.

    2. Press . The dialog ’Save Workspace as’ appears.

    3. Enter a name for the workspace.

    4. Press < > to confirm the dialog.

    You can open this new workspace you have created using the menu item ’Open

    Workspace’ in the submenu ’File’.

    4.4.4. Status bar

    The status bar contains several fields where different kinds of messages are

    displayed while you are working with Relay Configuration Tool.

  • 8/18/2019 Relay Configuration Tool Tutorial 1MRS751903 MEM

    23/100

    1MRS751903-MEN

    ABB Automation 23

    Relay Configuration Tool

    Tutorial 4. Getting started withRelay Configuration Tool

    4

    The message in the left corner of the status bar provides information about

    operations you have done or displays system messages of Relay Configuration Tool.

    If you choose e.g. a menu item a short information on this menu item is given in the

    message field of the status bar.

    At the right, the available RAM memory is displayed. The last field on the right is

    used to indicate the starting-up process of Relay Configuration Tool.

    4.5. Using help for Relay Configuration Tool

    Relay Configuration Tool offers you a context-sensitive help function which

    contains topics for all parts of Relay Configuration Tool. Help is separated into two

    or more parts: A general help with all general help topics and one or more specific

    help with PLC specific topics.

    Both, the general and the specific help have a hierarchical structure. You get three

    types of topics:

    •   , describing the general handling of editors.•   , giving background information about an object that has been used

    in an editor.

    •   , explaining the fields of the dialogs, and what to do with them.

    All these topics can be called context-sensitive. But it is also possible to call the table

    of contents of help for getting an overview and then choosing the topics to read.

    1. Choose the menu item 'Index' in the submenu 'Help'. The table of contents of the

    general help appears.

    1. Make sure that the project tree is the active window.

    2. Choose the menu item 'Current Window' in the submenu 'Help'. The main topic

    for the project tree editor appears.

    1. Do a left mouse click on an icon in the project tree to mark it.

    2. Choose the menu item 'Current Object' in the submenu 'Help'. The topic for the

    marked object appears.

    1. Choose the menu item 'Zip Project' in the submenu 'File'. The dialog 'Zip

    Project' appears.

    2. Do a left mouse click on the button 'Help' of the dialog. The help topic for this

    dialog appears.

     

    1. Press + . The submenu 'Help' is opened.

    2. Press . The table of contents of the general help appears.

  • 8/18/2019 Relay Configuration Tool Tutorial 1MRS751903 MEM

    24/100

    24 ABB Automation

    1MRS751903-MENRelay Configuration Tool

    4. Getting started withRelay Configuration

    Tutorial

     

    1. Press . The submenu ’Help’ is called.

    2. Press . The main topic for the project tree editor appears.

     

    1. Press < > to mark an icon of the project tree.

    2. Press . The topic for the marked object appears.

     

    1. Press + . The submenu ’File’ is opened.

    2. Press . The dialog ’Zip Project’ appears.

    3. Press . The help topic for this dialog appears.

    In Relay Configuration Tool help, you have the possibility of using, either the menu,

    the buttons or the green, underlined phrases. These green, underlined words are

    called jumps and can be used to move quickly to other topics for getting more

    information. Another possibility of rapidly accessing information is using the button’Search’. You get a dialog where you can choose the topic you want to call. The list

    of topics contains all headings of available topics.

    The menu bar, buttons and jumps are shown for the table of contents of the general

    help in the following figure:

  • 8/18/2019 Relay Configuration Tool Tutorial 1MRS751903 MEM

    25/100

    1MRS751903-MEN

    ABB Automation 25

    Relay Configuration Tool

    Tutorial 4. Getting started withRelay Configuration Tool

    4

     

    1. Do a left mouse click on an underlined word of the help page. The

    corresponding topic appears.

    4.6. Editors in Relay Configuration Tool

    4.6.1. The project tree editor - powerful program organization

    The project tree editor is a comfortable and powerful tool for program organization

    and project management. It permits structuring the project within four subtrees. So

    in the subtree ’Libraries’, the project tree editor permits announcing libraries. In the

    subtree ’Data types’ and in the subtree ’Logical POUs’ new worksheets can be added

  • 8/18/2019 Relay Configuration Tool Tutorial 1MRS751903 MEM

    26/100

    26 ABB Automation

    1MRS751903-MENRelay Configuration Tool

    4. Getting started withRelay Configuration

    Tutorial

    or unnecessary ones can be deleted. In the subtree ’Physical Hardware’ all

    configuration elements can be inserted. Programs can be associated to tasks.

    In the project tree editor a clipboard can be used with Cut & Paste. Furthermore, the

    specific part of the toolbar offers a quick realization of the main operations.

    4.6.2. The graphic editors - easy programming in SFC and FBD

    The graphic editor is one of the editors which has been implemented for

    programming the code body worksheets of the POUs. Programming in SFC and

    FBD can be done. Mixing the programming languages is possible. Relay

    Configuration Tool checks all entries of the user so that only legal structures can be

    entered. While inserting new elements, the size of the already existing structures is

    adapted automatically.

    In the graphic editor general features, such as search and replace, cut & paste or drag

    & drop can be used.

    The specific part of the toolbar offers a quick realization of the main operations.

    4.6.3. The text editor - easy programming in IL

    The text editors have been implemented for programming the code body worksheets

    of the POUs. Programming in IL is possible in the text editor. Text editors can also

    be used for entering user defined data types, I/O configurations or variable

    declarations.

    The handling of the text editors is similar to the handling of a normal ASCII-editor.

    Furthermore, some input dialogs ease the programming for novices who do not

    know the syntax of the languages. More experienced user may prefer typing the

    instructions.

    In the text editors, general features such as search and replace, cut and paste can beused so that a comfortable programming is possible. Furthermore, the specific part

    of the toolbar offers a quick realization of the main operations.

    4.6.4. The pagelayout editor - rapid pagelayout styling for printing

    The pagelayout editor has been implemented for a rapid styling of pagelayouts.

    These pagelayouts are designed pages with an area in which the content of the code

    body worksheet is going to be printed. The objects you can arrange on your

    pagelayout are e.g. hierarchical page numbers, printing date and time or bitmaps.

    It is also possible to create different sets of objects, the so called environment items,

    which are available within a certain project or for a certain user. Furthermore, you

    can use several features, such as drag & drop.

    The pagelayouts that you have edited can be assigned to a whole project or to single

    worksheets so that you can decide whether you want to print the whole project with

    one pagelayout or with different pagelayouts. You can add a table of contents to your

    project documentation if you want.

    A preview can be used to view the result of a pagelayout and the assigned worksheet

    so that you can check it before printing.

  • 8/18/2019 Relay Configuration Tool Tutorial 1MRS751903 MEM

    27/100

    1MRS751903-MEN

    ABB Automation 27

    Relay Configuration Tool

    Tutorial 4. Getting started withRelay Configuration Tool

    4

    4.6.5. Exiting Relay Configuration Tool

    You can exit Relay Configuration Tool whenever you want. It doesn ’t matter if one

    or several editors are still open or if you have already closed all windows. If you

    have not saved the changes you have done, a dialog appears and you can either save

    the changes or close the corresponding windows without saving it.

    1. Choose the menu item ’Exit’ in the submenu ’File’. Relay Configuration Tool is

    closed.

    To exit Relay Configuration Tool you can also do a left mouse double click on

    the icon of the system menu on the left corner on the top of the Relay Configuration

    Tool user interface.

     

    1. Press + . The submenu ’File’ is opened.

    2. Press . Relay Configuration Tool is closed.

    You can use also the keyboard shortcut + to exit Relay

    Configuration Tool.

  • 8/18/2019 Relay Configuration Tool Tutorial 1MRS751903 MEM

    28/100

    28 ABB Automation

    1MRS751903-MENRelay Configuration Tool

    4. Getting started withRelay Configuration

    Tutorial

  • 8/18/2019 Relay Configuration Tool Tutorial 1MRS751903 MEM

    29/100

    1MRS751903-MEN

    ABB Automation 29

    Relay Configuration Tool

    Tutorial 5. Editing the project struc-ture

    5

    5. Editing the project structure

    • Changing properties of POUs.

    • Inserting POUs.

    • Inserting worksheets.

    • Announcing libraries.

    • Deleting worksheets, POUs or libraries.

    5.1. Relay Configuration Tool start-up

    Once Relay Configuration Tool starts up, it is already assigned a project to open by

    the base software. The project will be opened once you have typed the correct

    password for the project in the 'Relay Configuration Tool log-in' dialog.

       

     

    1. Enter your password.

    2. Confirm the dialog. The attached project is opened.Please note that, further in this document the sample Relay Configuration Tool

    project shown in several figures, originates from an earlier version of Relay

    Configuration Tool being somewhat irrelevant considering the projects shipped with

    CAP 505 v. 1.0.1 or above.

    In general, your project tree looks like the figure shown below:

  • 8/18/2019 Relay Configuration Tool Tutorial 1MRS751903 MEM

    30/100

    30 ABB Automation

    1MRS751903-MENRelay Configuration Tool

    5. Editing the projectstructure

    Tutorial

     

    The project ’Untitled’ includes automatically two POUs: the programs ’ContComo’ 

    and ’ProtMeas’. The program ’ContComo’ has 7 worksheets:

    • The description worksheet 'ContComT' for the POU documentation(optional).

    • The variable worksheet 'ContComV' for the declaration of variables and function

    block instances.

    • The code body worksheets 'Condmon', 'Alarms', 'DC', 'CB' and 'SWGRPs' for the

    code body definition

    It is possible to change the properties of this program or to leave it and to insert new

    POUs or worksheets.

    5.2. Changing the properties of existing POUs

    Let us assume that you want to use the program 'Untitled' just with a different name.

    In those cases you have to change the properties of this program.

    Everywhere in Relay Configuration Tool you can change the properties of

    existing objects doing a right mouse double click on the object or marking it and

    pressing + < >.

    1. Do a right mouse double click on the icon ’Program name ' for

    changing the properties. The dialog 'Properties' appears.

  • 8/18/2019 Relay Configuration Tool Tutorial 1MRS751903 MEM

    31/100

    1MRS751903-MEN

    ABB Automation 31

    Relay Configuration Tool

    Tutorial 5. Editing the project struc-ture

    5

     

    1. Press < > or < > to mark the icon ’Program name ’.

    2. Press + < > for changing the properties. The dialog

    ’Properties’ appears.

     

     

    1. Enter a new name of the POU if you want.

    2. Change the POU type if you want.

    3. Confirm the dialog.

    5.3. Inserting new POUs

    The next steps you would certainly like to do is inserting new POUs in different

    programming languages.

    1. Do a left mouse click on the icon ’Logical POU’ in the project tree to

    mark it.

    2. Do a left mouse click on the icon ’Insert’ in the toolbar. The dialog

    ’Insert’ appears.

  • 8/18/2019 Relay Configuration Tool Tutorial 1MRS751903 MEM

    32/100

    32 ABB Automation

    1MRS751903-MENRelay Configuration Tool

    5. Editing the projectstructure

    Tutorial

     

    1. Press < > or < > to mark the icon ’Logical POU’.

    2. Press . The dialog ’Insert’ appears.

        

    1. Enter a name for your new POU.

    2. Choose the POU type.

    3. Choose the programming language.

    4. Confirm the dialog. The new POU with its worksheets is inserted in the project

    tree.

    Some programming languages may be greyed according to the number of the

    available editors.

    The new worksheets are marked with an asterisk in the project tree. These

    asterisks mean that the worksheets has been inserted or changed but not yet

    compiled.

    5.4. Inserting worksheets

    It is also possible to insert new worksheets in POUs. This feature is necessary if you

    have big code bodies and you want to split them into several pieces for better

    orientation. If you want to insert new worksheets in POUs the language of the new

    worksheet is determined by the POU language. It is not possible to insert an IL

    worksheet in a FBD POU. Inserting new worksheets is similar to inserting new

    POUs. Just the icons, which have to be marked, are the following:

  • 8/18/2019 Relay Configuration Tool Tutorial 1MRS751903 MEM

    33/100

    1MRS751903-MEN

    ABB Automation 33

    Relay Configuration Tool

    Tutorial 5. Editing the project struc-ture

    5

    • For inserting new worksheets in an IL POU mark the icon 'Worksheet in

    IL'.

    • For inserting new worksheets in an SFC POU mark the icon 'Worksheet in SFC'.

    • For inserting new worksheets in an FBD POU mark the icon 'Worksheet in FBD'.

    The steps to be done for inserting new data type worksheets in the subtree

    ’Data types’ are also similar to the steps described for inserting new POUs.

    • For inserting new data type worksheets mark the icon 'Data types'.

    5.5. Announcing libraries

    Having already finished one project, you can reuse these POUs and worksheets in a

    new project. This feature makes superfluous the definition of code bodies, which

    already exists. To reuse POUs and worksheets of an existing project you have to

    announce this project as a library of your new project. You can use the programs,

    function blocks and functions of a library but you can not view or edit them.

    1. Do a left mouse click on the icon ’Libraries’ to mark it.

    2. Do a left mouse click on the icon ’Insert’ in the toolbar. The dialog

    ’Announce library’ appears.

    3. Choose the project you want to announce as a library.

    4. Do a left mouse click on the button ’OK’ to confirm the dialog.

     

    1. Press < > or < > to mark the icon ’Libraries’.

    2. Press . The dialog ’Announce Library’ appears.

    3. Choose the project you want to announce as a library.

    4. Press < > to confirm the dialog.

    The libraries, that are shipped with CAP 505, are installed to the directory:

    Your project tree should look like the following figure now:

  • 8/18/2019 Relay Configuration Tool Tutorial 1MRS751903 MEM

    34/100

    34 ABB Automation

    1MRS751903-MENRelay Configuration Tool

    5. Editing the projectstructure

    Tutorial

       

    5.6. Deleting worksheets, POUs or libraries

    Assuming, that you wanted to insert a different library it is possible to delete the

    library ’REFLIB01’.

    1. Do a left mouse click on the icon ’Library name’  to mark it.

    2. Do a left mouse click on the icon ’Delete’ in the toolbar. A message

    box appears.3. Do a left mouse click on the button ’OK’ to confirm the dialog. The library is

    deleted.

     

    1. Press < > or < > to mark the icon ’Library name ’.

    2. Press . A message box appears.

    3. Press < > to confirm the dialog. The library is deleted.

    It is also possible to delete worksheets or whole POUs. In those cases, the

    corresponding icons of the worksheets or POUs have to be marked.

    Having confirmed the message box there is no way of restoring the data. Use thisfeature very carefully!

  • 8/18/2019 Relay Configuration Tool Tutorial 1MRS751903 MEM

    35/100

    1MRS751903-MEN

    ABB Automation 35

    Relay Configuration Tool

    Tutorial 6. Declaring variables anduser defined data types

    6

    6. Declaring variables and user defined data types

    • Calling the text editor with a variable worksheet.

    • Declaring variables.

    • Instantiation.

    • User defined data types.

    • Calling the data type editor.

    • Declaring user defined data types.

    6.1. Ways how to declare variables in Relay Configuration Tool

    In Relay Configuration Tool, you have three possibilities to declare variables:

    • Declaring a variable while editing a code body.

    • Declaring variables using the variable editor.

    • Declaring variables using the variable dialog.

    The first method means inserting a variable in a code body worksheet which has not

    been declared before. In this case, the dialog 'Automatic variable declaration'

    appears for declaring the variable. After confirming this dialog, the variable

    declaration is autoinserted in the variable worksheet and the new variable is inserted

    in the code body worksheet. This method is described in the corresponding chapters

    for the programming languages and SFC.

    The second method means declaring variables just typing the declarations in the

    variable editor. In this case, the menu item 'Variables As Dialog' in the submenu

    'Layout' has to be unchecked. Doing a left mouse double click on an icon 'Variabledeclaration' in the project tree the variable editor with the corresponding variable

    worksheet is opened.

    The last method means using a dialog instead of the variable editor. In this case, the

    menu item 'Variable As Dialog' in the submenu 'Layout' has to be checked. Doing a

    left mouse double click on an icon 'Variable declaration' in the project tree the dialog

    'Declaration of variables and FB instances' appears. The declaration of variables or

    function block instances can be done using this dialog.

    6.2. Symbolic and located variables

    According to IEC 1131-3 variables are used for programming instead of directaddressing inputs, outputs or flags. In Relay Configuration Tool, either symbolic or

    located variables can be declared.

    A declaration of a symbolic variable consists of a variable name and a data type. A

    declaration of a located variable consists of a variable name, the variable location

    and a data type. An example of declaration of a symbolic and a located variable is

    shown in the following example:

    VAR

      name : data type := initial value

  • 8/18/2019 Relay Configuration Tool Tutorial 1MRS751903 MEM

    36/100

    36 ABB Automation

    1MRS751903-MENRelay Configuration Tool

    6. Declaring variables anduser defined data types

    Tutorial

      name AT%location : data type := initial value

    END_VAR

    The location of the variable consists of a location prefix and a size prefix. Location

    prefixes are I for inputs, Q for outputs and M for internal memory. Size prefixes are

    X for single bits, B for byte, W for word, D for double word and L for long word size.Located variables are stored at the declared logical address and it is up to the

    application programmer to check that no memory address is used twice.

    The initial value is optional. If no initial value is used, the variable is initialized with

    the default initializing value given by the PLC type when starting the program

    execution.

    6.3. Global and local variables

    The scope of each variable, which is determined by the use of the variable keyword,

    is limited either to a POU or to the whole project. Therefore, two types can be

    distinguished:

    • Local variables

    • Global variables

    If a variable can be used only within a POU, it is called local variable. In those cases,

    the variable keywords VAR, VAR_INPUT and VAR_OUTPUT can be used.

    If a variable can be used within the whole project, it is called global variable. It has

    to be declared as VAR_GLOBAL in the global declaration and as

    VAR_EXTERNAL in each POU where it is used.

    It might be useful to declare all I/Os as global variables. In the global variable

    declaration they should be declared as located variables and in theVAR_EXTERNAL declaration of the POU they should be declared as symbolic

    variables. The typing effort in case of address changes is minimized doing it this

    way.

    6.4. Variable declaration keywords

    Up to now we only considered one type of variable declarations: type 'VAR'.

    According to IEC 1131-3, different types of variable declarations exist. For each

    type a different keyword is used, as you can see in the following table:

    Table 6.4.-1 Table of keywords for variable declaration blocks 

    Keyword Variable type / Explanation

    VAR • for internal variables which can be used only within a POU

    • for declaring the instances of function blocks

    • can be used for the declaration of directly represented and located

    variables in programs

    • can be used for the declaration of symbolic variables

    • can be used with the keyword 'RETAIN' for declaring retentive

    variables

  • 8/18/2019 Relay Configuration Tool Tutorial 1MRS751903 MEM

    37/100

    1MRS751903-MEN

    ABB Automation 37

    Relay Configuration Tool

    Tutorial 6. Declaring variables anduser defined data types

    6

    Global variables have to be declared as VAR_GLOBAL in the global variable

    declaration of the project and as VAR_EXTERNAL in the variable declaration of

    the POU.

    6.5. Declaring variables via dialog

    For the next steps, let us assume that you want to declare local variables via dialog.

    1. Make sure that the menu item ’Variables As Dialog’ in the submenu ’Layout’ is

    checked.

    2. Do a left mouse double click on the icon ’Variable declaration’ of the program

    ’Untitled’. The dialog ’Declaration of variables and FB instances’ appears. 

    1. Make sure that the menu item ’Variables As Dialog’ in the submenu ’Layout’ is

    checked.

    2. Press < > or < > mark the icon ’Variable declaration’.

    3. Press < >. The dialog ’Declaration of variables and FB instances’ appears.

    VAR_INPUT • for variables which are inputs to functions, function blocks and

    programs

    • to give a value to the POU coming e.g. from another POU

    • its value is only read within the POU

    • can be used only for the declaration of symbolic variables

    VAR_OUTPUT • for variables which are outputs to function blocks and programs

    • supplies an output value for e.g. other POUs

    • its value is written within the POU

    • it is also allowed to read the value

    can be used only for the declaration of symbolic

    variables

    VAR_IN_OUT • address of the variable is passed by reference

    • the variable can be read or written

    • typically used for complex data types such as strings, arrays and

    structures.

    VAR_EXTERNAL • for global variables in the POU

    • its value is supplied by the declaration of VAR_GLOBAL

    • its value can be modified within the POU• can be used only for the declaration of symbolic variables

    VAR_GLOBAL • for global variables which can be used in all programs and function

    blocks of the project

    • can be used for the declaration of directly represented, located andsymbolic variables

    • can be used with the keyword 'RETAIN' for declaring retentive

    variables

    END_VAR • to finish a variable declaration block

    Table 6.4.-1 Table of keywords for variable declaration blocks 

  • 8/18/2019 Relay Configuration Tool Tutorial 1MRS751903 MEM

    38/100

    38 ABB Automation

    1MRS751903-MENRelay Configuration Tool

    6. Declaring variables anduser defined data types

    Tutorial

       

     

    1. Activate the radio button ’Local Variables’.

    2. Choose a variable keyword in the list box ’Usage’.

    3. Enter a variable name.

    4. Enter a location in the field ’AT’ if you want to declare a located variable.

    5. Choose a data type in the field ’Data type’.

    6. Enter a comment if you want.

    7. Confirm the dialog. Your variable is declared.

    6.6. Instantiation

    IEC 1131-3 provides the possibility of instantiation. Instantiation means that afunction block is defined once and can be used several times in different POUs. As

    function blocks always have an internal memory, it is necessary to store its values

    for each time the function block is used to a different memory region. This is done

    using instance names. The instance name is declared in the variable declaration of

    the POU where the function block is going to be reused. In the following an example

    of a variable declaration for the function block ’FB_exam’ with two instances is

    shown:

    VAR

      drive1 : FB_exam

  • 8/18/2019 Relay Configuration Tool Tutorial 1MRS751903 MEM

    39/100

    1MRS751903-MEN

    ABB Automation 39

    Relay Configuration Tool

    Tutorial 6. Declaring variables anduser defined data types

    6

      drive2 : FB_exam

    END_VAR

    The function block ’FB_exam’, whose code body has been defined somewhere in the

    project, has got two instances. The instance name of the first instance is ’drive1’, of

    the second ’drive2’. In the corresponding code body worksheet, you can use thefunction block ’FB_exam’ twice, entering in both cases the correct instance name.

    Function block instances can be declared via dialog as it is described in the

    section “Declaring variables via dialog” on page 37 of this chapter.

    Function blocks can be instantiated within programs or other function blocks.

    Functions can be called without instantiation because they do not have an internal

    memory.

    In Relay Configuration Tool, the instance tree shows all instances used in your

    project, as it is shown in the following example:

     

    In this example, there is one program instance of both of the programs

    ‘PROTMEAS’ and ‘CONTCOMO’ used in the tasks ‘TASK1’ and ‘TASK2’ 

    respectively.

    Program instances are created just associating a program to a task and entering

    an instance name in the corresponding dialog. Associating programs to tasks is

    described in the chapter “Compiling” on page 67 of this Tutorial.

  • 8/18/2019 Relay Configuration Tool Tutorial 1MRS751903 MEM

    40/100

    40 ABB Automation

    1MRS751903-MENRelay Configuration Tool

    6. Declaring variables anduser defined data types

    Tutorial

  • 8/18/2019 Relay Configuration Tool Tutorial 1MRS751903 MEM

    41/100

    1MRS751903-MEN

    ABB Automation 41

    Relay Configuration Tool

    Tutorial 7. Editing in FBD

    7

    7. Editing in FBD

    • Calling the graphic editor with a FBD worksheet.

    • Inserting functions and function blocks.

    • Inserting variables.

    • Connecting objects.

    • Saving the contents.

    • Exiting the worksheet.

    7.1. Calling the graphic editor with a FBD worksheet

    The first step before editing a FBD code body worksheet is to call the graphic editor

    with the FBD worksheet. This step is done using the project tree. Let us assume for

    the following description that you want to edit the FBD worksheet of a function

    block which is called FBD_FB. Therefore you have to insert first a function block

    with this name as it is described in the chapter “Editing the project structure” on

    page 29.

    1. Do a left mouse double click on the icon 'Worksheet in FBD' of the

    function block 'FBD_FB'. The graphic editor with the FBD worksheet

    appears.

     

    1. Press < > or < > to mark the icon 'Worksheet in FBD' of the

    function block 'FBD_FB'..

    2. Press < >. The graphic editor with the FBD worksheet appears.

       

  • 8/18/2019 Relay Configuration Tool Tutorial 1MRS751903 MEM

    42/100

    42 ABB Automation

    1MRS751903-MENRelay Configuration Tool

    7. Editing in FBD Tutorial

    7.2. Inserting functions and function blocks

    The first step you have to do is inserting function and function blocks in your FBD

    worksheet. For the next description, let us assume that you want to insert the

    function block ’CTU’.

    1. Do a left mouse click in the editing field to set an insertion mark.

    2. Do a left mouse click on the icon ’Insert function/function block ’ in the

    toolbar. The dialog ’Function/Function Block ’ appears.

     

    1. Press to set an insertion mark.

    2. Press . The dialog ’Function/Function Block ’ appears.

       

     

    1. Choose the name of the function block ’CTU’ in the list box ’Name’.

    2. Confirm the dialog. The function block is inserted at the insertion mark.

    7.3. Inserting variables

    For inserting variables in a FBD worksheet you have 2 possibilities: Insertingvariables somewhere in the editing field or inserting variables already connected to

    functions or function blocks.

    For the next steps let us assume that you want to insert a variable already connected

    to the function block ’CTU’.

    The first step to be done for inserting a variable somewhere in the editing field

    is setting an insertion mark in the editing field. All other steps are the same.

  • 8/18/2019 Relay Configuration Tool Tutorial 1MRS751903 MEM

    43/100

    1MRS751903-MEN

    ABB Automation 43

    Relay Configuration Tool

    Tutorial 7. Editing in FBD

    7

    1. Do a left mouse click on the formal parameter ’PV’ to mark it.

    2. Do a left mouse click on the icon ’Insert variable’ in the toolbar. The

    dialog ’Variable’ appears.

     

    1. Press the cursor keys to go to the position of the formal parameter ’PV’.

    2. Press to mark it.

    3. Press . The dialog ’Variable’ appears.

       

     

    1. Enter the name of the variable.

    2. Confirm the dialog. The variable is inserted at the formal parameter.

    7.4. Connecting objects

    If you have inserted functions, function blocks or variables somewhere in the editing

    field, you have to connect them to create a FBD network. For the next section, let us

    assume that you want to connect the function block ’CTU’ with the function ’ADD’.

    Therefore you have to insert first the function ’ADD’ following the steps described

    in the section ’Inserting function blocks and functions’.

    1. Do a left mouse click on the function ’ADD’ and keep it pressed.2. Move the mouse towards the function block so that the connection points

    overlap.

    3. Release the mouse button. The connection is set.

    4. Move either the function or the function block to a free position if you want to.

     

    1. Press the cursor keys to go to the position of the function ’ADD’.

    2. Press and keep it pressed.

  • 8/18/2019 Relay Configuration Tool Tutorial 1MRS751903 MEM

    44/100

    44 ABB Automation

    1MRS751903-MENRelay Configuration Tool

    7. Editing in FBD Tutorial

    3. Press the cursor keys to move towards the function block so that the connection

    points overlap.

    4. Release . The connection is set.

    5. Move either the function or the function block to a free position if you want.

     

       

  • 8/18/2019 Relay Configuration Tool Tutorial 1MRS751903 MEM

    45/100

    1MRS751903-MEN

    ABB Automation 45

    Relay Configuration Tool

    Tutorial 7. Editing in FBD

    It is also possible to use the connection mode for connecting objects in FBD

    worksheets. The connection mode is described in the context-sensitive help for

    Relay Configuration Tool.

    Do not forget to declare the instance of the function block in the variable

    declaration of the POU as it is described in the chapter “Declaring variables and user

    defined data types” on page 35.

    7.5. Saving the contents

    While you are editing you should regularly save the changes you have done. In case

    of a power failure or other events, you risk loss of data if you do not save your work.

    In Relay Configuration Tool, you can save every time the changes of the current

    worksheet.

    1. Do a left mouse click on the icon 'Save' in the toolbar. The worksheet

    is saved.

     

    1. Press + . The worksheet is saved.

    7.6. Exiting the worksheet

    If you have finished editing the worksheet, you can close the worksheet. A dialog

    appears where you can enter if you want to save your changes or not.

    For saving and exiting all opened worksheets choose the menu item 'Close all' in

    the submenu 'File'.

  • 8/18/2019 Relay Configuration Tool Tutorial 1MRS751903 MEM

    46/100

    46 ABB Automation

    1MRS751903-MENRelay Configuration Tool

    7. Editing in FBD Tutorial

    1. Do a left mouse click on the submenu ’File’. The submenu appears.

    2. Do a left mouse click on the menu item ’Close’. The dialog ’Relay Configuration

    Tool: editor name ’ appears.

     

    1. Press + . The dialog ’Relay Configuration Tool: editor name ’ 

    appears.

     

     

      editor name 

    1. Press the button ’Yes’ to exit the worksheet with saving the changes.

    2. Press the button ’No’ to exit the worksheet without saving the changes.

  • 8/18/2019 Relay Configuration Tool Tutorial 1MRS751903 MEM

    47/100

    1MRS751903-MEN

    ABB Automation 47

    Relay Configuration Tool

    Tutorial 8. Editing in SFC

    8

    8. Editing in SFC

    • Calling the graphic editor with a SFC worksheet.

    • SFC networks.

    • Inserting SFC networks and branches.

    • Connecting variables.

    • Action and transition details.

    • Saving the contents.

    • Exiting the worksheet.

    8.1. Calling the graphic editor with a SFC worksheet

    The first step before editing a SFC code body worksheet is to call the graphic editor

    with the SFC worksheet. This step is done using the project tree. Let us assume forthe following description that you want to edit the SFC worksheet of a program,

    which is called SFC_PROG. Therefore, you have to insert first a program with this

    name as it is described in the chapter “Editing the project structure” on page 29.

    1. Do a left mouse double click on the icon 'Worksheet in SFC' of the

    program 'SFC_PROG'. The graphic editor with the SFC worksheet

    appears.

     

    1. Press < > or < > to mark the icon 'Worksheet in SFC' of the program

    'SFC_PROG'.

    2. Press < >. The graphic editor with the SFC worksheet appears.

  • 8/18/2019 Relay Configuration Tool Tutorial 1MRS751903 MEM

    48/100

    48 ABB Automation

    1MRS751903-MENRelay Configuration Tool

    8. Editing in SFC Tutorial

       

    8.2. Introduction to SFC networks

    SFC networks consist basically of steps and transitions forming a closed loop. A step

    is a set of instructions, which are executed while the step is active. This set of

    instructions is called action block. An action block has got a qualifier and an action.

    An action can be a variable or a proper code body called detail.

    If a transition becomes true and the next step is activated, the last action is executed

    for the last time if it is a detail and not a variable.

    A transition is the condition, which determines the moment when the step becomes

    inactive and the next step is executed.

    In every SFC network, you should have exactly one initial step, which is the first

    step to be executed.

    8.3. Inserting a first SFC network

    For the next descriptions, let us start with a simple SFC network. In this first step,

    you have to insert a SFC network with one step and one transition.

    1. Do a left mouse click in the editing field to set an insertion mark.

    2. Do a left mouse click on the icon ’Insert step/transition’. A SFC

    network with one step and one transition is inserted.

     

    1. Press to set an insertion mark.

    2. Press . A SFC network with one step and one transition is

    inserted.

    Your screen should look like the following figure:

  • 8/18/2019 Relay Configuration Tool Tutorial 1MRS751903 MEM

    49/100

    1MRS751903-MEN

    ABB Automation 49

    Relay Configuration Tool

    Tutorial 8. Editing in SFC

    8

     

    In the figure, you can see a SFC network with one initial step (S001), the

    corresponding action block (A001) and one transition (T001).

    8.4. Inserting more steps and transitions

    Let as assume that you want to insert three more steps and transitions in your SFC

    network.

    1. Do a left mouse click on a step to mark it.

    2. Do a left mouse click on the icon ’Insert step/transition’. Another stepand transition is inserted.

    3. Repeat the steps for two more steps and transitions.

     

    1. Press the cursor keys to go to the position of a step.

    2. Press to mark the step.

    3. Press . Another step and transition is inserted.

    4. Repeat the steps for two more steps and transitions.

    Your screen should look like the following figure now:

  • 8/18/2019 Relay Configuration Tool Tutorial 1MRS751903 MEM

    50/100

    50 ABB Automation

    1MRS751903-MENRelay Configuration Tool

    8. Editing in SFC Tutorial

     

    8.5. Changing an initial step into a normal step or vice versa

    Up to now, the step you have inserted first is the initial step. For the next sections,

    let us assume that you want the second step to be the initial step. Therefore, you have

    to change the first step into a normal step and the second step into an initial step.

    1. Do a right mouse double click on the initial step. The dialog ’Step’ appears.

     

    1. Press the cursor keys to go to the position of the initial step.

    2. Press to mark the step.

    3. Press + < >. The dialog ’Step’ appears.

  • 8/18/2019 Relay Configuration Tool Tutorial 1MRS751903 MEM

    51/100

    1MRS751903-MEN

    ABB Automation 51

    Relay Configuration Tool

    Tutorial 8. Editing in SFC

    8

       

     

    1. Deactivate the check box ’Initial step’.

    2. Confirm the dialog.

    3. Change the normal step S002 into an initial step.

    8.6. Inserting an alternative branch

    An alternative branch means that either one or another transition becomes true and

    only one part of the branch is executed. For the next description, let us assume that

    you want to insert an alternative branch behind step S003.

    1. Do a left mouse click on step S003 to mark it.2. Do a left mouse click on the icon ’Insert branch’ in the toolbar. The

    dialog ’Divergence’ appears.

     

    1. Press the cursor keys to go to the position of step S003.

    2. Press to mark the step.

    3. Press . The dialog ’Divergence’ appears.

       

     

    1. Confirm the dialog with the default value.

    Your screen should look like the following figure:

  • 8/18/2019 Relay Configuration Tool Tutorial 1MRS751903 MEM

    52/100

    52 ABB Automation

    1MRS751903-MENRelay Configuration Tool

    8. Editing in SFC Tutorial

     

    For inserting alternative branches you can also use the SFC branch edit mode.

    The SFC branch edit mode is described in the context-sensitive help for Relay

    Configuration Tool.

    8.7. Inserting a simultaneous branch

    Simultaneous branches are branches where steps and their action blocks are

    executed simultaneously. For the next description, let us assume that you want to

    insert a simultaneous branch at transition T004.

    1. Do a left mouse click on transition T004 to mark it.

    2. Do a left mouse click on the icon ’Insert branch’ in the toolbar. The

    dialog ’Divergence’ appears. 

    1. Press the cursor keys to go to the position of transition T004.

    2. Press to mark the transition.

    3. Press . The dialog ’Divergence’ appears.

  • 8/18/2019 Relay Configuration Tool Tutorial 1MRS751903 MEM

    53/100

    1MRS751903-MEN

    ABB Automation 53

    Relay Configuration Tool

    Tutorial 8. Editing in SFC

    8

       

     

    1. Confirm the dialog with the default value.

    Your screen should looks like the following figure:

     

    For inserting simultaneous branches you can also use the SFC branch edit mode.

    The SFC branch edit mode is described in the context-sensitive help for RelayConfiguration Tool.

    8.8. Connecting variables to actions

    In SFC, it is possible to connect Boolean variables to actions. According to the

    action qualifier the value of the variable behaves. If the qualifier ’N’ is used the

    variable is TRUE while the associated step is active. Qualifier ’S’ stores the variable

    with the value TRUE. The qualifier ’R’ resets the variable to FALSE.

  • 8/18/2019 Relay Configuration Tool Tutorial 1MRS751903 MEM

    54/100

    54 ABB Automation

    1MRS751903-MENRelay Configuration Tool

    8. Editing in SFC Tutorial

    1. Do a right mouse double click on the action block A006. The dialog ’Action’ 

    appears.

     

    1. Press the cursor keys to go to the position of action block A006.

    2. Press to mark the action block.

    3. Press + < >. The dialog ’Action’ appears.

       

     

    1. Enter the name of the variable in the field ’Name’.

    2. Activate the radio button ’variable’.

    3. Confirm the dialog.

    In the following figure, you can see the action block with the variable name:

  • 8/18/2019 Relay Configuration Tool Tutorial 1MRS751903 MEM

    55/100

    1MRS751903-MEN

    ABB Automation 55

    Relay Configuration Tool

    Tutorial 8. Editing in SFC

    8

     

    8.9. Connecting variables to transitions

    If you want to connect a variable to a transition, you have to do two main steps. First

    changing the properties of the transition into a direct connection and then inserting

    and connecting the variable. For the next sections, let us assume that you want toconnect a variable called ’var1’ to transition T005.

    1. Do a right mouse double click on transition T005. The dialog ’Transition’ 

    appears.

     

    1. Press the cursor keys to go to the position of transition T003.

    2. Press to mark the transition. The dialog ’Transition’ appears.

       

  • 8/18/2019 Relay Configuration Tool Tutorial 1MRS751903 MEM

    56/100

    56 ABB Automation

    1MRS751903-MENRelay Configuration Tool

    8. Editing in SFC Tutorial

     

    1. Activate the radio button ’Direct connection’.

    2. Confirm the dialog. The transition is represented with a green connection point.

    In the following figure, you can see a transition with a green connection point:

       

    1. Do a left mouse click on the transition to mark it.

    2. Do a left mouse click on the transition to mark it. The dialog ’Variable’ 

    appears.

     

    1. Press the cursor keys to go to the position of the transition.

    2. Press to mark it. The dialog ’Variable’ appears.

       

  • 8/18/2019 Relay Configuration Tool Tutorial 1MRS751903 MEM

    57/100

    1MRS751903-MEN

    ABB Automation 57

    Relay Configuration Tool

    Tutorial 8. Editing in SFC

    8

     

    1. Enter the name of the variable.

    2. Confirm the dialog. The variable is inserted.

    In the following figure, you can see a variable connected to a transition:

     

    Instead of variables also networks in one of the other graphical programming

    languages can be connected to transitions being a direct connection. In those cases

     just insert the objects you want to have as it is described in the chapter “Editing in

    FBD” on page 41 and connect them to the connection point of the transition. Do not

    forget to declare the instance of the function block in the variable declaration of the

    POU as it is described in the chapter “Declaring variables and user defined data

    types” on page 35.

    8.10. Action and transition details

    According to IEC 1131-3 it is possible to edit a code body for actions and transitionsinstead of connecting variables. These code bodies are edited in proper worksheets,

    which you have to insert in the project tree under the directory nodes for actions and

    transitions. Assuming, that you have already edited 2 worksheets called 'actcode1'

    and 'tracode1' in one of the programming languages, you have to insert the names of

    the worksheets in the SFC