You are on page 1of 24

System 800xA Training

Chapter 9 Signal Tracing in FBD

TABLE OF CONTENTS

Chapter 9 Signal Tracing in FBD ............................................................................. 1


9.1 General Information .................................................................................. 2
9.1.1 Objectives ....................................................................................... 2
9.1.2 Legend ............................................................................................ 2
9.1.3 Reference Documentation .................................................................... 2
9.2 FBD Editor .............................................................................................. 3
9.2.1 Execution Rules ................................................................................. 3
9.2.2 Functions Blocks Types ........................................................................ 3
9.2.3 Functions in FBD ................................................................................ 4
9.2.4 FBD Pane ......................................................................................... 4
9.2.5 Toolbar Buttons ............................................ ¡Error! Marcador no definido.
9.2.6 Inserting a Function / Function Block....................................................... 6
9.2.7 EN Input Parameter ............................................................................ 7
9.2.8 Editing Parameter Properties ................................................................ 7
9.2.9 Making Connections ............................................................................ 8
9.2.10 Inverting Connections ...................................................................... 10
9.2.11 Adding Comments ........................................................................... 10
9.2.12 Structure Pane ............................................ ¡Error! Marcador no definido.
9.2.13 Changing the Page Setup .................................................................. 11
9.2.14 I/O Connections to Variables ............................................................. 12
9.3 Signal Tracing within Function Block Diagrams ................................................ 14
9.3.1 Changing Values Online ...................................................................... 14
9.3.2 Tracing Values Online one Code Pane .................................................... 15
9.3.3 Analyzing Function Blocks in Online Mode ............................................... 16
9.3.4 Analyzing Parameters on Function Blocks ................................................ 17
9.3.5 Analyzing the FB Functionality ............................................................. 19
9.4 Find and Search Tools .............................................................................. 20
9.5 Searching for Variables in Code Blocks.......................................................... 20
9.5.1 Searching for Variables in Programs ...................................................... 21
9.5.2 Searching for Variables in projects ........................................................ 21
9.5.3 Navigating to References.................................................................... 24

Chapter 9 - 1
T308-09 Signal Tracing in FBD - RevD.doc

9.1 General Information

9.1.1 Objectives

On completion of this chapter you will be able to:

 Configure simple application code


 Connect I/O signals to variables
 Follow signal flows and analyze the code

9.1.2 Legend

> Indicates when you go from one menu to a sub-menu

Italic Indicates object and file names

“ “ Indicates dialog box buttons, tabs, menus etc.

Bold Indicates important topics

Indicates start/explanation of student activity

9.1.3 Reference Documentation

3BSE035980 System 800xA Control

AC 800M Configuration

3BSE043732 System 800xA Control

AC 800M Planning

3BSE035981 System 800xA Control

AC 800M Binary and Analog Handling

Chapter 9 - 2
System 800xA Training

9.2 FBD Editor

Function Block Diagram (FBD) is a high-level graphical programming language. It


describes the POUs in terms of processing elements and displays the signal flow
between them, similar to electronic circuit diagrams.

It represents the function block and functions by graphical symbols (boxes), their input
and output parameters by pins of the boxes and the assignment of parameters by lines
between the pins. A comprehensive basic range of function blocks and functions are
available.

Declaration
Pane

FBD
Pane

9.2.1 Execution Rules

The execution order of function blocks and functions is defined at first by the order of
their creation. The execution order is represented by the order of the graphic symbols
(boxes) in FBD "from the left to the right" and "from the top to the bottom".

You can change the execution order later by moving the selected function blocks and
functions "up" or "down" within the structure pane. Just drag-and-drop the function
block within the structure pane.

9.2.2 Functions Blocks Types

Function blocks provide additional functionality for the programmer. ABB supplies a
large number of pre-defined function blocks in the standard libraries. For example, in
the library “BasicLib” there are function block types for timing, data conversion,
counting and much more. In the library “ProcessObjExtLib” there are function blocks
for valves and motors.

Chapter 9 - 3
T308-09 Signal Tracing in FBD - RevD.doc

Instances of function block types may be created in programs and control modules in an
application (provided the appropriate library is connected to that application).

9.2.3 Functions in FBD

The code shown in the diagram below consists of basic functions of ORs, ANDs and
NOTs. During run time each value can be seen dynamically. The small circle (Bubble) in
the line indicates an inversion of the signal.

The code shown below represents the following logic.

E = (A and not B) or (C and D)

9.2.4 FBD Pane

The FBD panes are the right upper and lower sub panes within the code pane if you are
working with the FBD editor. They contain the function block diagram of the POU you
are programming.

NOTE! By default only the lower sub pane is shown.


You can drag the separation line just underneath the variable declaration
pane to access the upper sub pane.

The FBD panes contain:

 Graphic symbols of function and function block (boxes)


 Instance names of the function blocks
 Comments attached to the function blocks and functions
 Assignment of parameters in form of connection lines between the graphic
symbols
 Comment of the page and footer

Chapter 9 - 4
System 800xA Training

Use the FBD panes to:

 Inspect the function block diagram of the POU you are programming
 Select, copy and paste functions and function blocks
 Create, modify and delete function blocks and functions
 Edit instance name of function blocks and edit comments
 Assign values to the parameters of function blocks and functions

Chapter 9 - 5
T308-09 Signal Tracing in FBD - RevD.doc

9.2.5 Inserting a Function / Function Block

There are several ways to insert a function/ function block;

1. Right click in code Pane.


2. Choose “New > Object” from the POU menu

New Object

In the dialog window a list of available functions and function block types is presented
in the drop-down list.

NOTE! Just type the first letters of the function name to jump to
that entry.

Properties

If it is a function/function block that supports configurable input parameters, these


inputs can be specified in the dialog window.

The “EN” checkbox makes the optional Enable parameter available (this is explained in
the next section).

Chapter 9 - 6
System 800xA Training

9.2.6 EN Input Parameter

The EN property for functions and function blocks in FBD makes it possible to write
code that corresponds to “IF statements” in the Structured Text language.

The EN parameter should be connected to a bool variable just as any other bool
parameter.

When the EN input is true, the function or function block will be executed, otherwise
not. When the EN input becomes false, all outputs will keep their values from the
previous cycle of execution.

NOTE! If a function has an EN input, it must be connected.

The EN parameter can be turned on/off when inserting a new function or function
block (see Insert Function/Function Block dialog section).

9.2.7 Editing Parameter Properties

Some functions or function blocks supports configurable parameters. For instance the
number of inputs on an AND function can be modified.

By clicking with the right mouse button on a function (box) you will see a menu, then in
'Set Number of Extensible Parameters'.

Chapter 9 - 7
T308-09 Signal Tracing in FBD - RevD.doc

Selection the Enable “EN” parameter, if required.

Delete

Right click Select “Delete” to delete the function block.

Set Number of Extender Parameters

Right click Select “Set Number of Extender Parameters” For instance the number of
inputs on an AND.

9.2.8 Making Connections

If a parameter is to be connected to another parameter, one of them must be an


output parameter and the other one an input parameter.

NOTE! An output parameter can be assigned to any number of input


parameters but never to another output parameter.

There are basically two ways of connecting the parameters (pins) of a function or
function block: Either you connect the parameters one-by-one or you connect them all
at once.

Connect each Parameter Separately

Right click on the parameter (pin) of the function block or function (box) to which you
want to assign a variable or a constant and select “Connect…” from the context menu.

Fill in the “To” field with a constant value or a variable name.

Press “OK” to close the dialog window and apply the connection of the parameter.

If the user enters a name that is not recognized by the system (i.e. not declared) and
presses “OK”, the system will ask the user if the unknown name should be declared by
the system.

Chapter 9 - 8
System 800xA Training

Access to Variables with Structured Data Types

You gain access to the components by using the syntax:


<main_identifier>.<component>

For instance: “gV1_Closed” is a RealIO variable. Type “gV1_Closed” as main identifier


and then a “.” to see the structured variables.

Connect All Parameters

To connect several of the parameters in one action, it is best to bring up the Parameter
Connections editor. Right click and select “Connections”.

Fill in the name of the variable in the actual “Parameter” field. Use the button to
get a tree-like overview of the POU and its variables.

Connect from one Function Block to Another

To connect two parameters to each other, select one parameter (pin) by clicking on it
with the left mouse button. Press the Ctrl key while clicking with the left mouse button
on the other parameter (pin) that you want to connect to.

NOTE! Be sure that you select one input parameter and one output
parameter.

Connect to a Previous Selection

To connect a parameter to another parameter, select the first parameter by clicking on


it with the left mouse button. Click on another parameter (pin) that you want to
connect to with the right mouse button.

Chapter 9 - 9
T308-09 Signal Tracing in FBD - RevD.doc

By this, you select the second parameter, though the selection of the first one remains,
and you open the context menu. Select “Connect to Previous Selection” from the
context menu to accomplish the connection.

9.2.9 Inverting Connections

To invert inputs to a function or function block right click on the input parameter, and
select “Inverted” from the menu.

A small circle (bubble) will appear on the inverted signals.

9.2.10 Adding Comments

It is possible to write comments to functions/function blocks and pages.

Edit Comments of Function Blocks and Functions

Select the function block or function to which you want to assign or edit a comment.
Select “Description” from the context menu and type in your comment.

Edit Page Comments

If you want to add a comment for a page in FBD, just right click and select “Pages” and
selection “Page Description” from the context menu.

Chapter 9 - 10
System 800xA Training

9.2.11 Changing the Page Setup

It is possible to change the layout of the FBD pane by selecting “Tools > Setup” and
select the “FBD/LD” tab. The settings in this page determine the page layout of the
currently displayed code block. The settings will be remembered by the system even if
the editor is closed.

The “Template” setting determines the page orientation and size.

 Exercise 9.1

Chapter 9 - 11
T308-09 Signal Tracing in FBD - RevD.doc

Name Data type Description


Value Bool Value used by the application code
IOValue Bool Value of the I/O channel. IOValue and Value are equal if
the channel is not forced.
Forced Bool Indicates whether or not the channel is forced (normally it
should be false).
Status Dword Status as a hexadecimal integer. The normal value is C0.

9.2.12 I/O Connections to Variables

Only variables can be connected to I/O channels. All I/O access is carried out through a
variable connected to an I/O channel.

The data types BoolIO and RealIO should be used to make the connections as discussed
in a previous chapter. Both data types are defined by the system and have the
following main components.

Use the “Connection” tab of the hardware configuration editor to make connections
between variables and I/O channels or other hardware channels.

NOTE! Connections can be edited only in Offline mode.

Chapter 9 - 12
System 800xA Training

It is possible to connect variables to I/O from the POU editor, but it is recommended to
do it from the I/O unit, because you cannot browse to the correct I/O address from the
I/O address column in the POU editor.

Chapter 9 - 13
T308-09 Signal Tracing in FBD - RevD.doc

9.3 Signal Tracing within Function Block Diagrams

9.3.1 Changing Values Online

When a controller project is in online mode and test mode, it is possible to inspect the
code while running it, and interact with the code. From the Project Explorer in online
mode, you have access to editors similar to those in offline mode.

You can open one or several new online editor windows from the Project Explorer by
double-clicking on the Diagram Organization Unit you want to view.

By using the online editors the code currently running in the controller(s) can be
inspected. Variable values and parameters can be changed.

Chapter 9 - 14
System 800xA Training

9.3.2 Tracing Values Online one Code Pane

Select a cross reference that connects the pins of function blocks or functions which
has a page reference on either input or output terminals. Click in cross reference and
use the “Go To Related Page Connector” command to navigate to the source of the
variable that is assigned to the selected parameter.

NOTE! The Go To Source and Go to Sink commands can only be used to trace
values within one Code Pane.

Page Reference

Page Number

Page Reference

Chapter 9 - 15
T308-09 Signal Tracing in FBD - RevD.doc

9.3.3 Analyzing Function Blocks in Online Mode

The function block shown in the diagram below is a ValveUni and is used for controlling
devices with one control (Out1) and two feedback contacts (FB1 and FB0). There are
numerous pins besides those actually used to control and monitor the device.

Certain signals have mandatory connections. These are the signals where the
connection pin passes through the function block. The line passing through the block
indicates that there are both input and output components of the signal (structured
data types).

NOTE! Only signals using simple data types can be viewed directly on the
Function Block.

Mandatory
connection

As the input and output signals are structured data types they can only be viewed at
the place where they are declared. In our case these are global variables on Application
level.

In online mode this variable can be expanded to view the value of the components.

Chapter 9 - 16
System 800xA Training

9.3.4 Analyzing Parameters on Function Blocks

The ValveUni block has the following parameters:

Descriptions of all parameters for a Function Block can be found in the Libraries. This
information can be viewed in both online and offline mode. Open the required Library
select the Function Block and view the Editor.

Chapter 9 - 17
T308-09 Signal Tracing in FBD - RevD.doc

NOTE! The Editor is read only.

Chapter 9 - 18
System 800xA Training

9.3.5 Analyzing the FB Functionality

If help is required to determine how a particular function block works, highlight the
block and press <F1>. This will bring up a contextual help page.

 Exercise 9.2

Chapter 9 - 19
T308-09 Signal Tracing in FBD - RevD.doc

9.4 Find and Search Tools

The Find and Search tools provide fast access to text/variables in Declaration pane,
Code pane, Message pane or Project by clicking on the following icons:

Toolbar Menu Command Key Description


button
Edit > Find… Ctrl + F Find text in the using Pane in the
POU editor and jump to the first
occurrence
Edit > Find Next F3 Jump to the next occurrence in the
using Pane
Edit > Find in Editor… Find all text in the using POU editor
and list results in Message Pane. You
can jump to the occurrence by
double clicking on the result
Edit > Search… Alt + F12 Powerful search tool. See next
section

9.5 Searching for Variables in Code Blocks

First open the diagram you want to search in and then click on “Find”.

A “Find” will only check for the search text in the opened Code tab in the POU.

With the standard settings, searching for a short text like “A” will find every letter “A”
in the open Code tab. If the variable you are looking for really is called “A” you should
check the “Match whole word only” box. “Match case” will only find the variable if it is
written exactly like the search text even with respect to the capital letters.

If you select a variable or parameter in the declaration pane and then do a “Find” the
name of the variable will be inserted automatically.

Chapter 9 - 20
System 800xA Training

9.5.1 Searching for Variables in Diagrams

First open the diagram you want to search in and then click on “Find in Editor”.

“Find in Editor” works similar to “Find” which is described in the previous paragraph.
The main difference is that now the whole POU gets searched and not only the opened
Code tab.

Search for a variable using the same option as mentioned previously.

In this example you will find 3 occurrences in the SxxPrg_React.TankControl.Prg


diagram.

When occurrences of that word are found, they will be shown in the “Find in Editor”
pane of the lower part of the POU. Here you can jump to the occurrence of the word by
double clicking on the text. A right click will show a menu with a “Go to” button.

9.5.2 Searching for Variables in projects

The Search and Navigation dialog can be accessed by selecting it from the “Edit” menu,
or by right-clicking on a Project Explorer object (not Tasks) and select “Search”.

Chapter 9 - 21
T308-09 Signal Tracing in FBD - RevD.doc

Search For:

Enter the text to search for. Search options (see below) can be selected for the entered
text. An empty text or an asterisk (*) character in the text field search for all texts. All
texts are case-insensitive, that is, a search for the texts "my", "My", "mY" and "MY" gives
the same search results.

Search In:

The selection in the drop-down list specifies the scope of the search. By default it
searches in the POU where you started the search.

Chapter 9 - 22
System 800xA Training

Search Options:

The default setting is “Match whole word”. The “Match substring” option searches for
all texts containing the entered text as a substring. And the “Match prefix” option
searches for all texts containing the entered text in the beginning of words.

Filter Result:

This option makes it possible to show references with write accesses only, or to show
references with read accesses only. The possible selections are shown in the picture.
“I/O Channel Out” shows references to output channels only and “I/O Channel In”
shows references to input channels only.

Always on Top:

If “Always on Top” is checked, the Search and Navigation dialog is placed in front of all
other Windows dialogs.

Rebuild (offline mode only):

By default the search data is rebuilt when Control Builder is entering online mode or
test mode. This setting ensures that the search data is consistent in online mode
compared to offline mode. By accessing Tools > Setup > Station > Search and Navigation
Settings, the user can configure when to perform an automatic “Rebuild”

Click the “Rebuild” button to rebuild the Search data base.

Chapter 9 - 23
T308-09 Signal Tracing in FBD - RevD.doc

9.5.3 Navigating to References

In the references pane you can double click on the blue texts. A POU editor
opens on the right code pane. If the code is written in for instance FBD you will
also be shown the right page of this code tab. On the page you will have to look
for the exact location. If necessary, you can do a “Find” to find it on the page.

 Exercise 9.3

Chapter 9 - 24

You might also like