Creating a Program with Function Blocks and Data Blocks
5-7
STEP 7 Getting Started
A5E00171228-01
5.3 Programming
FB1
in Statement List
We will now show you how to program a function block which can, for example,
control and monitor a petrol or diesel engine using two different data blocks.
All "engine-specific" signals are passed on as block parameters from the
organization block to the function block and must therefore be listed in the variable
declaration table as input and output parameters (declaration "in" and "out").
You should already know how to enter an AND instruction, an OR instruction, and
the set/reset memory instructions with STEP 7.
Declare / Define Variable First
Your LAD/STL/FBD program window is
open and the option View > STL
(programming language) is activated.
Note that FB1 is now in the header,
because you double-clicked FB1 to
open the program window.
The variable declaration area consists of a variable overview (left pane) and of the
variable detail view (right pane).
In the variable overview, select the declaration types "IN", "OUT" and "STAT" one
after the other and enter the subsequent declarations into the corresponding
variable details.
In the variable overview, click the corresponding cells and apply the entries from
the subsequent figures. You can select the data type from the pull-down list
displayed.
Summary of Contents for SIMATIC STEP 7 V5.2
Page 4: ...Welcome to STEP 7 STEP 7 Getting Started iv A5E00171228 01 ...
Page 12: ...Introduction to STEP 7 1 6 STEP 7 Getting Started A5E00171228 01 ...
Page 22: ...Programming with Symbols 3 4 STEP 7 Getting Started A5E00171228 01 ...
Page 76: ...Downloading and Debugging the Program 7 14 STEP 7 Getting Started A5E00171228 01 ...
Page 88: ...Programming a Shared Data Block 9 4 STEP 7 Getting Started A5E00171228 01 ...
Page 100: ...Programming a Multiple Instance 10 12 STEP 7 Getting Started A5E00171228 01 ...
Page 110: ...Appendix A STEP 7 Getting Started A 2 A5E00171228 01 ...