You are on page 1of 54

The Basics of Automation Studio

TM210
Requirements

Training modules: Basic computer knowledge

Software: Automation Studio 2.5

Automation Runtime 2.82

Hardware: None

2 TM210 The Basics of Automation Studio


Table of contents

1. INTRODUCTION 4
1.1 Objectives 5

2. INSTALLATION 6
2.1 Installation procedures 6
2.2 Licensing 9
2.3 Directory structure 13

3. STARTING AUTOMATION STUDIO 14

4. THE FIRST PROJECT 16


4.1 Starting the emulator 16
4.2 Creating a connection 17
4.3 Creating a new project 19
4.4 Creating a ladder diagram task 23
4.5 Inserting a function block 26
4.6 Building and transferring 29
4.7 Monitor mode 30

5. AUTOMATION STUDIO STRUCTURE 31


5.1 Using the AS online help 31
5.2 Structure 32
5.3 Project structure 35
5.4 Window management 36

6. VARIABLES 37
6.1 Scope of variables and constants 37
6.2 Data types 38
6.3 Declaring variables and constants 39
6.4 Arrays 44

7. INITIALIZATION 45

8. PROGRAMMING LANGUAGES 47
8.1 Overview 47
8.2 Possibilities 49

9. SUMMARY 52

The Basics of Automation Studio TM210 3


Introduction

1. INTRODUCTION
Automation Studio is a programming environment used with the
automation components from B&R. It provides the user with several
different programming languages and editors as well as numerous
diagnostics tools.

Fig. 1 The Automation Studio splash screen

This training module will use examples with the aid of the extensive
Automation Studio help system to demonstrate how to use the great
many tools available in Automation Studio. In addition, we will also
provide information about installing and registering Automation Studio.

4 TM210 The Basics of Automation Studio


Introduction

1.1 Objectives
You will learn how to work with Automation Studio by putting together a
typical project.

You will master data types and variables as well as their declaration.

Participants will become familiar with the programming languages


supported by Automation Studio, as well as the possibilities available for
each.

Fig. 2 Overview

The Basics of Automation Studio TM210 5


Installation

2. INSTALLATION
This part of the training module will cover the Automation Studio
installation. The following points will explain which actions are needed to
select the necessary components as well as how the software is licensed.

2.1 Installation procedures


All of the components that are needed to install Automation Studio
(including those that need to be installed first) are included on the
installation CD.

A basic prerequisite is the installation of "Microsoft .NET Framework 1.1".


This is a Windows component that, depending on what version of
Windows you are using, is automatically installed before Automation
Studio.

Each Automation Studio installation CD includes an installation menu that


usually opens up when the CD is inserted. This installation menu can also
be started by running "Install.exe".

Fig. 3 Installation menu

6 TM210 The Basics of Automation Studio


Installation

In the installation menu, you can select from five installation packages.

Automation Studio:
Automation Studio and all components

PVI Runtime :
Components for communication with the controller

Onboard AR upgrade:
The standard operating system can be updated with this program

AR install kits:
Installation of operating system kits

Version changer:
If multiple Automation Studio versions are installed, this program
can be used to activate the desired version

The Basics of Automation Studio TM210 7


Installation

2.1.1 Installing Automation Studio


Automation Studio is installed by selecting the corresponding menu item in
the installation menu. The Installation Wizard guides you through this
procedure.

Select the desired components from the following dialog box.

Fig. 4 Selecting components

Restart your PC if the Installation Wizard instructs you to do so.

#
Note:

Demos can be installed under the menu item "Presentations Videos" for
presenting basic functions step-by-step.

8 TM210 The Basics of Automation Studio


Installation

2.2 Licensing
A license code is needed to register Automation Studio. This is NOT the
B&R serial number on the Automation Studio CD.

When starting Automation Studio for the first time, you will be asked to
license your copy of the software. Automation Studio can be used for 30
days if it is not registered.

Fig. 5 Software not licensed

Fig. 6 Entering the serial number

The following items can be selected after the serial number has been
entered:

License automatically (online)


Licenses Automation Studio automatically over the Internet.
License manually (offline)
The software must be licensed manually on the B&R homepage
(www.br-automation.com).

The Basics of Automation Studio TM210 9


Installation

The following steps must be carried out when licensing the software
manually from the homepage.

Copying the system code


Licensing on the B&R homepage
Typing in the license code

Note: If the "Invalid ID" error message is returned, then there was
something wrong with the way the B&R serial number was entered.

The following window is displayed after the B&R serial number has been
entered successfully:

Fig. 7 Copying the system code

Copy the system code to the clipboard.

Now open up your Web browser and navigate to "Services Software


Registration Register" at www.br-automation.com.

10 TM210 The Basics of Automation Studio


Installation

Enter your system code into the "System Code" field and then click on the
Register button.

Fig. 8 Software registration

Now enter the reason for licensing and click on the (Register) button.

Fig. 9 Specifying the reason for registration

The Basics of Automation Studio TM210 11


Installation

You will then receive the license code, which should be copied to the
clipboard.

Fig. 10 Receiving the license code

Enter the license code in Automation Studio.

Fig. 11 Entering the license code in Automation Studio

Automation Studio has now been licensed.

12 TM210 The Basics of Automation Studio


Installation

2.3 Directory structure


After Automation Studio is installed, the following folders will be added
underneath the target directory you specified during installation:

Fig. 12 AS installation directory structure

Folder Contents
..As\gnuinst GNU compiler
..As\Library B&R standard libraries sorted according to operating system version
..As\System Operating systems
Help Complete documentation for Automation Studio in CHM format. This
help system can also be viewed by opening AS.chm.

The Basics of Automation Studio TM210 13


Starting Automation Studio

3. STARTING AUTOMATION STUDIO


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

Fig. 13 Automation Studio user interface

The Automation Studio user interface consists of the following elements:

Main menu
The main menu in B&R Automation Studio provides access to all
available functions.
Toolbars
The toolbars contain buttons that provide fast access to a wide
selection of commands and functions.
Workspace
This is where the window for an open project is shown. The project
window can either be maximized to fit into this area or sized
accordingly.
Output window
The output window is located at the bottom of the program window.
It is used to display compiler and debugger messages, etc. In
addition, it is where the search results for the "Find in Files" function
are output.

14 TM210 The Basics of Automation Studio


Starting Automation Studio

Status bar
The status bar at the bottom of the window displays the following
information:
Brief help about menu commands or toolbar icons
Status of the online connection between the programming device
and the target system
Status data for the currently active window

The Basics of Automation Studio TM210 15


The first project

4. THE FIRST PROJECT


In this section, we will be creating a new project, writing a program, and
transferring everything to the target system.
The individual steps for each of these will be explained.
More in-depth information about editors and how they are used as well
as the philosophy behind an application will be given in the next few
sections.

We will be using the AR000 runtime emulator, which is not capable of


handling real-time operations, as our target system.
This makes it possible to implement and test a project without having
hardware present physically.

4.1 Starting the emulator


Although the AR000 runtime emulator can't handle real-time functions, it
allows us to test different program sections in cyclic operation without
needing a real CPU.

Click on the Tools: AR000 menu item.

Fig. 14 Starting the emulator

The emulator is started.

Fig. 15 AR000 runtime emulation

We can now use AR000 as a target system to test our first project.

16 TM210 The Basics of Automation Studio


The first project

4.2 Creating a connection


In order to be able to work with a controller, it's necessary to establish a
connection to it. This is because we need to transfer the project to the
target system so that we can test it.

The following describes how to specify the type of connection.

Open up the Tools: Options... menu item.

Fig. 16 Connection menu

This opens the following window:

Fig. 17 Connection settings I

The Basics of Automation Studio TM210 17


The first project

Select the configuration AR000 which already exists.

Fig. 18 Connection settings II

The connection settings for emulation have now been completely set up.
This information does not have to be entered each time since this
connection is saved under the specified configuration name.

Accept the settings by clicking on OK.

18 TM210 The Basics of Automation Studio


The first project

4.3 Creating a new project


To create a new project with Automation Studio, use the File: New
project... menu item.

Fig. 19 Creating a new project I

The New Project Wizard helps you complete this task.

The following settings need to be made:

Fig. 20 Creating a new project II

The Upload hardware from target option means that the current hardware
configuration is uploaded using the configured connection.

Give your project a name, e.g. "sim" (max. 8 characters).


Select the path where your project will be stored, e.g. D:\Projects.
Continue with the wizard by clicking on Next.

The Basics of Automation Studio TM210 19


The first project

If the hardware upload is successful, you will receive the following image.

Fig. 21 Creating a new project III

Continue with the wizard by clicking on Next.

If an error occurred during the hardware upload, you will receive the
following window.

Fig. 22 Could not load hardware information from the target system

Deselect the Upload hardware from target checkbox in the previous


window.

Fig. 23 No hardware upload

20 TM210 The Basics of Automation Studio


The first project

Now you have to add the hardware manually.

Fig. 24 Selecting the AR000 runtime emulator

Select the AR000 runtime emulator and click on Next.

A summary of project data is shown next.

Fig. 25 Creating a new project IV

Close the wizard by clicking on Finish.

The Basics of Automation Studio TM210 21


The first project

Now you'll see the following view:

Fig. 26 New project

22 TM210 The Basics of Automation Studio


The first project

4.4 Creating a ladder diagram task


The following steps are necessary to insert a ladder diagram into the
project:

Inserting a ladder diagram program


Declaring variables
Programming the Ladder Diagram

Note:

A task is a software module programmed by the user. A task can be


created in any programming language and should be a self-contained
program section.

4.4.1 Insert ladder diagram task


Select Insert object... from the shortcut menu.

Fig. 27 Inserting an object

Select Cyclic object and click on the Next button.

Fig. 28 Selecting the object type

The Basics of Automation Studio TM210 23


The first project

Enter a name for the object into the Name field. This name must be 8
characters or less and may not contain special characters. Only the
unterline _ is allowed. Then change the type of the object to Ladder
Diagram. Click on Finish to accept your entries.

Fig. 29 Setting the object parameters

The ladder diagram is created in your project, and the ladder diagram
editor is opened. The following appears:

Fig. 30 Ladder diagram editor

An additional toolbar is displayed in the ladder diagram editor. These icons


can be used to insert coils and contacts into the ladder diagram program.

24 TM210 The Basics of Automation Studio


The first project

4.4.2 Programming the Ladder Diagram


The cursor (shown as a cross) blinks in the editor.
Now click on the icon to insert a normally open contact. A field with a
blinking cursor appears over the contact.

Enter a name for the contact and confirm it by pressing ENTER.


This opens up the declaration dialog box for the variable. Close this by
clicking on OK.

Fig. 31 Declaring the variable for the normally open contact

Insert a coil by clicking on the icon. Repeat the procedure you used for
the normally open contact.

Fig. 32 Declaring the variable for the coil

Your ladder diagram now looks like this:

Fig. 33 Finished ladder diagram

Save your work with the icon.

The Basics of Automation Studio TM210 25


The first project

4.5 Inserting a function block


Press enter to add a new network. Your ladder diagram editor now looks
like this.

Fig. 34: New network in the ladder diagram editor

Select the icon to add a function block. All of libraries in the project are
shown.

Fig. 35: Libraries selection window

26 TM210 The Basics of Automation Studio


The first project

Select show external libraries and enter "TON" for the filter (function block
for turn-on delay).

Fig. 36: Select "TON" function block

Confirm your selection with OK. You will now be requested to specify a
name for the function block.

Fig. 37: Entering a FBK name in the in the ladder diagram editor

The Basics of Automation Studio TM210 27


The first project

You can now connect the normally open contact diLight to the function
block input IN and a new coil with the name doLightdly to the function
block output Q. To connect a value to the analog function block input PT ,
press the select icon and enter the time. (T#1s for one second).

Fig. 38: Ladder diagram with a function block

28 TM210 The Basics of Automation Studio


The first project

4.6 Building and transferring


We have now successfully finished creating the project and programming
the ladder diagram. Now we have to transfer this program to the target
system where it can be executed.

To transfer the ladder diagram to the target system, click on the icon.

If there are already modules on your CPU, you will see the following
window.

Fig. 39 Deleting modules from other projects on the target system and Target system restart

Delete object from the target erases objects on the target system that
don't belong to your project.

In addition, you will be informed if a warm or cold restart needs to be


performed. Operating system parameters can only be applied after the
system is restarted.

Note:

Warm restart: System restart, RAM memory is kept.


Cold restart: System restart, RAM memory is cleared.

The ladder diagram program is now running on the target system. Now you
can test the program to make sure that it's working correctly.

The Basics of Automation Studio TM210 29


The first project

4.7 Monitor mode


If monitor mode is active, information from the target system is displayed
in various windows: The status of the individual contacts/coils and the
values of analog connections are displayed in the ladder diagram editor.

To enable monitor mode, click on the icon.

The following view then appears.

Fig. 40: Monitor view of the ladder diagram

Now you can check whether the value changed at the input produces the
desired result at the output.

We have now created an empty project with Automation Studio in addition


to establishing a connection to the target system. After a new program was
inserted, we added new variables to it. The variables we created were
connected in the ladder diagram editor. After the transfer, we used the
ladder diagram monitor to check the effect of entering different values.

30 TM210 The Basics of Automation Studio


Automation Studio structure

5. AUTOMATION STUDIO STRUCTURE


There are several windows and menus in Automation Studio that can be
accessed when a project is opened. It is necessary to explain and
understand the connections and associations between these different parts.
The structure allows for user-friendly operation.

5.1 Using the AS online help


The Automation Studio online help serves as a reference while working on
your own project.
It contains all the information you need about operating Automation Studio,
its editors, and its user interface. Hardware documentation for modules is
also included.

Fig. 41 Main headings in the online help system

We recommend getting as much information as possible from the


Automation Studio online help. Like Automation Studio itself, this
documentation is constantly being revised and improved.

Fig. 42 Automation Studio online help

The Basics of Automation Studio TM210 31


Automation Studio structure

You can obtain context-sensitive help in Automation Studio at any time.


Pressing the F1 key calls up corresponding help about the current context
(LD, hardware configuration, hardware modules, etc.).

You can also use the search function in the help to find information about a
certain topic.

Task:

Look for information about monitor mode in Automation Studio.


Determine which information you can find out about monitor mode.
Open up the online help for "The B&R Software - Diagnosis".

5.2 Structure
In Automation Studio, the hardware and software configurations are
separated into different windows. The hardware tree is located on the left-
hand side with the software tree on the right. The message window
supplements both and supports the user by providing messages.

Fig. 43 Automation Studio user interface

32 TM210 The Basics of Automation Studio


Automation Studio structure

5.2.1 Hardware tree


The hardware tree reflects the hardware being used in the project. The
backplane is shown in the form of the system being used. The CPU is then
shown with the interface modules followed by the I/O modules on the
backplane as well as remote I/O modules.

Fig. 44 Automation Studio hardware tree

Slot information important for addressing I/O data points is displayed in the
slot column to the right of the individual modules. A brief description of
the added module is displayed right next to that column.

The hardware tree is where I/O variables can be assigned to I/O module
channels.

Pressing the F1 key opens up the help window for the selected module.

The hardware tree combines the following:

A schematic display of the modules


The order of the modules on the backplane and remote I/O nodes
Slot information
Clear text descriptions for the modules
Variable assignments to I/O modules

The Basics of Automation Studio TM210 33


Automation Studio structure

5.2.2 Software tree


The software tree contains all of the software objects created and inserted
into the project. These include task, system, axis, visualization, and data
objects. This area shows both these software objects as well as their
resources graphically. Each object also displays information such as the
version number, file size, target memory and description.

The user himself is responsible for assigning version numbers and


descriptions for the tasks.

Fig. 45 Automation Studio software tree

Objects can be added and deleted in the software tree. These are
transferred to the target system when the project is transferred.

The software combines the following:

Graphic display of software objects


Arrangement of objects according to resources
Information about version numbers, file sizes, and target memory as
well as descriptions
Management of all software objects in the project

34 TM210 The Basics of Automation Studio


Automation Studio structure

5.2.3 Output window


The output window displays warnings with green text, errors with red text
and information with normal text. This is important information when
solving errors during compilation.

Fig. 46: Automation Studio output window

The output window combines the following:

Compiler warning and error messages


Double-clicking on a message brings you to the program line that
caused the error.
Progress and status display when downloading a project
Message display when inserting and deleting objects in the project
or on the target system
Output window for debugger messages
Output of results for the "Find in Files" function that searches all the
files in the project

5.3 Project structure


A project is divided up between several folders and files:

Library
The libraries used in the project
DBK
Project database with the declarations for
data types and variables
PGM
Source files and compiled objects
XXXXX.GDM
Project file that can be opened with
Fig. 47 Project structure
Automation Studio
XXXXX.hc
Hardware configuration file for the project
XXXXX.ini
Project-specific settings and editor settings

The Basics of Automation Studio TM210 35


Automation Studio structure

5.4 Window management


The various software objects are shown in windows in Automation Studio.
Windows are selected according to the Windows standard.

Fig. 48 Switching between the individual windows

Note:

It is helpful to close windows that are not needed (if finished editing for
quite a while).
The result is a cleaner, more efficient method of working.

36 TM210 The Basics of Automation Studio


Variables

6. VARIABLES
Variables are symbolic elements that are used during programming to
store values.
They represent memory positions that can be either read or written by
accessing a variable.
Using these symbolic elements allows the user to not worry so much about
memory management since this is handled by the programming task.

Constants are much like variables. The value of the constant is defined
while generating the software. Constants cannot be written during runtime.

6.1 Scope of variables and constants


There are two scopes that variables can have:

Global variables and constants are valid throughout the entire


project and can be accessed in any task.
Local variables and constants are only known to the task they are in.
They can only be accessed in that task.

The Basics of Automation Studio TM210 37


Variables

6.2 Data types


Data types describe the properties of a variable. For example, these can
include the possible range of the number stored in the variable, its
accuracy, or which operations are possible with it.

6.2.1 Basic data types


The following data types are among what are called basic (or primitive)
data types. They can be used in all programming languages.

Binary Unsigned Signed Floating Time, date, string


point
BOOL USINT SINT REAL TIME
UINT INT DATE_AND_TIME
UDINT DINT STRING

Data type Memory Value range


requirements
[bytes]
BOOL 1 TRUE (1), FALSE (0)
Digital inputs and outputs
SINT 1 -128 ... +127
INT 2 -32768 ... +32767
Analog inputs and outputs
DINT 4 -2147483648 ... +2147483647
USINT 1 0 ... 255
UINT 2 0 ... 65535
UDINT 4 0 ... 4294967295
REAL 4 -3.4E38 ... +3.4E38
TIME 4 T#-
24d_20h_31m_23s_648ms ...T#24d_20h_31
m_23s_647ms
DATE_AND_TIME 4 DT#1970-01-01-00:00:00 ... DT#2106-02-
07-06:28:15

STRING Variable Character string display

38 TM210 The Basics of Automation Studio


Variables

6.3 Declaring variables and constants


This determines how variables and constants will be declared in
Automation Studio.

6.3.1 Variable declaration of a task


A task's declaration window displays all of the local and variables that are
used in that task.

Select the task whose declarations you want to open in the software tree.

Open up the task's declaration window with the Open - Declaration menu
item or click on the icon.

Fig. 49 Opening the declaration window

This opens the following window:

Fig. 50 The declaration window

Variables can be added from the shortcut menu (New variable) or with the
Insert key (INS).

Fig. 51 Adding a new variable

A blank text field appears where the variable name can be entered.

The Basics of Automation Studio TM210 39


Variables

The different input fields can be used to modify the data type or scope of
new or existing variables as needed.

Fig. 52 Changing the scope

Double-clicking or pressing the spacebar in the "Data type" field opens up


the following window.

Fig. 53 Changing the data type

The category field allows you to choose between basic data types, user
data types, and function blocks.

The size can be defined using the Array input field (1 is the default setting)

The Attribute property can be used to specify whether you're dealing with
a variable or a constant. Constants are displayed in green by default.

Fig. 54 Changing the data type

The Value column is used to set the value of the constant.

Click on the icon to save the changes you have made thus far.

40 TM210 The Basics of Automation Studio


Variables

6.3.2 Global variable declaration


The global variable declaration window shows all of the global variables
being used in the project and allows new variables to be added.

To open the global variable declaration window, select the CPU entry in the
software tree and proceed as you would with the task declaration window.

Fig. 55 Opening the global variable declaration window

6.3.3 Structures (user data types)


The user can group a collection of variables in a structure. This allows
individual values that would otherwise be scattered around to be grouped
together to form structures that reflect a certain function or task.

Example: User data type

You have been given an assignment in which you have to create a


program that can bake two types of bread.
One type of bread is defined using the variables Water, Flour, Salt and
Yeast. The bread data type could consist of the following elements:
Water
Flour
Salt
Yeast

You need the bread types mixed and homemade. One advantage of the
structure is that you only have one variable "mixed_bread" and one
variable "homemade_bread" in your software. These variables each
contain the elements water, flour, salt and yeast.

To expand your program to include an extra type of bread, you only


have to create an additional variable (e.g. "white_bread") and have all of
the respective data. If you notice later that you also have to specify the
baking time for each type of bread, then you can simply expand the
structure to include the "baking time" element. As a result, you
immediately have a "baking_time" for all bread types.

In this example, you have three variables with the bread data type
instead of 15 individual variables.

The Basics of Automation Studio TM210 41


Variables

Creating a user data type:

To create data types in Automation Studio, click on the Open Data Types
menu item. The following view then appears.

Fig. 56 Data type editor

All of the data types that are in the project are displayed here.

Use the Insert New Type entry in the shortcut menu or the icon circled in
the toolbar below to add a new data type.

Fig. 57 Adding a new data type

Give the data type a name.

42 TM210 The Basics of Automation Studio


Variables

The Insert New Item entry in the shortcut menu or the icon circled in the
toolbar below can be used to add new data type elements to the data type.

Fig. 58 Adding elements

A finished data type might look something like this:

Fig. 59 Data type

6.3.4 Function block data types


Each function block has inputs and outputs that are grouped together in
the form of a structure. When the function block is called, the actual
program behind the function block receives this data structure.
In the Watch window, you can clearly see that a function block consists of
individual elements when it is added.

The Basics of Automation Studio TM210 43


Variables

6.4 Arrays
Arrays are variables that contain several elements with the same data type.
These elements are accessed using an index. These elements can be
declared either as basic data types (simple array) or as a user data type
(array of structures).

The array index always begins with 0. This allows the array index to receive
the value 0 (number of elements - 1) when accessing the individual
variables.

Accessing an element in a simple array looks like this:


ArrayVariable[ArrayIndex]

Arrays of structures would look like this:


ArrayVariable[ArrayIndex].Element

In Automation Studio, a variable can be declared as an array in the variable


declaration window when selecting a data type.

Fig. 60 Setting the size of an array

Arrays are used when variables of the same data type are needed (base
data type or structure).

44 TM210 The Basics of Automation Studio


Initialization

7. INITIALIZATION
The initialization of data is an important topic for guaranteeing that the
application will function correctly.

There are several ways for variables to be initialized either by the system
or by the user.
The initializations become accomplished in this order:

Variable declaration window


Task initialization
Cyclic task section

Variable declaration window:


Initialization values can be entered for variables and constants in the
variable declaration window.
The Value column is used to set the initialization value. There are two
possibilities:

Variables can be initialized with a fixed value (numeric value within


the value range of the variable).

To keep a variable's value after a restart (warm restart, power failure),


it must first be identified as remanent. These values are backed up in
a buffered memory area before a system restart or power failure and
reloaded during the restart (remain after a warm restart).

Fig. 61 Declarations

Task initialization:
If available, each task cycles through its initialization subprogram (Init-Sp)
when the system starts (this occurs before the cyclic part of the program is
executed).
This Init-Sp can contain program code that defines variable values.

Cyclic task section:


The cyclic part of the program starts after the variable declaration and the
task initialization. Variables that are assigned values there retain them until
they receive new ones or the system is restarted (see the sections on
variable declarations and remanent variables).

The Basics of Automation Studio TM210 45


Initialization

Remanent and permanent variables:


As mentioned above, remanent variables are stored in a secure memory
area during a system restart (warm restart of power loss) where they can
be read back once the system is finished restarted. Permanent variables are
handled in much the same way, except they can withstand cold restarts,
too. In both cases, the buffering (battery, rechargeable battery) in the CPU
or backplane is responsible for holding on to the data.

Fig. 62: Inserting a permanet variable I

Fig. 63: Inserting a permanent variable II

Each global variable defined as remanent can be added to the permanent


memory area. An operating hours counter is a typical example of a
permanent variable, which should not get erased when a cold restart
occurs.

Note:

The use of data objects and files is recommended for the nonvolatile
storage of data (machine parameters, recipes). Data is stored on the
Compact Flash.

46 TM210 The Basics of Automation Studio


Programming languages

8. PROGRAMMING LANGUAGES

8.1 Overview
Programs can be created in several different programming languages in
Automation Studio. It is possible to combine several programming
languages within one project.

The decision about which programming language to use depends greatly


on the task at hand. There are graphic and text-based programming
languages.

The following programming languages are available:

Programming language Note


Ladder diagram (LAD) Graphical
Sequential Function Chart Graphical & textual
(SFC)
Instruction List (IL) Textual
Structured Text (ST) Textual
Automation Basic (AB) Textual
ANSI C (C) Textual

Note:

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

The Basics of Automation Studio TM210 47


Programming languages

The editors for the different programming languages can be adapted to


meet the user's personal needs. The options window is opened via
Tools:Options.

Settings for the respective editor can be made using the tabs Editor,
Ladder, Declaration

Fig. 64: Setting options for the text editor

48 TM210 The Basics of Automation Studio


Programming languages

8.2 Possibilities
It is possible to set the desired application with each programming
language. Each language has its special strengths.

LAD SFC IL ST AB C

Logic
Arithmetic
Decisions
Loops
Step sequencers
Dyn. variables ()
Function blocks

Note:

Using function blocks allows functions that are not supported by a


programming language to be expanded.

The Basics of Automation Studio TM210 49


Programming languages

Ladder Diagram programming is performed using a graphic editor.

Fig. 65 Ladder diagram programming

ST is a type of textual high-level language programming.

Fig. 66 Structured Text programming

50 TM210 The Basics of Automation Studio


Programming languages

ANSI C is also a text-based high-level language. It has a different notation


and syntax than ST.

Fig. 67: ANSI C programming

The Basics of Automation Studio TM210 51


Summary

9. SUMMARY
Automation Studio makes it possible to program all of the automation
components provided by B&R.

Fig. 68 Automation Studio

You are now familiar with Automation Studio and have gotten to know the
Automation Studio online help system that will support you in the future
while you are working.

You know the different types of variable declarations, data types and arrays
as well as their characteristics.

The programming language overview allows you to select the language


that is best suited to your application.

52 TM210 The Basics of Automation Studio


Summary

Overview of training modules

TM200 B&R Company Presentation ** TM600 The Basics of Visualization


TM201 B&R Product Spectrum ** TM610 The Basics of ASiV
TM210 The Basics of Automation Studio TM630 Visualization Programming Guide
TM211 Automation Studio Online Communication TM640 ASiV Alarm System
TM212 Automation Target ** TM650 ASiV Internationalization
TM213 Automation Runtime TM660 ASiV Remote
TM220 The Service Technician on the Job TM670 ASiV Advanced
TM223 Automation Studio Diagnostics
TM230 Structured Software Generation TM700 Automation Net PVI
TM240 Ladder Diagram (LAD) TM710 PVI Communication
TM241 Function Block Diagram (FBD) TM711 PVI DLL Programming
TM246 Structured Text (ST) TM712 PVIServices
TM247 Automation Basic (AB) TM730 PVI OPC
TM248 ANSI C
TM250 Memory Management and Data Storage TM800 APROL System Concept
TM260 Automation Studio Libraries I TM810 APROL Setup, Configuration and Recovery
TM261 Closed Loop Control with LOOPCONR TM811 APROL Runtime System
TM812 APROL Operator Management
TM400 The Basics of Motion Control TM813 APROL XML Queries and Audit Trail
TM410 The Basics of ASiM TM830 APROL Project Engineering
TM440 ASiM Basic Functions TM840 APROL Parameter Management and Recipes
TM441 ASiM Multi-Axis Functions TM850 APROL Controller Configuration and INA
TM445 ACOPOS ACP10 Software TM860 APROL Library Engineering
TM450 ACOPOS Control Concept and Adjustment TM865 APROL Library Guide Book
TM460 Starting up Motors TM870 APROL Python Programming
TM890 The Basics of LINUX
TM500 The Basics of Integrated Safety Technology
TM510 ASiST SafeDESIGNER
**) see Product Catalog

The Basics of Automation Studio TM210 53


54
Summary

TM210
Weblink

Internationalitt
Kontakt (Headquarter)

Copyright Bestellnummer

The Basics of Automation Studio


Hinteres Deckblatt (auf durch 4 Teilbarer Seitenzahl)

TM210TRE.25-ENG 0907
2007 by B&R. All rights reserved.
All trademarks presented are the property of their respective company.
We reserve the right to make technical changes.

You might also like