-4
Linking into user program
If you have not yet created a project, proceed as follows:
Start the SIMATIC Manager and create a new project using the guided dialogs via
File
Assistant
“New project”
(assign a project name).
Select the
SIMATIC 300-Station
. Open the S7 hardware configuration screen by selecting menu com-
mands
Edit
Open Object
.
Open the hardware catalog by selecting
Insert
Hardware Components
or
View
Catalog
. Select
SIMATIC 300
FM-300
FM357-2
(observe the order no.). Drag the FM 357-2 to the slot desired
(in the example: slot 4).
Save and compile your hardware project by selecting commands
Station
Save and Compile
.
The configured CPU and FM 357-2 are now included in your project in the SIMATIC Manager.
Open your project in the SIMATIC Manager.
Select
SIMATIC 300-Station
CPUxxx
S7-Program
.
Open library FM357_2L in the SIMATIC Manager with commands
File
Open...
Libraries
.
In this library, select S7 directory “BF_V3...”. This directory contains:
a “Symbols” file
a “Sources” directory
a “Blocks” directory
Select the “Symbols” file and copy it to your project under
SIMATIC 300-Station
CPUxxx
S7
Program
.
When the message “... Do you want to replace the existing object and all its contents?” is displayed,
click on
Yes
.
Open the “Sources” directory and copy the STL source file “fm357ob_n1” (one FM 357-2) to the
“Sources” directory of your project.
Open the “Blocks” directory and copy all the blocks it contains into the “Blocks” directory of your pro-
ject.
Open the copied STL source file “fm357ob_n1” (in “Sources” directory) in your project.
The LAD/STL/CSF editor is started.
Enter the FM 357-2 module address (256 in this example) in the FC 1 call line FMLADDR in OB 100.
Select menu commands
File
Save
and
File
Compile
to generate organization blocks (OB 1,
OB 82, OB 100) from the STL source.
Close the Editor.
Select
SIMATIC 300-Station
CPUxxx
S7 Program
Blocks
in the SIMATIC Manager. Load
all the S7 blocks (including system data) in this directory to your CPU (CPU must be in STOP state)
by selecting
Target System
Load
.
Test: Switch the CPU to the RUN state. After a maximum of 60 seconds, the yellow LED “DIAG” on
the FM 357-2 starts to flash cyclically to indicate successful combined power-up of the CPU
and FM 357-2.
For information about programming standard function blocks, please refer to Section 6 of the Manual.
– 4 –