Between I-slave 2 and DP master
1. Go to the block container of the SIMATIC Manager and select the Insert > S
Block > Function (or function block) menu command. You can also use the
"Insert New Object" shortcut menu.
Note
You must not use the FB numbers in the band of numbers you reserved for automatically added F-function blocks ("F-function blocks" parameter in the object properties for the F-CPU; see Configuring the F-CPU).
2. In the "General - Part 1" tab of the "Properties - Function" window, enter the name of the F-FB/F-FC. Select "F-FBD" or "F-LAD" as the programming language. Click "OK" to confirm.
The block symbol will be displayed in the SIMATIC Manager with a yellow background.
3. The created F-block can then be opened and edited with the FBD/LAD editor: Double click the F-FB/F-FC in SIMATIC Manager.
4. Enter the password for the safety program (password protection queries will no longer be mentioned in operating procedures below (see Access Protection). The FBD/LAD editor will open.
You should enable "Type test of addresses" in the "LAD/FBD" dialog in the FBD/LAD editor (Options > Settings).
Note
Only the following elements are displayed in the F-Program Elements Catalog: • Supported instructions (see Differences between the F-FBD/F-LAD
Programming Languages and the Standard FBD/LAD Languages ) • F-FBs and F-FCs from the block container of your S7 program
• F-blocks from F-libraries, e.g., F-application blocks of Distributed Safety F-library (V1)
• Multi-instances of the edited F-blocks
5. Edit your F-FB/F-FC block.
Note
An F-FB/F-FC called in F-CALL (which causes it to become an F-PB) cannot have any parameters because they cannot be assigned (see Defining F-Runtime Groups).
Note
F-FBs/F-FCs must not call themselves.
Note
When converting from F-FBD to F-LAD, graphic representation of certain F-FBD networks might not be possible; rather, these networks are displayed in STL. The STL code they contain cannot be changed.
Rule: there can be no STL networks in F-FBD representation. STL networks in
F-FBD must be represented again as F-FBD when they are converted to F-FBD.
!
WarningEditing the instance DB is not permitted online or offline and can cause the F-CPU to go to STOP mode.
Note
Accessing static parameters of instance DBs of other F-FBs is not permitted.
Note
When using F-FCs, note that write access must be used when output parameters of F-FCs are accessed the first time. This initializes the output parameters. Output parameters from F-FCs must always be initialized.
The F-CPU can go to STOP if this is not observed. One of the following diagnostics events will then be entered in the diagnostics buffer of the F-CPU: • "Data corruption in the safety program prior to output to F I/O"
• "Data corruption in the safety program prior to output to partner F-CPU" • "Safety program: internal CPU fault; internal error information: 404"
Note
Note that you can only read the input parameters in an F-FB/F-FC and only write to its output parameters.
Use an input/output parameter if you wish to read and write.
6. Save the F-FB/F-FC block.
Note
When an F-FBD/F-LAD block is saved in the FBD/LAD editor, only a local consistency check is performed for the F-block. A safety program is not yet generated.
Note
Occasionally, certain networks that you have edited in F-FBD are represented in STL (for example, preconfigured interconnections with edge memory bits and network access junctions) when you try to save the F-block. Such F-blocks cannot be saved. You must delete the STL network and replace the interconnections with your own networks, in which you direct the interconnection to a temporary variable. You can then use this temporary variable as an address.
Note
For greater clarity, assign unique symbolic names to the F-FBs/F-FCs you have created. These symbolic names appear in the "Details" view of the SIMATIC Manager, in the "Safety Program," and in the symbol table. Symbolic names are assigned in the same way as in the standard case.
"Check Block Consistency" Function
The "Check block consistency" function can be found in SIMATIC Manager in the "Edit" menu, if you have selected a block container.
The "Check block consistency" function rectifies many of the time stamp conflicts and block inconsistencies. You can use this function in your safety program for F- FBs, F-FCs, and F-DBs without know-how protection.. The procedure is the same as for a standard system
5.6.2
Creating and Editing an F-DB
F-DBs
Similarly to F-FBs/F-FCs, you can also create and edit F-DBs (with the F-DB programming language), for which read and write access of parameters is possible within one F-runtime group of the safety program.
When you edit, the data types are checked in incremental mode. Any errors detected are output in the FBD/LAD editor, as is the case for programming the standard user program.
Note
You must not use the DB numbers in the band of numbers you reserved for automatically added F-data blocks ("F-data blocks" parameter in the object properties for the F-CPU; see Configuring the F-CPU).
Note
When an F-DB is saved in the FBD/LAD editor, only a local consistency check is performed for the F-block. A safety program is not yet compiled.
Note
For greater clarity, assign unique symbolic names to the F-DBs you have created. These symbolic names appear in the "Details" view of the SIMATIC Manager, in the "Safety Program," and in the symbol table. Symbolic names are assigned in the same way as in the standard case.
Options for Data Blocks "Unlinked" and "DB is Write-Protected in the AS"
Note
The available option "Unlinked" in the object properties for a DB must not be set for F-DBs and instance DBs of F-blocks.
The available option "DB is write-protected in the AS" in the object properties for a DB must not be set for F-DBs and instance DBs of F-blocks.
If you have selected one of these options, the selection is corrected when the safety program is compiled.
F-Communication DB for Safety-Related CPU-CPU Communication via S7