Programming options
5.2 Structuring your user program is easy
Easy Book
56
Manual, 05/2009, A5E02486774-01
Creating a new code block
In this example, use the Project view to add an FC to the project. You also configure the
program block to enter the instructions in ladder logic (LAD). In the Project view, select the
PLC programming portal and select the PLC_1 device from the drop-down list. For this
example, the device is PLC_1. Double-click "Program blocks", then double-click the "Add
new block" command.
1.
In the "Add new block" dialog, click the
"Function (FC)" icon.
2.
Specify the programming language for the
FC by selecting "LAD" from the drop-down
menu.
3.
Click "OK" to add the block to the project.
Selecting the "Add new & open" option (default)
opens the FC in the Project view.
To save the project, click the "Save project"
button in the toolbar.
You can easily have any code block (OB, FB, or FC) in your user program call another FB or
FC.
1.
Open the code block that
will call the other block.
2.
In the project tree, select
the block to be called.
3.
Drag the block to the
selected network to
create a Call instruction.