Beruflich Dokumente
Kultur Dokumente
TABLE OF CONTENTS
Chapter 9 Function Block Diagram .........................................................................................................................................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 Function Block Types .............................................................................................................................................4
9.2.3 Functions in FBD....................................................................................................................................................4
9.2.4 FBD Pane...............................................................................................................................................................5
9.2.5 Toolbar Buttons......................................................................................................................................................6
9.2.6 Inserting a Function / Function Block......................................................................................................................7
9.2.7 EN Input Parameter ................................................................................................................................................8
9.2.8 Editing Parameter Properties...................................................................................................................................8
9.2.9 Making Connections...............................................................................................................................................9
9.2.10 Inverting Connections.........................................................................................................................................11
9.2.11 Adding Comments ..............................................................................................................................................11
9.2.12 Structure Pane.....................................................................................................................................................12
9.2.13 Changing the Page Setup.....................................................................................................................................13
9.2.14 Inserting a Page Break ........................................................................................................................................13
9.2.15 I/O Connections to Variables ..............................................................................................................................14
9.3 Signal Tracing within Function Block Diagrams ..........................................................................................................15
9.3.1 Changing Values Online .......................................................................................................................................15
9.3.2 Tracing Values Online within one Code Pane........................................................................................................16
9.3.3 Analyzing Function Blocks in Online Mode ..........................................................................................................17
9.3.4 Analyzing Parameters on Function Blocks ............................................................................................................18
9.3.5 Analyzing the FB Functionality.............................................................................................................................20
9.4 Find and Search Tools .................................................................................................................................................21
9.4.1 Searching for Variables in Code Blocks ................................................................................................................21
9.4.2 Searching for Variables in Programs .....................................................................................................................22
9.4.3 Search for Variables in Projects ............................................................................................................................23
9.4.4 Navigating to References ......................................................................................................................................25
Chapter 9 - 1
9.1.2 Legend
>
Italic
Bold
Chapter 9 - 2
3BSE043732
3BSE035980
3BSE035981
Structure Pane
FBD Pane
Chapter 9 - 3
Chapter 9 - 4
Inspect the function block diagram of the POU you are programming
Chapter 9 - 5
Toolbar
button
Menu Command
Insert > Function/Function
Block
Key
Ins
Chapter 9 - 6
Description
Insert new function or function
block
Use this command to assign
variables and constants to the
selected parameter of a
function block or function.
Ctrl + D
Connect Parameters
If it is a function/function block that supports configurable input parameters, these
inputs can be specified in the dialog window.
To go straight to the Connection dialog window, check Connect Parameters.
The EN checkbox makes the optional Enable parameter available (this is explained
in the next section).
Chapter 9 - 7
The EN parameter can be turned on/off when inserting a new function or function
block (see Insert Function/Function Block dialog section), or when editing the
parameter properties (see below).
Chapter 9 - 8
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.
Fill in the To field with a constant value or a variable name. To display a list of all
available variables, press Ctrl+J.
NOTE!
Press OK to close the dialog window or Apply/Next to apply the connection and
go the next parameter.
The Direction setting together with the value in the Next: drop-down list
determine what will happen when the Next button is pressed. In the example in the
figure pressing Apply/Next will move the selection forward to the next unconnected
parameter.
If the user enters a name that is not recognized by the system (i.e. not declared) and
presses OK or Apply/Next, the system will ask the user if the unknown name
should be declared by the system.
Chapter 9 - 9
For instance: NxxTemp is a RealIO variable. Type NxxTemp as main identifier and
then a . to see the structured variables.
Fill in the name of the variable in the actual Parameter field. Use the button
get a tree-like overview of the POU and its variables.
to
Chapter 9 - 10
Signal Inverted
Chapter 9 - 11
The structure pane consists of the following sizable and movable columns:
Chapter 9 - 12
Item shows the type name of the function block or function with their properties
in parentheses
Page Comment shows the comment on the top of the corresponding Function
Block Diagram page
Page No is given at the first function block or function of every page of the
Function Block Diagram
The FBD editor inserts the page break above this function block or function and
repaginates the Function Block Diagram code block.
Chapter 9 - 13
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:
Name
Data type
Description
Value
Bool
IOValue
Bool
Forced
Bool
Status
Dword
Use the Connection Tab of the hardware configuration editor to make connections
between Variables and I/O channels or other hardware channels.
NOTE!
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 - 14
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 - 15
Page reference
Page Number
Chapter 9 - 16
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 - 17
Descriptions of all parameters for a Function Block can be found in the Libraries. This
information can be viewed in both online and off line mode. Open the required Library
select the Function Block and view the Editor.
Chapter 9 - 18
NOTE!
Chapter 9 - 19
Chapter 9 - 20
Toolbar
button
Menu Command
Key
Description
Ctrl + F
F3
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 - 21
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.
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.
Chapter 9 - 22
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.
Chapter 9 - 23
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.
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.
Chapter 9 - 24
NOTE!
Chapter 9 - 25
Chapter 9 - 26