Siemens SIMATIC STEP 7 V5.2 Getting Started page 50

Table of Contents

Advertisement

Creating a Program with Function Blocks and Data Blocks
5.5
Generating Instance Data Blocks and Changing Actual
Values
You have just programmed the function block FB1 ("Engine") and defined, among
other things, the engine-specific parameters in the variable declaration table.
In order for you to be able to program the call for the function block in OB1 later
on, you must generate the corresponding data block. An instance data block (DB)
is always assigned to a function block.
The function block is to control and monitor a petrol or diesel engine. The different
setpoint speeds of the engines are stored in two separate data blocks, in which
the actual value (#Setpoint_Speed) is changed.
By centrally programming the function block only once, you can cut down on the
amount of programming involved.
5-14
The "Getting Started" project is open in
the SIMATIC Manager.
Navigate to the Blocks folder and click
in the right half of the window with the
right mouse button.
Insert a data block using the pop-up
menu with the right mouse button.
Apply the name DB1 in the "Properties
Data Block" dialog box, then select the
application "Instance DB" in the
adjacent pull-down list and apply the
name of the function block "FB1"
assigned.
Apply all the settings
displayed in the "Properties" dialog box
with OK.
The data block DB1 is added to the
"Getting Started" project.
Double-click to open DB1.
STEP 7 Getting Started
A5E00171228-01

Advertisement

Table of Contents
loading

Table of Contents