FM 351 First Steps in Commissioning
Getting Started, 07/2007, A5E01092707-01
17
Linking to the user program
7
Integration in the user program
1. In SIMATIC Manager, choose "File > Open... > Libraries" to open the FMx51LIB library.
This library contains two program folders:
– FM 351,451 ABS V1
– FM 351 ABS V2
– For the FM 351 you can always use the function blocks (FB) and functions (FC) from
both program folders. However, for new applications you should utilize only the
FM 351 ABS V2 program folder. The blocks in the FM 351 ABS V2 program folder
also support access to a distributed FM 351 configuration via PROFINET.
2. Copy FC 0 and FB 1 from the "FM 351 ABS V2 / Blocks" folder of the FMx51LIB library to
the "Blocks" folder of your project.
3. Choose "Insert > S7 Block > Data Block" to insert DB1 as an instance DB of FB1 and
choose "Insert > S7 Block > Organization Block" to insert the OB 100 into the "Blocks"
folder of your project.
The instance DB for FB1 is referred to as a channel DB.
4. Now, open OB 1 and OB 100 in your project. In OB 1, call FB 1 and in OB 100 the FC 1
5. In OB 100, enter the module starting address of the FM 351 that you configured in
HW Config.
6. Then, open FC 0 using the DB number of the channel DB as a parameter.
OB 100:
CALL FC 0
DB_NO := 1
OB 1:
CALL FB 1, DB 1
7. Choose "File > Save" to save OB 1 and OB 100.
8. Select blocks FC 0, FB 1, DB 1, OB 1, and OB 100 in your project. Choose "PLC >
Download" to download your program to the CPU.