tm210tre.30 eng

Upload: pipikikiki

Post on 02-Jun-2018

219 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/10/2019 Tm210tre.30 Eng

    1/48

    Automation StudioAutomation StudioAutomation StudioAutomation Studio Basis BasisBasisBasisTM210

  • 8/10/2019 Tm210tre.30 Eng

    2/48

    2 TM210 Automation Studio Basis

    Requirements

    Training modules: TM201 The B&R Product Palette

    Software: Automation Studio 3.0.80

    Automation Runtime 3.00

    Hardware: X20CP1485

  • 8/10/2019 Tm210tre.30 Eng

    3/48

    Automation Studio Basis TM210 3

    Table of contents

    1. INTRODUCTION 4

    1.1

    Objectives 5

    2. INSTALLATION 6

    2.1 Installation Wizard 6

    2.2 Licensing 7

    3. STARTING AUTOMATION STUDIO 8

    3.1 The start page 8

    4. THE FIRST PROJECT 9

    5. AUTOMATION STUDIO 11

    5.1 The "CoffeeMachine" sample project 11

    5.2 Automation Studio Help 12

    5.3 The workspace 13

    5.4 Basic concept 18

    5.5 Creating a concept 19

    5.6 Organization of software 21

    5.7 Organization of hardware 22

    5.8 Managing the system configuration 23 5.9 Relationship between functionality and task 24

    6. HARDWARE PROJECT DEVELOPMENT 28

    6.1 Inserting I/O modules 29

    6.2 Assign variables to I/Os 30

    6.3 Setting up a network connection 32

    6.4 Build and transfer the project 33

    7. PROGRAMMING 36 7.1 Programs 36

    7.2 Programming languages 36

    7.3 Initialization and cyclic sections of a program 37

    7.4 Variables and data types 38

    7.5 The cross-reference list 41

    7.6 Teamwork 42

    7.7 Hardware and software upgrades 44

    8. SUMMARY 45

  • 8/10/2019 Tm210tre.30 Eng

    4/48

    Introduction

    4 TM210 Automation Studio Basis

    1. INTRODUCTION

    Automation Studio is a programming environment for B&R automationcomponents, which include controllers, motion control components and

    visualization applications. The clear structure of projects and the ability tomanage a wide range of configurations and machine variations makesworking in teams that much easier.

    More than just a programming tool Automation Studio Helps turn your ideas into applications

    The user can choose between programming languages, diagnostic toolsand editors to create and manage projects with maximum efficiency. Theuse of standard libraries provided by B&R and IEC programming languagesthat are integrated in the system enable a highly efficient workflow.

    Fig. 1 The Automation Studio splash screen

    This training module will use examples to demonstrate how to use themany tools available in Automation Studio. The extensive AutomationStudio Help system provides the basis for the examples and exercises inthis training module.

  • 8/10/2019 Tm210tre.30 Eng

    5/48

    Introduction

    Automation Studio Basis TM210 5

    1.1 Objectives

    Selected examples that represent a typical project workflow will help youlearn how to design, program and configure your software and hardwareconcept in Automation Studio.

    You will learn how to

    Construct simple and complex machines and systems

    Use the tools for programming software elements

    Create simple programs

    Simulate and test sections of program

    Fig. 2 Overview

  • 8/10/2019 Tm210tre.30 Eng

    6/48

    Installation

    6 TM210 Automation Studio Basis

    2. INSTALLATION

    Automation Studio can be installed automatically by simply inserting theDVD or by running " Install.exe " in Explorer.

    2.1 Installation Wizard

    An Installation Wizard guides you through the installation of the necessarycomponents. After selecting the language, the installation can be started inthe subsequent dialog box.

    The version information can be opened from this page.

    Fig. 3: Automation Studio installation: Selecting the desired language

    The system requirements for Automation Studio are listed in theinstallation guidelines, which can be opened by clicking on thecorresponding icon.

    Depending on your PC and the Windows environment, installation ofthe selected components may take some time.

  • 8/10/2019 Tm210tre.30 Eng

    7/48

    Installation

    Automation Studio Basis TM210 7

    2.2 Licensing

    Each full version must be licensed after the initial installation.

    This is accomplished by entering the license or serial number in thelicensing dialog box. The 11-digit serial number (beginning with 8986.. orA555..) can be found on a paper CD in the CD case for each full version.

    The licensing window is displayed every time Automation Studio is started,and can also be opened later on from the 'About' window. The full versionscan each be licensed 5 times per serial number. After that the serialnumber is invalid for further licensing.

    The full version for an unlimited number of work stations can be licensedan unlimited number of times.

    Fig. 4: Automation Studio license sticker

    Once the serial number has been entered in the licensing dialog box, if anInternet connection is available the licensing can be completedautomatically online. If there is no direct Internet access available, this canalso be done manually (e.g. over the telephone using the correspondingB&R support line).

    If the full version is not licensed, the program will be locked after 30days of use.

  • 8/10/2019 Tm210tre.30 Eng

    8/48

    Starting Automation Studio

    8 TM210 Automation Studio Basis

    3. STARTING AUTOMATION STUDIO

    Installation creates an entry for Automation Studio in the Startmenu. Automation Studio can now be launched from the Start

    menu or using the shortcut on your desktop.

    3.1 The start page

    When Automation Studio is started the first time, the start page is openedin the programming interface.

    Fig. 5: Automation Studio - Start Page

    From the Start Page, you can create a new project or open an existing one.You can also jump to the Getting Started chapter of the Help system for anintroduction to Automation Studio.

    The start page also opens when you close a project, or you can open it anytime by selecting < Help> / from the menu.

  • 8/10/2019 Tm210tre.30 Eng

    9/48

    The first project

    Automation Studio Basis TM210 9

    4. THE FIRST PROJECT

    In this section we will use the Automation Studio Help system to create anew project, transfer it to the "PC based Runtime Simulation" (AR000), and

    then test the program using Automation Studio.

    Procedure:

    From the start page, open the chapter "How do I create a controlproject?"

    Select the first sub-section "First project with AR000" Work through each of the steps

    Task: Create your first project using the Help system

    You can open the right chapter of the Automation Studio Help systemdirectly from the start page.

    Under / in the menu you can set the language ofthe Automation Studio Online Help (German/English).

  • 8/10/2019 Tm210tre.30 Eng

    10/48

    The first project

    10 TM210 Automation Studio Basis

    Fig. 6: Procedure for creating your first project

    Result

    With the aid of the Online Help system, you were able to create your

    first project, write a program, transfer it to a simulation system and testit.

    In the process of creating your first project, you already used severalelements of Automation Studio.

    In the next few chapters, we will explain the structure of an AutomationStudio project using a sample project.

    On PCs with a second monitor, the Online Help and Automation Studiocan be displayed at the same time. If there is no second monitoravailable, you can use the shortcut + to switch backand forth between them.

  • 8/10/2019 Tm210tre.30 Eng

    11/48

    Automation Studio

    Automation Studio Basis TM210 11

    5. AUTOMATION STUDIO

    A sample project is used to illustrate the structure of an Automation Studioproject.

    5.1 The "CoffeeMachine" sample project

    The installation of Automation Studio includes several sample projects.One of these sample projects will be used in this training module toillustrate the Automation Studio environment and its many functions.

    Procedure:

    Open the sample Automation Studio project from the start page.

    Fig. 7: Open project with Automation Studio

    Task: Sample Automation Studio project - "CoffeeMachine"

    The sample project can be opened from the start page.

  • 8/10/2019 Tm210tre.30 Eng

    12/48

    Automation Studio

    12 TM210 Automation Studio Basis

    5.2 Automation Studio Help

    The Automation Studio Help system is your reliable companion throughoutthe development, configuration and commissioning of a project.

    It serves as a reference guide for operating Automation Studio and itseditors, for creating a program or visualization application, for configuringdrives, and also provides access to all the hardware documentation.

    Fig. 8: Automation Studio Help

    Exercise: Using the Automation Studio Help system

    While working in Automation Studio, press the key to display helpinformation on the selected element. Use the search function to findentries on a specific topic.

    The functions of the Help system are described in the chapterAutomation Software How do I use the Help system .

  • 8/10/2019 Tm210tre.30 Eng

    13/48

    Automation Studio

    Automation Studio Basis TM210 13

    5.3 The workspace

    Automation Studio is divided into various sections, each dedicated to aspecific function or task.

    Fig. 9: The Automation Studio workspace

    The menus and the task bar provide access to the extensiveAutomation Studio functions.

    On the left side of the screen you see the project explorer, whichcontains tabs that allow you to create, manage and edit the

    components of your project. On the right side, the editors are displayed in one or more

    workbooks. This is where you can program and configure yourproject data.

    At the bottom of the workspace you'll find the output window, whichdisplays information such as messages while compiling your project.

    Automation Studio Help: Project Management / The workspace

  • 8/10/2019 Tm210tre.30 Eng

    14/48

    Automation Studio

    14 TM210 Automation Studio Basis

    5.3.1 Changing the positions of windows

    When you open a project, the windows are docked on the mainAutomation Studio window. The windows can be undocked and moved byclicking and dragging the title bar.

    Fig. 10: Docking and undocking windows

    Moving a window back to the edge of the main window docks it again.

    Automation Studio Help: Project Management / The workspace /Project explorer

    Exercise: Working with Automation Studio

    The goal of this exercise is to become familiar with the Automation

    Studio environment.

  • 8/10/2019 Tm210tre.30 Eng

    15/48

    Automation Studio

    Automation Studio Basis TM210 15

    5.3.2 Automatic hiding of windows

    To create more space on the monitor when working with other editors (e.g.graphic programming editors), the project explorer and output window canbe hidden automatically.

    Simply click on the pin icon in the title bar of the project explorer or theoutput window.

    Fig. 11: Hiding the project ex plorer and output window

    Automation Studio Help: Project Management / The workspace /Project explorer

  • 8/10/2019 Tm210tre.30 Eng

    16/48

    Automation Studio

    16 TM210 Automation Studio Basis

    5.3.3 Workbooks

    Workbooks presents a clear way of displaying open windows while makingit much easier to switch between them. Depending on the configuredmode, the windows can also overlap or be arranged next to or on top ofeach other.

    If multiple editors are opened, each is opened in a separate workbook. Ifmultiple workbooks are open, the resolution of the display may not allowthem to be displayed side-by-side.

    To maintain an overview of the opened workbooks, a list of them opens ifyou press the dropdown symbol on the right side of the title bar.

    Fig. 12: Overview of open workbooks

    Automation Studio Help: Project Management / The workspace /Workbook mode

  • 8/10/2019 Tm210tre.30 Eng

    17/48

    Automation Studio

    Automation Studio Basis TM210 17

    5.3.4 Menu and shortcut menu

    The main menu provides access to all of the functions in AutomationStudio.

    Depending on the context (active editor or window), individual menu itemsmay be shown/hidden or enabled/disabled. This allows only the functionsavailable in the current context to be offered.

    5.3.5 Convenient operation during programming - SmartEdit

    The SmartEdit feature combines a series of functions that support theintelligent input of information in Automation Studio editors.

    The shortcut + automatically completes partiallyentered terms:

    Variable names and structure members Function name Language constructs (IF THEN, CASE, etc.) Fast navigation Tooltips Syntax coloring

    Fig. 13: SmartEdit

    Automation Studio Help:

    Project Management / The workspace / Menus Project Management / The workspace / Toolbars Project Management / The workspace / Keyboard shortcuts

    Many of the functions that can be reached from the main menu can alsobe performed using toolbars, shortcut keys or the shortcut menu (rightclick).

  • 8/10/2019 Tm210tre.30 Eng

    18/48

    Automation Studio

    18 TM210 Automation Studio Basis

    5.4 Basic concept

    The development of the software in an Automation Studio project can bearranged according to the structure of the machine.

    This makes the organization of the software easy to follow, because thereis a direct relationship between program and machine.

    Fig. 14: Fig. Structure and principle of Automation Studio

    Once they are programmed and configured, software components can beassigned to different hardware configurations.

    This allows multiple versions of a machine type to be managed under asingle project, each with a different configuration of software andhardware.

  • 8/10/2019 Tm210tre.30 Eng

    19/48

    Automation Studio

    Automation Studio Basis TM210 19

    5.5 Creating a concept

    The "CoffeeMachine" sample can be used to illustrate the path from aninitial concept to a full representation of the software and hardwarecomponents in Automation Studio.

    5.5.1 System overview

    The system (machine) and its functional units are the foundation forrepresenting the software structure in Automation Studio.

    Fig. 15: System overview

    The basic process can be outlined as follows:

    The cup extractor takes a cup and places it on the conveyor. The cup is moved to a defined filling position. A dosing unit defines the amounts of sugar, milk and coffee for the

    specified type of coffee.

    The water is heated and pumped into the cup. The conveyor moves the cup to the dispense position.

    Automation Studio Help: Programming / Structured software development

  • 8/10/2019 Tm210tre.30 Eng

    20/48

    Automation Studio

    20 TM210 Automation Studio Basis

    5.5.2 Function description

    The software is structured according to the preparation process.

    Fig. 16: Function description of a program

    The individual functions can be represented in Automation Studio usingclearly organized configuration and programming.

    Fig. 17: Organization of software in Automation Studio

  • 8/10/2019 Tm210tre.30 Eng

    21/48

    Automation Studio

    Automation Studio Basis TM210 21

    5.6 Organization of software

    All program organization units (POU) are displayed in the Logical View arranged in a tree structure.

    The elements are organized into packages (directories). A package cancontain, for example, all the software elements needed for a particular partof the system, as well as all the corresponding documentation.

    In this view there is not a direct correlation to the actual hardware. It onlyserves to organize and manage the software elements.

    Fig. 18: Logical view

    Automation Studio Help: Project Management / Logical View

  • 8/10/2019 Tm210tre.30 Eng

    22/48

    Automation Studio

    22 TM210 Automation Studio Basis

    5.7 Organization of hardware

    The hardware components of a system are configured and managed in thePhysical View .

    When a new project or system configuration is created (see 5.8 "Managingthe system configuration"), the node for the CPU is determined by selectingthe hardware (e.g. 4PP420.1043-B5).

    Fig. 19: Physical View of the PP420 configuration

    The following tasks are performed in the Physical View:

    Inserting and configuring I/O modules Assigning variables to I/O data points Configuring fieldbus modules and interfaces in a network Inserting and configuring hardware modules (e.g. terminals, fieldbus

    devices) Opening a software configuration

    Automation Studio Help: Project Management / Physical View

  • 8/10/2019 Tm210tre.30 Eng

    23/48

    Automation Studio

    Automation Studio Basis TM210 23

    5.8 Managing the system configuration

    The various configurations of a machine type are managed in theConfiguration View .

    The configurations can differ in what software and hardware is used.

    As the "CoffeeMachine" example shows, this project has two differentconfigurations. The first is purely a simulation environment, while the othercorresponds to the actual hardware structure.

    Fig. 20: Configuration View with active PP420 configuration

    A configuration consists of hardware and software. Only one configurationmay be [Active] at a time.

    When you activate a configuration, the hardware assigned to it is displayedin the Physical View.

    Automation Studio Help: Project Management / Configuration View

  • 8/10/2019 Tm210tre.30 Eng

    24/48

    Automation Studio

    24 TM210 Automation Studio Basis

    5.9 Relationship between functionality and task

    The software elements of the currently active configuration (CPU) that canbe transferred to the target system are displayed in the Logical View .

    There are two ways to assign a software element to a configuration:

    Create a software element with automatic assignment Assign an existing software element to a new configuration

    Fig. 21: Software assignments

    5.9.1 Open the software configuration

    The software configuration can be opened by double-clicking on the CPUentry in the Physical View, or by selecting / in the menu.

    Automation Studio Help:Project Management / Logical View / Automatic software deployment

  • 8/10/2019 Tm210tre.30 Eng

    25/48

    Automation Studio

    Automation Studio Basis TM210 25

    5.9.2 Assignment when creating

    If you create a software element using the Automation Studio Wizard, thelast dialog box gives you the chance to decide how it is added to thesoftware configuration.

    Fig. 22: Assigning the software to one or more CPUs

    You can assign them to the active configuration (Yes, to active CPU) or toall CPUs (Yes, to all CPUs).

    In these cases, Automation Studio automatically inserts the softwarecomponents in the default position in the software configuration.

    Automation Studio Help: Real-time Operating System / Method of operation / Runtime performance / Task classes

    The order and priority of programs in the software configuration can bechanged by moving them to the different task classes.

  • 8/10/2019 Tm210tre.30 Eng

    26/48

    Automation Studio

    26 TM210 Automation Studio Basis

    5.9.3 Assignment to a new configuration

    When a new hardware configuration is added to a project, the softwareelements must be added to the software configuration manually.

    Fig. 23: Inserting a new configuration

    Exercise: Create a new configuration

    Create a new configuration in the "CoffeeMachine" project with an X20CPU (X20CP1485).

    Solution approach: Create a new configuration called "X20CP1485" Adding the required hardware Open the software configuration Assigning the software

    The goal of this exercise is not to create a fully functional configuration.Its purpose is only to show how software elements can be assigned tothe new configuration.

    The steps for inserting a new configuration are the same as for creatinga new project.

  • 8/10/2019 Tm210tre.30 Eng

    27/48

    Automation Studio

    Automation Studio Basis TM210 27

    5.9.4 Manual assignment

    With the software configuration open (see 5.9.1) select the Logical View inthe Project Explorer.

    Drag and drop an object from the Logical View to the correct position inthe software configuration.

    Fig. 24: Assigning software elements to the software configuration

    This allows the software elements needed for a specific systemconfiguration to be assigned individually.

  • 8/10/2019 Tm210tre.30 Eng

    28/48

    Hardware project development

    28 TM210 Automation Studio Basis

    6. HARDWARE PROJECT DEVELOPMENT

    This chapter is based on the project created in chapter 4.

    This project already contains a configuration based on the "PC-basedruntime simulation" and a Ladder Diagram program with two variables.

    Procedure:

    Create a new configuration Assign the program to the software configuration Insert I/O modules on the X2X Link interface Assign variables to I/Os Configure the Ethernet Interface Compile the project Create a CompactFlash card

    Requirements:

    CompactFlash adapter CompactFlash card with minimum 64 MB X20 CPU (X20CP1485) Digital input and output module

    (X20DI9371 and X20DO9322) Point-point connection between the PC

    and the X20 CPU with a crossoverEthernet cable

    Task: Open the project and insert an X20 configuration

    Close the active project by selecting / from themenu. The start page appears again, where the previously createdproject can be opened from a list of "Recent Projects".

    Assign the " LampTest " program to the task class Cyclic#1.

  • 8/10/2019 Tm210tre.30 Eng

    29/48

    Hardware project development

    Automation Studio Basis TM210 29

    6.1 Inserting I/O modules

    In an X20 system, an I/O module is inserted on the X2X Link interface.

    In Automation Studio, the interface editors can always be opened byselecting from the menu or the shortcut menu.

    Fig. 25: Opening an interface in Automation Studio

    6.1.1 X2X Link

    I/O modules (e.g. X20) are connected with a uniform X2X Link backplane.

    X2X Link guarantees the highest protection against disturbances as well asworldwide application without special tools thanks to its twisted coppercables.

    Automation Studio Help: Communication / X2X

    Task: Insert digital input and output modules (X20DI9371 and X20DO9322)

    Using the Getting Started chapter of the Automation Studio Help systemas a guide, insert the two X20 modules in the Physical View.

    Solution approach: Help chapter: Automation Software / Getting Started /

    Creating programs with Automation Studio / Assigningvariables to I/Os

    Open the X2X Link editor Insert the modules in the X2X Link editor

  • 8/10/2019 Tm210tre.30 Eng

    30/48

    Hardware project development

    30 TM210 Automation Studio Basis

    6.2 Assign variables to I/Os

    I/O mapping refers to the assignment of controller program variables to I/Ochannels on the module.

    Variables are assigned to an I/O channel in the I/O Mapping editor, whichcan be opened by selecting in the shortcut menu ofthe corresponding I/O module, or by selecting /

    from the main menu.

    Fig. 26: Opening the I/O mapping of a module

    Automation Studio Help: Programming / I/O configuration / I/O mapping

    Task: Assign variables to I/Os

    Using the Getting Started chapter of the Automation Studio Help systemas a guide, assign the two variables to a digital input channel and adigital output channel.

    Solution approach: Automation Software / Getting Started / Creating programs

    with Automation Studio / Assigning variables to I/Os

    Open I/O mapping Assign the variable "Switch" to a digital input channel Assi n the variable "Lamp" to a di ital output channel

  • 8/10/2019 Tm210tre.30 Eng

    31/48

    Hardware project development

    Automation Studio Basis TM210 31

    6.2.1 I/O configuration

    The ever-increasing functionality of remote B&R I/O modules results inmore and more possibilities and operating modes in which these modules

    can be used.The I/O configuration allows you to configure I/O modules without havingto do any programming.

    The I/O channels are configured in the I/O configuration editor, which canbe opened by selecting in the shortcut menu ofthe corresponding I/O module, or by selecting / from the main menu.

    Fig. 27: Opening the I/O configuration of a module

    Automation Studio Help: Programming / I/O configuration

  • 8/10/2019 Tm210tre.30 Eng

    32/48

  • 8/10/2019 Tm210tre.30 Eng

    33/48

    Hardware project development

    Automation Studio Basis TM210 33

    6.4 Build and transfer the project

    Once the program is complete, it can be built and transferred to the targetsystem.

    The target system is started up the first time when creating theCompactFlash card in Automation Studio, since this process involvespartitioning the card, transferring the correct version of the operatingsystem and transferring the project with the necessary system settings.

    6.4.1 Build and Rebuild

    A build regenerates all the changes that have taken place since theprevious build, and is started using the build icon ( ) on the toolbar or bypressing the F7 key.

    A successful build is confirmed in the outputwindow as follows:

    Build: 0 error(s), 0 warning(s) .

    Fig. 28: Building the project

    During a rebuild , all software objects in the active configuration areregenerated, regardless of whether their source data has changed since thelast build.

    The project can only be transferred to the target system if the targetsystem has a workable configuration (Ethernet settings on targets stem on the Com actFlash card.

  • 8/10/2019 Tm210tre.30 Eng

    34/48

    Hardware project development

    34 TM210 Automation Studio Basis

    Fig. 29: Rebuilding the project

    6.4.2 Creating a CompactFlash card

    A CompactFlash card is created using the Automation Studio " PVI Transfer "tool. This can be opened by selecting / from the menu.

    Automation Studio Help: Programming / Build & Transfer / Build

    Task: Creating a CompactFlash card

    Using the Automation Studio Help system as a guide, create aCompactFlash card.

    You will need a CompactFlash card and a CompactFlash adapter .

    After a rebuild, the project should not be transferred with the CPU inRUN mode if a global variable is used in more than one task! It isrecommended to change the CPU to SERVICE mode before transferring

    the project.

  • 8/10/2019 Tm210tre.30 Eng

    35/48

    Hardware project development

    Automation Studio Basis TM210 35

    Procedure:

    The chapter "Getting Started / Creating programs in Automation Studio / First project with X20 CPU" shows you how to establish the connection

    using the following pages:

    Creating a CompactFlash card

    After the CompactFlash card is inserted in the X20 CPU, the onlineconnection between Automation Studio and the target system isestablished automatically as long as the connection is configured correctly(see 6.3 "Setting up a network connection").

    Once there is an Ethernet connection between the PC and the X20 CPU, thestatus of the online connection is displayed on the status bar.

    The project can now be edited or diagnosed and then transferred via theonline connection.

  • 8/10/2019 Tm210tre.30 Eng

    36/48

    Programming

    36 TM210 Automation Studio Basis

    7. PROGRAMMING

    7.1 Programs

    A program is a program organization unit (POU) as defined in IEC 61131. Itpossesses the ability to directly access all global variables, functions, and function blocks.

    7.2 Programming languages

    Programs can be created in several different programming languages inAutomation Studio. It is possible to combine several programminglanguages within one project.

    The following programming languages are available:

    Programming language IEC61131 Comment

    Ladder diagram (LD) Graphical

    Function Block Diagram (FBD) Graphical

    Continuous Function Chart (CFC) Graphical

    Sequential Function Chart (SFC) Graphical & Textual

    Instruction List (IL) Textual

    Structured Text (ST) Textual

    ANSI C (C) Textual

    In Automation Studio, all textual programming languages use the sameeditor.

    Diagnostic tools are therefore always the same and are operated in thesame way. This uniformity simplifies workflow and increases productivity.

    Automation Studio Help: Programming / Programs

    Function blocks from B&R standard libraries can be called and used inall programming languages.

  • 8/10/2019 Tm210tre.30 Eng

    37/48

    Programming

    Automation Studio Basis TM210 37

    7.3 Initialization and cyclic sections of a program

    When creating a program, the user can decide what sections should makeup the program.

    Fig. 30: Selecting the program sections when creating a program

    Task initialization : When the cyclic system is started, every task runsthrough its initialization subprogram.This "Init-SP" can contain program code that defines variable values.

    Cyclic section of a task : The cyclic section of the program starts after taskinitialization is complete. Variables that are assigned values there retainthem until they receive new ones or the system is restarted.

    Exit section of the program : A task's exit program is called whenuninstalling (deleting) the task. If resources (memory, interfaces) were usedin the init or cyclic program, then these resources must be correctlyreleased.

    Additional information can be found in training module TM213.

  • 8/10/2019 Tm210tre.30 Eng

    38/48

    Programming

    38 TM210 Automation Studio Basis

    7.4 Variables and data types

    Variables are locations in memory for application-specific data ranges. InAutomation Studio, variables are declared in a .var file.

    Programming is simplified by the use of symbolic variable names.

    Fig. 31: Variable declaration

    Data types describe the properties of a variable, such as the range or theprecision of the number contained in the variable, or which operations canbe performed on it.

    Fig. 32: Data type of a variable

    Automation Studio Help: Programming / Variables and data types

  • 8/10/2019 Tm210tre.30 Eng

    39/48

    Programming

    Automation Studio Basis TM210 39

    User-defined data types can be created by the user based on the simpledata types. In Automation Studio, user-defined data types, also known asderived data types, are declared in a .typ file.

    Fig. 33: Declaration of data types

    7.4.1 Variable scope

    A project's packages can be arranged in a nested structure in the LogicalView. This allows the data and functionality to be organized modularly.

    This structure determines the scope and visibility of the declared variablesand data types. A variable can therefore be defined "logically" at theappropriate location in the project.

    In Automation Studio, the visibility of the variables is determined by theposition of the .var file:

    Local variables are defined with a local scope for a program, and can't be

    used in the project's other POUs.Global variables at the highest level are visible in the entire project. Theycan therefore be used in any program at any level of a package.

    Package-local variables are declared within a package and are valid in therespective package and all subordinate packages and programs. However,the validity of these variables is global from the standpoint of thecontroller.

    Automation Studio Help: Programming / Variables and data types / Data types / Derived data types

  • 8/10/2019 Tm210tre.30 Eng

    40/48

    Programming

    40 TM210 Automation Studio Basis

    7.4.2 Initializing and buffering variable values

    A data type and other properties can be assigned to a variable in thevariable declaration.

    Fig. 34: Example of a variable declaration

    Constants are variables whose values must not change while a program isexecuted. A constant is assigned its initial value when the software iscreated.

    Remanent and permanent variables (Retain) are saved in buffered memory

    (SRAM) so that they can be reloaded after the system is restarted. Unlikeremanent variables, permanent variables are also protected against a coldrestart.

    In both cases, the buffering (battery, rechargeable battery) in the CPU orbackplane is responsible for maintaining the data.

    Fig. 35 Inserting a permanent variable

    For variables to be stored in the permanent area, they have to be definedas Retain and Global in the variable declaration.

  • 8/10/2019 Tm210tre.30 Eng

    41/48

    Programming

    Automation Studio Basis TM210 41

    7.5 The cross-reference list

    Common search tasks can be handled easily with the help of the cross-reference list.

    All variables used in a program can be viewed in the list. The list alsoprovides information about where and how each variable is used in theprogram (read or write access).

    In the general project settings you can activate the option to generate thiscross-reference list automatically during a project build. This setting ismade on the "General" tab under / .

    Fig. 36: Activate cross-reference list

    After the project is compiled, the cross-reference list functions areavailable.

    Automation Studio Help: Project Management / Project settings

  • 8/10/2019 Tm210tre.30 Eng

    42/48

    Programming

    42 TM210 Automation Studio Basis

    7.6 Teamwork

    Working in a team requires responsibilities to be divided up between thevarious team members.

    Automation Studio has functions designed specifically to help teams workmore efficiently:

    Sharing project files with minimum sizes Working with version control

    7.6.1 Exporting projects

    An Automation Studio project can be shared using the export function.

    Export a project by selecting / or / while in the Logical View.

    Fig. 37: Exporting software from the Logical View

    Automation Studio Help:Project Management / Using version control systems

    Version control will not be covered in this training module.

  • 8/10/2019 Tm210tre.30 Eng

    43/48

    Programming

    Automation Studio Basis TM210 43

    7.6.2 Exporting and importing software components

    A completed software component can be exported and imported, allowingit to be shared or reused in other projects.

    An export is performed on a package (directory) in the Logical View.

    If this package contains references to standard libraries, these can bespecified in the properties of the package. These properties are checkedwhen importing, and any required libraries are added automatically.

    From the Logical View, import the component by selecting < Insert> /

    from the menu.

    Fig. 38: Importing a prepared library sample

    Exercise: Inserting a library sample

    For some libraries, there are prepared samples that are available in the

    form of a package. These can be imported into an existing project ifneeded.

    This exercise is not based on any particular application. It is onlyintended to show how to import a completed software component.

  • 8/10/2019 Tm210tre.30 Eng

    44/48

    Programming

    44 TM210 Automation Studio Basis

    7.7 Hardware and software upgrades

    Upgradeable components make it possible to update hardware and motionlibraries and to upgrade to new versions of Visual Components orAutomation Runtime.

    To upgrade components online, you must first start Automation Studio.

    Then select / from the menu. The upgradescurrently available on the B&R homepage are listed in a dialog box:

    Fig. 39: Upgradeable components

    Automation Studio Help: Project Management / Automation Studio upgrade

  • 8/10/2019 Tm210tre.30 Eng

    45/48

    Summary

    Automation Studio Basis TM210 45

    8. SUMMARY

    Automation Studio is more than just a programming tool. It supports theuser throughout the entire life cycle of a machine - from the initial concept

    to the finished project, from first commissioning to series production.The ability to clearly structure the software based on machine parts and towork with different configurations makes it possible to manage multiplemachine variations in one project and allows a whole team to work on thesame project.

    Fig. 40 Automation Studio

    Automation Studio is the reliable companion of the programmers andservice and maintenance technicians, and offers just the right tool for anystage in a machine's life cycle.

    More than just a programming tool Automation Studio Helps turn your ideas into applications

  • 8/10/2019 Tm210tre.30 Eng

    46/48

    Summary

    46 TM210 Automation Studio Basis

    Notes

  • 8/10/2019 Tm210tre.30 Eng

    47/48

    Summary

    Automation Studio Basis TM210 47

    Overview of training modules

    TM210 The Basics of Automation Studio TM600 The Basics of VisualizationTM211 Automation Studio Online Communication TM610 The Basics of ASiVTM213 Automation Runtime TM630 Visualization Programming GuideTM220 The Service Technician on the Job TM640 ASiV Alarm System, Trend and DiagnosticTM223 Automation Studio Diagnostics TM670 ASiV AdvancedTM230 Structured Software GenerationTM240 Ladder Diagram (LAD) TM700 Automation Net PVITM241 Function Block Diagram (FBD) TM710 PVI CommunicationTM246 Structured Text (ST) TM711 PVI DLL ProgrammingTM250 Memory Management and Data Storage TM712 PVIServicesTM261 Closed Loop Control with LOOPCONR TM730 PVI OPC

    TM400 The Basics of Motion Control TM800 APROL System ConceptTM410 The Basics of ASiM TM810 APROL Setup, Configuration and RecoveryTM440 ASiM Basic Functions TM811 APROL Runtime SystemTM441 ASiM Multi-Axis Functions TM812 APROL Operator ManagementTM445 ACOPOS ACP10 Software TM813 APROL XML Queries and Audit TrailTM446 ACOPOS Smart Process Technology TM830 APROL Project EngineeringTM450 ACOPOS Control Concept and Adjustment TM840 APROL Parameter Management and RecipesTM460 Starting up Motors TM850 APROL Controller Configuration and INATM480 Hydraulic Drive Control TM860 APROL Library Engineering

    TM865 APROL Library Guide BookTM500 The Basics of Integrated Safety Technology TM870 APROL Python ProgrammingTM510 ASiST SafeDESIGNER TM890 The Basics of LINUXTM540 ASiST SafeMC

  • 8/10/2019 Tm210tre.30 Eng

    48/48

    Summary

    Back cover (number of pages divisible by 4)

    Contact (Headquarters)

    Weblink

    Internationality

    Copyright Model number

    T M 2 1 0 T R E . 3 0 - E

    N G

    0 4 1 0

    2 0 1 0 b y B & R

    . A l l r i g

    h t s r e s e r v e d .

    A l l r e g i s t e r e d

    t r a d e m a r

    k s a r e

    t h e p r o p e r

    t y o f

    t h e i r r e s p e c

    t i v e o w n e r s .

    W e r e s e r v e

    t h e r i g

    h t t o m a k e

    t e c h n i c a

    l c h a n g e s .