Creating a Program with Function Blocks and Data Blocks
5-15
STEP 7 Getting Started
5E00171228-01
Confirm the subsequent dialog with
Yes to assign parameters to the
instance data blocks.
Next enter the value "1500" for the
petrol engine in the Actual Value
column (in the row "Setpoint_Speed).
You have now defined the maximum
speed for this engine.
Save DB1 and close the program
window.
In the same way as for DB1, generate
another data block, DB2, for FB1.
Now enter the actual value "1200" for
the diesel engine.
Save DB2 and close the program
window.
By changing the actual values, you have finished your preparations for controlling two
engines with just one function block. To control more engines, all you have to do is generate
additional data blocks.
The next thing you have to do is program the call for the function block in OB1. To do this,
continue reading in Section 5.6 for Ladder Logic, Section 5.7 for Statement List, or
Section 5.8 for Function Block Diagram, depending on the programming language you are
using.
You can find more information under Help > Contents
in the topics "Programming Blocks" and "Creating
Data Blocks."