Working with Automation Studio - WordPress.com · 15/01/2013 · TM210 - Working with Automation...

48
Working with Automation Studio TM210TRE.40-ENG TM210 2013/01/15

Transcript of Working with Automation Studio - WordPress.com · 15/01/2013 · TM210 - Working with Automation...

Page 1: Working with Automation Studio - WordPress.com · 15/01/2013 · TM210 - Working with Automation Studio 5 ... transfer it to a simulation system and test it. In the process of creating

Working with Automation Studio

TM210TRE.40-ENG

TM210

2013/01/15

Page 2: Working with Automation Studio - WordPress.com · 15/01/2013 · TM210 - Working with Automation Studio 5 ... transfer it to a simulation system and test it. In the process of creating

2 TM210 - Working with Automation Studio

RequirementsTraining modules: –

SoftwareAutomation Studio 4.0Automation Runtime 3.09

Hardware X20CP1486

Page 3: Working with Automation Studio - WordPress.com · 15/01/2013 · TM210 - Working with Automation Studio 5 ... transfer it to a simulation system and test it. In the process of creating

Table of contents

TM210 - Working with Automation Studio 3

TABLE OF CONTENTS

1 INTRODUCTION.................................................................................................................................. 4

1.1 Training module objectives..................................................................................................... 41.2 Safety notices and symbols....................................................................................................5

2 INSTALLATION.................................................................................................................................... 6

2.1 Installation wizards..................................................................................................................62.2 Licensing................................................................................................................................. 7

3 STARTING AUTOMATION STUDIO....................................................................................................8

4 THE FIRST PROJECT.........................................................................................................................9

5 AUTOMATION STUDIO.....................................................................................................................10

5.1 The "CoffeeMachine" sample project................................................................................... 105.2 Automation Studio Help........................................................................................................ 115.3 The workspace......................................................................................................................135.4 Basic concept........................................................................................................................195.5 Creating a concept................................................................................................................195.6 Organization of software - Logical View............................................................................... 225.7 Organization of hardware - Physical View............................................................................225.8 Managing configurations - Configuration View..................................................................... 235.9 Relationship between functionality and task.........................................................................24

6 CONFIGURING THE HARDWARE................................................................................................... 27

6.1 Inserting I/O modules from the Hardware Catalog............................................................... 286.2 Assign variables to I/Os........................................................................................................296.3 I/O configuration....................................................................................................................306.4 Configuring network interfaces............................................................................................. 316.5 Compile the project...............................................................................................................32

7 CREATE A COMPACTFLASH CARD............................................................................................... 33

8 CONNECTING TO THE TARGET SYSTEM..................................................................................... 34

9 PROGRAMMING................................................................................................................................37

9.1 Programming languages....................................................................................................... 379.2 Initialization and cyclic sections of a program...................................................................... 389.3 Variables and data types......................................................................................................399.4 The cross reference list........................................................................................................ 419.5 Teamwork..............................................................................................................................419.6 Hardware and software upgrades........................................................................................ 43

10 SUMMARY....................................................................................................................................... 44

Page 4: Working with Automation Studio - WordPress.com · 15/01/2013 · TM210 - Working with Automation Studio 5 ... transfer it to a simulation system and test it. In the process of creating

Introduction

4 TM210 - Working with Automation Studio

1 INTRODUCTION

Automation Studio is the programming environment for B&R automation components, which include thecontroller, motion control, safety technology and visualization. The clear structure of projects and theability to manage a wide range of configurations and machine variations makes working in teams mucheasier.

Automation Studio start page

Users can choose between programming lan-guages, diagnostic tools and editors to create andmanage their projects. The use of standard li-braries provided by B&R and the IEC programminglanguages integrated in the system enable a highlyefficient workflow.

This training module will use simple exercises to demonstrate how to use the wide range of tools availablein Automation Studio. The extensive Automation Studio help system provides the basis for completingthe exercises in this training module.

1.1 Training module objectives

This training module will use simple exercises to demonstrate how to use the wide range of tools availablein Automation Studio. The extensive Automation Studio help system provides the basis for completingthe exercises in this training module.

You will learn how to…• Construct simple and complex machines• Create process variables• Create simple programs• Configure the B&R control hardware• Commission a B&R controller• Simulate and test sections of program

Page 5: Working with Automation Studio - WordPress.com · 15/01/2013 · TM210 - Working with Automation Studio 5 ... transfer it to a simulation system and test it. In the process of creating

Introduction

TM210 - Working with Automation Studio 5

1.2 Safety notices and symbols

The safety notices in this manual are organized as follows:

Danger: Disregarding the safety regulations and guidelines can result in major damage to ma-terial, severe injury or death.

Warning: Disregarding safety regulations and notices can result in severe injury or substantialdamage to equipment.

Caution: Disregarding safety guidelines and notices can result in injury or damage to equip-ment. Important information for preventing errors.

Notices and additional information in this manual are organized as follows:

Note: Important notices and additional information are shown here.

Help: Links to other documentation are given here. (Help, Data sheets, User's manuals)

Information: Information is highlighted here.

Example: An example will be shown to provide further insight.

Results: A brief summary of the results of a previous task will be shown here.

Design of the safety notices in external manuals:

This manual references other manuals. The design of the safety notices is described in the respectiveexternal manual.

Exercise: Tasks and exercises

Sections marked on the left side with an orange stripe contain descriptions of the tasks and associatedactions. Tasks are intended to deepen understanding of the information provided.

Page 6: Working with Automation Studio - WordPress.com · 15/01/2013 · TM210 - Working with Automation Studio 5 ... transfer it to a simulation system and test it. In the process of creating

Installation

6 TM210 - Working with Automation Studio

2 INSTALLATION

When you insert the Automation Studio DVD, installation begins automatically. Alternatively, you canstart the installation manually by opening the file "Install.exe".

2.1 Installation wizards

The installation wizard will guide you through the installation process. After you select your preferredlanguage, you can configure a number of installation options. Among other things, you can view infor-mation about the new version and the system requirements.

Automation Studio installation: Select the installationlanguage

Automation Studio installation: Installation options andversion information

You can choose from two types of installa-tion:• Standard installation

This is a normal installation. AutomationStudio will be installed on the computer'shard drive.

• Portable installationWith this type, Automation Studio can beinstalled on a removable storage device.

Dialog box to select standard or portable installation

The installation can take some time.

Automation Software \ Software installation \ Automation Studio

Page 7: Working with Automation Studio - WordPress.com · 15/01/2013 · TM210 - Working with Automation Studio 5 ... transfer it to a simulation system and test it. In the process of creating

Installation

TM210 - Working with Automation Studio 7

2.2 Licensing

After you install Automation Studio, you need to activate a license.

This process is started by entering the serial number in the licensing dialog box. The 11-digit serialnumber (beginning with the code 8986.. or A555..) can be found on your licence agreement.

The licensing window is displayed each time Automation Studio is started and can also be opened fromthe "About" dialog box.

Automation Studio licensing dialog box

Once the serial number has been entered in the licensing dialogbox, the license can be activated online if the workstation is con-nected to the Internet.

If you are unable to connect directly to the Internet, the processcan be completed manually at the B&R website (www.br-automation.com under Service →Software registration).

Before an Automation Studio license is activated, all functions are available for 30 workdays.After this time, the program will be locked until a license is activated.

Automation Software \ Software installation \ Automation Studio \ Licensing

Page 8: Working with Automation Studio - WordPress.com · 15/01/2013 · TM210 - Working with Automation Studio 5 ... transfer it to a simulation system and test it. In the process of creating

Starting Automation Studio

8 TM210 - Working with Automation Studio

3 STARTING AUTOMATION STUDIO

When you install Automation Studio, new entries are added in theWindows Start menu and on the desktop. Automation Studio cannow be launched from the Windows Start menu or using the shortcuton your desktop.

Automation Studio icon

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

Automation Studio start page

From the Automation Studio start page, you can create a new project or open an existing one.

You can also jump to the Getting Started section of the help system for an introduction to AutomationStudio. The start page also opens when you close a project, or you can open it any time by selecting<Help> / <Show Start Page> from the menu.

Page 9: Working with Automation Studio - WordPress.com · 15/01/2013 · TM210 - Working with Automation Studio 5 ... transfer it to a simulation system and test it. In the process of creating

The first project

TM210 - Working with Automation Studio 9

4 THE FIRST PROJECT

In this section we will use the Automation Studio Help system to create a new project, transfer it toAutomation Runtime simulation and then test the program using Automation Studio.

Exercise: Creating your first project using the help system

You can open the right section of the Automation Studio help system directly from the start page.

Automation Desktop start page

Procedure for creating your first project

1) From the start page, open the chapter "How do I create a control project?"

2) Select the sub-section

"ARsim example project"

3) Work through each of the steps

Under <Tools> / <Options> in the menu you can set the language of the Automation StudioOnline Help (German/English).

Selecting the help language

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 test it. In the process of creating your first project, youalready used several elements of Automation Studio. In the next few chapters, we will explainthe structure of an Automation Studio project using a sample project.

On PCs with a second monitor, the online help and Automation Studio can be displayed at thesame time. If there is no second monitor available, you can use the shortcut <ALT> + <TAB>to switch back and forth between them.

Page 10: Working with Automation Studio - WordPress.com · 15/01/2013 · TM210 - Working with Automation Studio 5 ... transfer it to a simulation system and test it. In the process of creating

Automation Studio

10 TM210 - Working with Automation Studio

5 AUTOMATION STUDIO

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

5.1 The "CoffeeMachine" sample project

The installation of Automation Studio includes several sample projects. One of these sample projects willbe used in this training module to illustrate the Automation Studio environment and its many functions.

Exercise: Sample Automation Studio project - "CoffeeMachine"

The sample project can be opened from the start page.

1) Open the sample Automation Studio project from the start page.

Selecting the sample project

2) Confirm unzipping the sample project

Open project with Automation Studio

The "CoffeeMachine" sample project has now been unzipped and opened in Automation Studio.

Page 11: Working with Automation Studio - WordPress.com · 15/01/2013 · TM210 - Working with Automation Studio 5 ... transfer it to a simulation system and test it. In the process of creating

Automation Studio

TM210 - Working with Automation Studio 11

5.2 Automation Studio Help

The Automation Studio help system is your constant companion throughout the development, configu-ration and commissioning of a project. It serves as a reference guide for using Automation Studio and itseditors, for creating a program or visualization application, for configuring drives. The Automation Studiohelp system also provides access to all of B&R's hardware documentation.

Exercise: Using the Automation Studio Help system

While working in Automation Studio, press the <F1> key to display help information on the selectedelement. Use the search function to find entries on a specific topic. The functions of the Help system aredescribed in the section Automation Software – How do I use this help documentation.

Automation Studio Help

5.2.1 Help Favorites

With Help Favorites, help articles can be managed and stored in an individualized structure. Help Fa-vorites can be stored in a file. This makes it possible to manage Help Favorites for various topics andto pass them on to others.

Page 12: Working with Automation Studio - WordPress.com · 15/01/2013 · TM210 - Working with Automation Studio 5 ... transfer it to a simulation system and test it. In the process of creating

Automation Studio

12 TM210 - Working with Automation Studio

Adding a help file using the shortcut menu

Add to favorites

Right-clicking on a help document allows you toselect the shortcut menu item "Add to Help Fa-vorites...", which adds the open help file to the helpfavorites. A dialog box is shown where you can se-lect the desired position in the favorites list.

Managing Help Favorites

Managing favorites

1 Saving and openingIn the File menu, Help Favorites can besaved to a file. Newly added Help Favoritesare automatically saved in this file.

2 Help Favorites listThe Help Favorites can be managed in atree structure. The entries can be movedand renamed. Clicking on an entry opensthe corresponding Help page.

3 ToolbarsUsing the "Help Contents" and "Help Fa-vorites" buttons, you can switch betweenthe Favorites view and the navigation treefor the Automation Studio Help documen-tation. The navigation tree remains syn-chronized.

Automation Software \ How do I use this help documentation? \ Help favorites

Page 13: Working with Automation Studio - WordPress.com · 15/01/2013 · TM210 - Working with Automation Studio 5 ... transfer it to a simulation system and test it. In the process of creating

Automation Studio

TM210 - Working with Automation Studio 13

5.3 The workspace

Automation Studio is divided into several different workspaces, each with a specific function.

The Automation Studio workspace

1 The Project Explorer is shown on the left side of the screen. Here you can manage and editthe software and configuration objects in your project.

2 In the center of the screen you have the workspace for open documents. Here you can editprogram code, for example.

3 On the right side of the screen you'll find the catalog toolbox. Depending on what object is cur-rently being edited, the catalog toolbox offers a selection of hardware modules or programmingfunctions.

4 In the lower left section of the screen you'll find the output window. This window shows you in-formation such as messages that are generated when building a project.

5 On the bottom right is the property window. This window displays the configuration options forthe currently selected object or hardware module. The properties can also be edited in thiswindow.

Project Management \ Workspace

Page 14: Working with Automation Studio - WordPress.com · 15/01/2013 · TM210 - Working with Automation Studio 5 ... transfer it to a simulation system and test it. In the process of creating

Automation Studio

14 TM210 - Working with Automation Studio

Exercise: Work with Automation Studio

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

1) Identify the individual workspace sections

2) Using context-sensitive help (<F1>) in the workspace

5.3.1 Changing the positions of windows

When you open a project, the windows are docked on the main Automation Studio window. The windowscan be undocked and moved by clicking and dragging the title bar.

Docking and undocking windows

Project Management \ Workspace \ Project Explorer

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 Outputwindow can be hidden automatically.

Setting with the pin symbol

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

Page 15: Working with Automation Studio - WordPress.com · 15/01/2013 · TM210 - Working with Automation Studio 5 ... transfer it to a simulation system and test it. In the process of creating

Automation Studio

TM210 - Working with Automation Studio 15

Hiding the project explorer and output window

The default layout in Automation Studio can be restored by selecting <Window / Reset WindowLayout> from the menu.

Reset window layout in Automation Studio

Project Management \ Workspace \ Project Explorer

5.3.3 Workbooks

Workbook mode presents a clear way of displaying open windows while making it much easier to switchbetween them. Windows can be cascaded, tiled horizontally or tiled vertically.

Workbook

If multiple editors are opened, each is opened in a separate workbook.

To maintain an overview of the opened workbooks, a list of them opens if you press the drop-downsymbol on the right side of the title bar.

Page 16: Working with Automation Studio - WordPress.com · 15/01/2013 · TM210 - Working with Automation Studio 5 ... transfer it to a simulation system and test it. In the process of creating

Automation Studio

16 TM210 - Working with Automation Studio

Overview of open workbooks

Project Management \ Workspace \ Workbook mode

5.3.4 Menu, Shortcut menu, Toolbox

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

Depending on the active editor, individual menu items may be shown/hidden or enabled/disabled. Thisallows only the functions available in the current context to be offered.

Many of the functions that can be reached from main menu can also be carried out usingtoolbars, shortcut keys or the shortcut menu (right click).

Toolbox - Catalog

In the Toolbox, programming icons or hardware modules are shown depending on the editor that ismarked.

Toobox - Ladder Diagram: Programming functions,commands, functions and function blocks

Toolbox - Hardware: Hardware modules, infrastructurecomponents

Page 17: Working with Automation Studio - WordPress.com · 15/01/2013 · TM210 - Working with Automation Studio 5 ... transfer it to a simulation system and test it. In the process of creating

Automation Studio

TM210 - Working with Automation Studio 17

Project management \ Workspace \ Menus

Project management \ Workspace \ Toolbars

Project management \ Workspace \ Shortcut keys

Project management \ Hardware management \ Physical View \ Editing operations

5.3.5 Programming made easy - Smart Edit

The SmartEdit feature combines a series of functions that support the intelligent input of information inAutomation Studio editors.

Smart Edit

Auto-complete

Use the <TAB> key for automatic code completion:

This is supported for the following elements:• Variable names and structure elements• Function name• Language constructs (IF THEN, CASE, FOR)

Code snippets

With the shortcut <CTRL> + <q>, <k> the CodeSnippets can be inserted. It is this ready-madesource code parts, which can manage the users inthe Code Snippet Manager itself.

Adding code snippets

Programming \ Editors \ General operations \ SmartEdit

Programming \ Editors \ Text editors

Project management \ Workspace \ Shortcut keys

Other editing functions facilitate the overview in the program code:• Tooltips• Syntax coloring• Coloring changed lines of code• Collapse and expand code segments• Opening the variable declaration window and function source code directly from the program

Collapse and expand code segments

Page 18: Working with Automation Studio - WordPress.com · 15/01/2013 · TM210 - Working with Automation Studio 5 ... transfer it to a simulation system and test it. In the process of creating

Automation Studio

18 TM210 - Working with Automation Studio

Function Keyboard shortcutClosing code snippets <TAB>

Auto-completing variables and function names <CTRL> + <SPACE>

Activating the code snippet selection window <CTRL> + <q>, <k>

Opening and closing outlining for all brackets <CTRL> + <q>, <l>

Opening and closing outlining for the current bracket <CTRL> + <q>, <m>

Go to variable declaration <CTRL> + <d>

Go to data type declaration for a variable <CTRL> + <t>

Go to implementation of a function or function block <CTRL> + <i>Table: Overview of helpful key combinations for SmartEdit

Page 19: Working with Automation Studio - WordPress.com · 15/01/2013 · TM210 - Working with Automation Studio 5 ... transfer it to a simulation system and test it. In the process of creating

Automation Studio

TM210 - Working with Automation Studio 19

5.4 Basic concept

The software being developed for an Automation Studio project can be organized in the Logical View (5.6"Organization of software - Logical View"). The software structure mirrors the structure of the machine.

This makes the organization of the software easy to follow, because there is a direct relationship betweenapplication and machine.

Structure and principle of Automation Studio

Once they are programmed and configured, software components can be assigned to different hardwareconfigurations (5.8 "Managing configurations - Configuration View").

This allows multiple variants of a single machine type to be managed in a single Automation Studioproject. These configurations can vary with regard to the software and hardware used (5.7 "Organizationof hardware - Physical View").

5.5 Creating a concept

The "CoffeeMachine" sample can be used to illustrate the path from an initial concept to a full represen-tation of the software and hardware components in Automation Studio.

Page 20: Working with Automation Studio - WordPress.com · 15/01/2013 · TM210 - Working with Automation Studio 5 ... transfer it to a simulation system and test it. In the process of creating

Automation Studio

20 TM210 - Working with Automation Studio

5.5.1 Overview of the machine

The software structure represented in Automation Studio is based on the machine and its functional units.

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 Software \ Sample Programs \ CoffeeMachine

Programming \ Structured Software Development

5.5.2 Function description

The software is structured according to the coffee preparation process.

Page 21: Working with Automation Studio - WordPress.com · 15/01/2013 · TM210 - Working with Automation Studio 5 ... transfer it to a simulation system and test it. In the process of creating

Automation Studio

TM210 - Working with Automation Studio 21

Function description of a program

Organization of software in AutomationStudio

The individual functions can be represented in Automation Studiousing clearly organized configuration and programming.

Page 22: Working with Automation Studio - WordPress.com · 15/01/2013 · TM210 - Working with Automation Studio 5 ... transfer it to a simulation system and test it. In the process of creating

Automation Studio

22 TM210 - Working with Automation Studio

5.6 Organization of software - Logical View

Program organization elements (POEs) are displayed in the LogicalView arranged in a tree structure.

Each of these units is organized into packages. A package mightinclude all of the software elements and documentation needed fora particular part of the system.

In this view, there is no direct correlation to the actual hardware beingused. It only serves to organize and manage the POUs.

Project Management \ Logical View

Logical view

5.7 Organization of hardware - Physical View

The X20CP1486 CPU in the Physical View

The hardware components of a system are config-ured and managed in the Physical View.

When creating a new project or system configura-tion (see 5.8 "Managing configurations - Configu-ration View") the CPU is selected (X20CP1486 inthe image).

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

System Designer

The System Designer provides a graphical representation of the configuration in the Physical View. Inthe System Designer, you can arrange control components just as they would be laid out in the actualmachine. I/O modules can be added and removed in the same way as in the Physical View (see 6.1"Inserting I/O modules from the Hardware Catalog").

Page 23: Working with Automation Studio - WordPress.com · 15/01/2013 · TM210 - Working with Automation Studio 5 ... transfer it to a simulation system and test it. In the process of creating

Automation Studio

TM210 - Working with Automation Studio 23

The System Designer can be opened from the toolbar of the Physical View

Project Management \ Hardware Management

5.8 Managing configurations - Configuration View

In the Configuration View, various different machine types can bemanaged.

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

As shown in the "CoffeeMachine" example, this project includes sev-eral different configurations. The first one is purely a simulation en-vironment, the others correspond to actual hardware structures.

Configuration View with activeconfiguration [Active]

A configuration consists of hardware and software. Only one configuration can be active [Active] at anygiven time.

When you activate a configuration by double-clicking on it, the hardware assigned to it is displayed inthe Physical View.

Project Management \ Configuration View

Page 24: Working with Automation Studio - WordPress.com · 15/01/2013 · TM210 - Working with Automation Studio 5 ... transfer it to a simulation system and test it. In the process of creating

Automation Studio

24 TM210 - Working with Automation Studio

5.9 Relationship between functionality and task

The software elements of the currently active configuration that can be transferred to the target systemare displayed in the software configuration.

There are two ways to assign a software element to a configuration:• 5.9.2 "Automatic assignments when creating a program"• 5.9.3 "Adding existing programs manually"

Software assignments

Project Management \ Logical View \ Wizards in the Logical View \ Automatic software assign-ments

5.9.1 Open the software configuration

To open the software configura-tion, double-click on the CPU in thePhysical View or right-click on theCPU and select Software from theshortcut menu.

Open software configuration from CPU's shortcut menu

Page 25: Working with Automation Studio - WordPress.com · 15/01/2013 · TM210 - Working with Automation Studio 5 ... transfer it to a simulation system and test it. In the process of creating

Automation Studio

TM210 - Working with Automation Studio 25

5.9.2 Automatic assignments when creating a program

If you add a program in the Logical View, the last Wizard dialog boxfor this task gives you the chance to decide how it is added to thesoftware configuration.

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

In both cases, the programs are automatically added to the defaulttask class in the software configuration.

Assigning the software to one or moreCPUs

In the software configuration, the order and priority of programs can be changed by movingthese objects.

Real-time operating system \ Method of operation \ Runtime performance \ Task classes

5.9.3 Adding existing programs manually

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

With the software configuration open select the Logical View in the Project Explorer.

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

Assigning software elements to the software configuration

With this procedure, a configuration of individually selected programs can be assigned.

Page 26: Working with Automation Studio - WordPress.com · 15/01/2013 · TM210 - Working with Automation Studio 5 ... transfer it to a simulation system and test it. In the process of creating

Automation Studio

26 TM210 - Working with Automation Studio

Exercise: Create a new configuration

Create a new configuration in the "CoffeeMachine" project with anX20 CPU (X20CP1486)

1) Create a new configuration called "X20CP1486"

2) Adding the required hardware

3) Open the software configuration

4) Assigning the software

The goal of this exercise not to create a fully functional configuration.It's purpose is only to show how software elements can be assignedto the new configuration.

Adding a new configuration in theConfiguration View

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

Page 27: Working with Automation Studio - WordPress.com · 15/01/2013 · TM210 - Working with Automation Studio 5 ... transfer it to a simulation system and test it. In the process of creating

Configuring the hardware

TM210 - Working with Automation Studio 27

6 CONFIGURING THE HARDWARE

This chapter is based on the project created in 4 "The first project".

This project already contains a configuration based on the "Standard PC" (ArSim) and a Ladder Diagramprogram with two variables.

Exercise: Configuring the hardware

Close the active project by selecting <File> / <Close Project> fromthe menu. The start page appears again, where the previously cre-ated project can be opened from a list of "Recent Projects".

Assign the LampTest“„ program to the task class Cyclic #1.

1) Create a new configuration

2) Assign the program to the software configuration

3) Insert I/O modules on the X2X Link interface

4) Assign variables to I/Os

5) Configuring the Ethernet Interface

6) Compile the project

7) Generating a CompactFlash image

Requirements:

° CompactFlash adapter° CompactFlash - 512 MB° X20 CPU (e.g. X20CP1486)° Digital input and output module (X20DI9371 and

X20DO9322)° Point-to-point connection between the PC and the X20

CPU with a crossover Ethernet cable

8) Establishing a connection to the controller

Setting up a Compact Flash card

This task consists of multiple subtasks, which will be explained in detail.

Page 28: Working with Automation Studio - WordPress.com · 15/01/2013 · TM210 - Working with Automation Studio 5 ... transfer it to a simulation system and test it. In the process of creating

Configuring the hardware

28 TM210 - Working with Automation Studio

6.1 Inserting I/O modules from the Hardware Catalog

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

To insert I/O modules on the X2X Link interface, the interface must first be selected in the Physical View.Then you can drag and drop the I/O modules from the Hardware Catalog to the desired position.

Assigning an I/O module using drag-and-drop

Selecting the X2X interface filters the modules displayed in the Hardware Catalog to show onlythe ones that could be added there. You can set additional filters to further narrow down theresults.

Or you can search for a particular module by entering all or part of its model number.

Exercise: Add a digital input and output module

Using the Getting Started section of the Automation Studio help system as a guide, insert the two X20modules in the Physical View. Insert one digital input module (X20DI9371) and one digital output module(X20DO9322).

1) Open help section:

Automation Software \ Getting Started \ Creating programs with Automation Studio \ As-signing variables to I/Os

2) Select X2X Link interface

3) Insert module at X20 Link interface via drag-and-drop

Page 29: Working with Automation Studio - WordPress.com · 15/01/2013 · TM210 - Working with Automation Studio 5 ... transfer it to a simulation system and test it. In the process of creating

Configuring the hardware

TM210 - Working with Automation Studio 29

X20 I/O modules are connected to each other via X2X Link.

X2X Link guarantees maximum resistance to disturbances as well as worldwide compatibilitythanks to its twisted copper cables.

Communication \ X2X

6.2 Assign variables to I/Os

I/O mapping refers to the assignment of variables in the controller program to a module's I/O channels.

This is done in the I/O mapping editor, which can be opened by right-clicking on an I/O module andselecting <I/O Mapping> from the shortcut menu, by selecting <Open> / <I/O Mapping> from the mainmenu or simply by double-clicking on the respective I/O module.

Opening the I/O mapping of a module

Exercise: Mapping variables to I/O channels

Using the Getting Started chapter of the Automation Studio Help system as a guide, assign the twovariables to a digital input channel and a digital output channel.

1) Open the Help section:

Automation Software \ Getting Started \ Creating programs with Automation Studio \ As-signing variables to I/Os

2) Open I/O mapping

3) Assign the variable "Switch" to a digital input channel

Page 30: Working with Automation Studio - WordPress.com · 15/01/2013 · TM210 - Working with Automation Studio 5 ... transfer it to a simulation system and test it. In the process of creating

Configuring the hardware

30 TM210 - Working with Automation Studio

4) Assign the variable "Lamp" to a digital output channel

Programming \ I/O configuration \ I/O mapping

6.3 I/O configuration

The ever-increasing functionality of remote B&R I/O modules results in more and more possibilities andoperating modes in which these modules can be used.

The I/O configuration allows you to configure I/O modules without having to do any programming.

The I/O configuration can be opened via the shortcut menu for the respective I/O module - <I/O Config-uration> or using the <Open> / <I/O >Configuration> menu.

Opening the I/O configuration of a module

If I/O modules or interfaces are marked in the Physical View, the Property Window is updatedin the lower right section of Automation Studio. The Property Window shows all configurationpossibilities that are valid for the marked components. The individual property categories canbe reached via various workbooks.

The Property Window is updated immediately after selection - Property categories

Programming \ I/O configuration

Page 31: Working with Automation Studio - WordPress.com · 15/01/2013 · TM210 - Working with Automation Studio 5 ... transfer it to a simulation system and test it. In the process of creating

Configuring the hardware

TM210 - Working with Automation Studio 31

6.4 Configuring network interfaces

Automation Studio requires a network connection in order to communicate with the controller.

The following requirements are necessary to make this possible:• PC and controller are in the same network• The permitted and assigned IP addresses are known

If the PC is already operated in a network, make a note of the settings before changing themso you can change them back later.

Please contact your system administrator for more detailed information about changingthe network settings.

The network properties for the controller can be opened via the shortcut menu for the respective Ethernetinterface on the controller. The network interface can then be configured in the device parameters.

Opening and editing network settings for the controller

Exercise: Configuring the network interface on the controller and the PC

The Automation Studio help documentation provides support when configuring the network interfaces onthe PC and the controller.

Getting Started \ Creating programs with Automation Studio \ First X20 CPU project \

• Ethernet settings on the target system• Ethernet settings on the PC• Configuring the online connection

Programming \ Build & Transfer \ Establishing a connection to the target system

Communication \ Ethernet \ AR configuration \ Interface configuration

Page 32: Working with Automation Studio - WordPress.com · 15/01/2013 · TM210 - Working with Automation Studio 5 ... transfer it to a simulation system and test it. In the process of creating

Configuring the hardware

32 TM210 - Working with Automation Studio

6.5 Compile the project

Once a program has been completed and transferred to the target system it must then be built.

Building the configuration

During the build process, all changes that have been made since theprevious build are compiled. Start the build process by clicking onthe Build icon in the toolbar or pressing the F7 key.

A successful build is confirmed in the output window as follows:Build: 0 error(s), 0 warning(s). Successfully compiled configuration

Build and transfer.

The project can only be transferred to the target systemif the target system has a working configuration (e.g.Ethernet settings on target system) on its CompactFlashcard.

Recompiling a configuration

During a rebuild, all software objects in the active configuration are regenerated, regardless of whethertheir source files have changed since the last build.

After a rebuild, the project should not be transferred with theCPU in RUN mode. Instead, the CPU should be switchedto SERVICE mode before transferring the project.

Rebuild the project

Programming \ Build & Transfer \ Build

Page 33: Working with Automation Studio - WordPress.com · 15/01/2013 · TM210 - Working with Automation Studio 5 ... transfer it to a simulation system and test it. In the process of creating

Create a CompactFlash card

TM210 - Working with Automation Studio 33

7 CREATE A COMPACTFLASH CARD

Before the target system can be commissioned, it is first necessary to set up a CompactFlash card usingAutomation Studio. This process partitions the CompactFlash card, transfers the operating system andmakes the necessary system settings.

The CompactFlash data can be generated using Automation StudioOpen the dialog box for setting up the Compact Flash by selecting<Tools> / <Create CompactFlash>.

Begin generating CompactFlash data

You'll need a CompactFlash card and a CompactFlash adapter. It's also possible to include thesource files for the Automation Studio project with the CompactFlash data. This option can beselected in the configuration's properties in the Configuration View.

Exercise: Generating CompactFlash data

Using the Automation Studio help system as a guide, generate CompactFlash data.

Getting Started \ Creating programs with Automation Studio \ First X20 CPU project

• Generating CompactFlash data

Once the CompactFlash card has been inserted in the X20 CPU and the power has been turned on,the controller starts. If the network settings have already been configured (see 6.4 "Configuring networkinterfaces"), then it is now possible to connect to the controller.

Page 34: Working with Automation Studio - WordPress.com · 15/01/2013 · TM210 - Working with Automation Studio 5 ... transfer it to a simulation system and test it. In the process of creating

Connecting to the target system

34 TM210 - Working with Automation Studio

8 CONNECTING TO THE TARGET SYSTEM

The network interface settings for the PC and the controller were described in the previous section. Thesettings need to be configured once before a connection can be established.

There are two ways to establish a connection:• Browse the network• Configure manually

To open the configuration dialog box for the controller's connection settings select <Online - Settings>from the main menu.

Browse the network

Use the "Browse" button to activate the search function for the network. This opens a second window.After a few seconds, the results of the network search appear. Check the list of results to see if thedesired CPU was found on the network. To select a connection, right-click on it and choose "Connect"from the shortcut menu.

Browse the network and connect to the controller

1 Browse the network using the "Browse"icon in the toolbar, the results are listed inthe right section of the workspace

2 Select "Connect'" from the shortcut menu

If the network settings for the controller found on the network don't match the PC, the entryis marked red. The IP parameters can be changed temporarily in the shortcut menu for eachentry. When the controller is restarted the project settings are used again.

Configure manually

If it's not possible to browse the network, for example if SNMP broadcasts are blocked, it is possible toset up an online connection manually.

1 Add a new connection using the icon inthe toolbar

2 Enter connection parameters (IP address,node number)

3 Activate online connection in the shortcutmenu for the new connection

Manually adding and configuring a connection

Page 35: Working with Automation Studio - WordPress.com · 15/01/2013 · TM210 - Working with Automation Studio 5 ... transfer it to a simulation system and test it. In the process of creating

Connecting to the target system

TM210 - Working with Automation Studio 35

Exercise: Connect to the controller

The task is to establish a connection with the controller. First, identify the controller on the network usingthe Browse function and connect to it.

Once there is a connection between the PC and the controller, the status of the online connec-tion is shown in Automation Studio's status bar.

Connection to controller established, controller is in RUN mode

It is now possible to transfer the project or perform diagnostics on the controller via the onlineconnection.

Documentation on the topic of online connections and communication

For more assistance on this subject, please consult the Automation Studio help documentation. Hereyou will find Automation Studio project settings for communication ports, the necessary PC parametersand a number of helpful tips.

Communication \ Online communication

Clicking on the texts in the overview takes you directly to the description of the settings for theAutomation Studio project and the PC.

Additional information can be found in the listed sections of the help system.

Page 36: Working with Automation Studio - WordPress.com · 15/01/2013 · TM210 - Working with Automation Studio 5 ... transfer it to a simulation system and test it. In the process of creating

Connecting to the target system

36 TM210 - Working with Automation Studio

Build & transfer \ Establishing a connection to the target system

Build & transfer \ Establishing a connection to the target system \ Ethernet connection \ Browsefor targets

Communication \ Ethernet \ Network settings

Communication \ Ethernet \ FAQ

Communication \ Ethernet \ Online communication

Communication \ Serial \ FAQ

Communication \ Serial \ Online communication

Page 37: Working with Automation Studio - WordPress.com · 15/01/2013 · TM210 - Working with Automation Studio 5 ... transfer it to a simulation system and test it. In the process of creating

Programming

TM210 - Working with Automation Studio 37

9 PROGRAMMING

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

9.1 Programming languages

Programs can be created in several different programming languages in Automation Studio. It is possibleto combine several programming languages within one project.

The following programming languages are available

Programming language IEC61131 CommentLadder Diagram (LD) Yes Graphical

Function Block Diagram (FBD) Yes Graphical

Continuous Function Chart (CFC) No Graphical

Sequential Function Chart (SFC) Yes Graphical & textual

Instruction List (IL) Yes Textual

Structured Text (ST) Yes Textual

ANSI C and C++ No TextualTable: Programming language overview

In Automation Studio, all textual programming languages use the same editor. Diagnostic tools are there-fore always the same and are operated in the same way. This uniformity simplifies workflow and increas-es productivity.

Function blocks from B&R standard libraries can be called and used in all programming lan-guages.

Programming \ Programs

Page 38: Working with Automation Studio - WordPress.com · 15/01/2013 · TM210 - Working with Automation Studio 5 ... transfer it to a simulation system and test it. In the process of creating

Programming

38 TM210 - Working with Automation Studio

9.2 Initialization and cyclic sections of a program

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

Selecting the program sections when creating a program

Task initialization

When the cyclic system is started, every task runs through its initialization program. This initializationprogram can contain program code that defines variable values.

Cyclic section of a task

The cyclic section of the program starts after task initialization is complete. Variables that are assignedvalues there retain them until they receive new ones or the system is restarted.

Exit section of the program

A task's exit program is called when uninstalling (deleting) the task. If resources (memory, interfaces)were used in the init or cyclic program, then these resources must be correctly released.

Additional information can be found in training module TM213 - Automation Runtime.

Real-time operating system \ Method of operation \ Runtime performance \ Tasks

Page 39: Working with Automation Studio - WordPress.com · 15/01/2013 · TM210 - Working with Automation Studio 5 ... transfer it to a simulation system and test it. In the process of creating

Programming

TM210 - Working with Automation Studio 39

9.3 Variables and data types

Variables are locations in memory for application-specific data ranges. In Automation Studio, variablesare declared in a .var file.

Programming is simplified by the use of symbolic variable names.

Variable declaration

Data types describe the properties of a variable, such as the range or the precision of the numbercontained in the variable, or which operations can be performed on it.

Data type of a variable

Programming \ Variables and data types

User-defined data types can be created by the user based on the simple data types. In AutomationStudio, user-defined data types, also known as derived data types, are declared in a .typ file.

Declaration of data types

Programming \ Variables and data types \ Data types \ Composite data types

Page 40: Working with Automation Studio - WordPress.com · 15/01/2013 · TM210 - Working with Automation Studio 5 ... transfer it to a simulation system and test it. In the process of creating

Programming

40 TM210 - Working with Automation Studio

9.3.1 Variable scope

A project's packages can be arranged in a nested structure in the Logical View. This allows the data andfunctionality to be organized modularly.

This structure determines the scope and visibility of the declared variables and data types. A variablecan therefore be defined "logically" at the appropriate location in the project.

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

(1) Local variables are defined with a local scope for a program,and can't be used in the project's other POUs.

(2) Package-global variables declared within a package are valid inthe respective package and all subordinate packages and programs.However, the validity of these variables is global from the standpointof the controller.

(3) Global variables at the highest level are visible in the entireproject. They can therefore be used in any program at any level ofa package. Scopes in the Logical View

Programming \ Variables and data types \ Scope of declarations

9.3.2 Initializing and buffering variable values

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

Example of a variable declaration

Constants are variables whose values must not change while a program is executed. A constant isassigned its initial value when the software is created.

Remanent and permanent variables (Retain) are saved in buffered memory (SRAM) so that they can bereloaded after the system is restarted. Unlike remanent variables, permanent variables are also protectedagainst a cold restart.

In both cases, the buffering (battery, rechargeable battery) in the CPU or backplane is responsible forholding on to the data.

Page 41: Working with Automation Studio - WordPress.com · 15/01/2013 · TM210 - Working with Automation Studio 5 ... transfer it to a simulation system and test it. In the process of creating

Programming

TM210 - Working with Automation Studio 41

Inserting permanent variables

For variables to be stored in the permanent area, they have to be defined as Retain and Global in thevariable declaration.

Programming \ Variables and data types

9.4 The cross reference list

Common search tasks can be handled easily with the help of thecross 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 inthe program (read or write access).

In the general project settings you can activate the option to generatethis cross-reference list automatically when a project is built. Thissetting is made on the "General" tab under <Project> / <Settings>.

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

Activate cross-reference list

Project Management \ Workspace \ General project settings

9.5 Teamwork

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

Automation Studio has functions designed specifically to help teams work more efficiently:• Sharing project files with minimum sizes.• Working with source control

Project Management \ Importing / Exporting projects

Project Management \ Using source control systems

Page 42: Working with Automation Studio - WordPress.com · 15/01/2013 · TM210 - Working with Automation Studio 5 ... transfer it to a simulation system and test it. In the process of creating

Programming

42 TM210 - Working with Automation Studio

9.5.1 Exporting projects

An Automation Studio project can be shared with other programmersusing the Export function.

Export a project by selecting <File> / <Save Project As ZIP> or<File> / <Save Project As ZIP Without Upgrades> while in theLogical View.

Exporting software from the Logical View

9.5.2 Exporting and importing software components

A completed software component can be exported and imported, allowing it to be shared or reused inother projects.

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

If this package contains references to standard libraries, these can be specified in the properties of thepackage. These properties are checked when importing, and any required libraries are added automat-ically.

Exercise: Inserting a library sample

For B&R standard libraries, prepared samples are available in the form of a package. These can beimported into an existing project as needed. This exercise is not based on any particular application. It isonly intended to show how to import preprogrammed software components.

From the Logical View, import the component by selecting <Insert> / <Add Object> from the menu.

Importing a prepared library sample

Programming \ Examples

Page 43: Working with Automation Studio - WordPress.com · 15/01/2013 · TM210 - Working with Automation Studio 5 ... transfer it to a simulation system and test it. In the process of creating

Programming

TM210 - Working with Automation Studio 43

9.6 Hardware and software upgrades

Upgradeable components make it possible to update hardware and motion libraries and to upgrade tonew versions of Visual Components or Automation Runtime.

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

To perform an upgrade, select <Tools> / <Upgrades> from the menu. Available upgrades are listed ina separate dialog box.

Upgradeable components

Project Management \ Automation Studio upgrade

Page 44: Working with Automation Studio - WordPress.com · 15/01/2013 · TM210 - Working with Automation Studio 5 ... transfer it to a simulation system and test it. In the process of creating

Summary

44 TM210 - Working with Automation Studio

10 SUMMARY

Automation Studio is more than just a programming tool. It supports the user throughout the entire lifecycle of a machine – from the initial concept to the finished project.

The ability to clearly structure the software based on machine parts and to work with different configu-rations makes it possible to manage multiple machine variations in one project and allows a whole teamto work on the same project.

Automation Studio

Automation Studio is the reliable companion of the programmer, the service and maintenance technician,and offers just the right tool for any stage in a machine's life cycle.

Page 45: Working with Automation Studio - WordPress.com · 15/01/2013 · TM210 - Working with Automation Studio 5 ... transfer it to a simulation system and test it. In the process of creating

Training modules

TM210 - Working with Automation Studio 45

TRAINING MODULES

TM210 – Working with Automation StudioTM213 – Automation RuntimeTM220 – The Service Technician on the JobTM223 – Automation Studio DiagnosticsTM230 – Structured Software DevelopmentTM240 – Ladder Diagram (LD)TM241 – Function Block Diagram (FBD)TM242 – Sequential Function Chart (SFC)TM246 – Structured Text (ST)TM250 – Memory Management and Data StorageTM400 – Introduction to Motion ControlTM410 – Working with Integrated Motion ControlTM440 – Motion Control: Basic FunctionsTM441 – Motion Control: Multi-axis FunctionsTM450 – ACOPOS Control Concept and AdjustmentTM460 – Initial Commissioning of MotorsTM500 – Introduction to Integrated SafetyTM510 – Working with SafeDESIGNERTM530 – Developing Safety ApplicationsTM540 – Integrated Safe Motion ControlTM600 – Introduction to VisualizationTM610 – Working with Integrated VisualizationTM630 – Visualization Programming GuideTM640 – Alarms, Trends and DiagnosticsTM670 – Advanced Visual ComponentsTM800 – APROL System ConceptTM811 – APROL Runtime SystemTM812 – APROL Operator ManagementTM813 – APROL XML Queries and Audit TrailTM830 – APROL Project EngineeringTM890 – The Basics of LINUXTM920 – Diagnostics and Service for End Users

TM1010 – B&R CNC system (ARNC0)TM261 – Closed Loop Control with LOOPCONRTM480 – The Basics of HydraulicsTM481 – Valve-based Hydraulic DrivesTM482 – Hydraulic Servo Pump Drives

Page 46: Working with Automation Studio - WordPress.com · 15/01/2013 · TM210 - Working with Automation Studio 5 ... transfer it to a simulation system and test it. In the process of creating

Training modules

46 TM210 - Working with Automation Studio

Page 47: Working with Automation Studio - WordPress.com · 15/01/2013 · TM210 - Working with Automation Studio 5 ... transfer it to a simulation system and test it. In the process of creating

Training modules

TM210 - Working with Automation Studio 47

Page 48: Working with Automation Studio - WordPress.com · 15/01/2013 · TM210 - Working with Automation Studio 5 ... transfer it to a simulation system and test it. In the process of creating

TM21

0TR

E.4

0-E

NG

/ V

2.0.

0.4

©20

13/0

1/15

by

B&

R. A

ll rig

hts

rese

rved

.A

ll re

gist

ered

trad

emar

ks a

re th

e pr

oper

ty o

f the

ir re

spec

tive

owne

rs.

We

rese

rve

the

right

to m

ake

tech

nica

l cha

nges

.

www.br-automation.com