Download Print this page

Siemens SIMATIC FM 351 Getting Started page 5

Hide thumbs Also See for SIMATIC FM 351:

Advertisement

Linking into your User Program
Open the FMx51LIB in the library in the SIMATIC Manager with
Copy FC0, FC1 and UDT1 from the blocks folder of the FMx51LIB library to the "Blocks" folder of your
project.
Select the menu command
project and then select the menu command
Open DB1 and create it with the assigned user-defined data type UDT1. This creates the channel DB.
Select
View
Data View
MOD_ADDR parameter and the channel number 1 for the CH_NO parameter in DB1.
Save DB1 with
File > Save
Now open OB100 and OB1 in your project. Call FC0 in OB100 and FC1 in OB1 and supply the FCs with
parameters (refer to the manual, Section 6.2 or 6.3):
OB100:
CALL FC0
DB_NO
:= 1
OB1:
CALL FC1
DB_NO
:= 1
RET_VAL := FW0
Save both OB100 and OB1 with
Select the blocks FC0, FC1, DB1, OB1 and OB100 in your project.
Download the your program to the CPU with
Test: Using "Monitor/modify variables" you can now monitor the selected channel as follows:
Create a symbol with the name "ABS" for DB 1 using the symbol editor.
Select the "Blocks" folder in your project. Using the menu command
Table
insert the variable table VAT 1 and confirm with OK.
Open the variable table VAT1 and make the following entries in the "Symbol", "Monitor Format" and
"Modify Value" columns:
Address
DB1.DBX 22.3
DB1.DBX 14.3
DB1.DBX 15.0
DB1.DBX 15.1
DB1.DBX 15.2
DB1.DBX 15.3
DB1.DBX 15.7
DB1.DBX 34.2
DB1.DBB 16
DB1.DBB 17
DB1.DBD 26
Insert > S7 Block > Data Block
Insert > S7 Block > Organization Block
and enter the decimal module address in the "Actual Value" column of the
and close the DB editor with
File >
Save.
Symbol
Mon
Format
ABS.OT_ERR
BIN
ABS.OT_ERR_A
BIN
ABS.START
BIN
ABS.STOP
BIN
ABS.DIR_M
BIN
ABS.DIR_P
BIN
ABS.DRV_EN
BIN
ABS.EI_OFF
BIN
ABS.MODE_IN
DEC
ABS.MODE_TYPE
DEC
ABS.ACT_POS
DEC
File > Open... >
and insert DB1 in the "Blocks" folder of your
File >
Exit.
PLC >
Download.
Mon
Modify
Value
Value
0
0
0
0
0
1
1
1
1
1
Libraries.
and insert OB100.
Insert > S7 Block > Variable
Meaning
Operator error occurred
Acknowledge operator error
Start positioning
Stop currently active traverse
Direction minus
Direction plus
Enable drive on
Do not evaluate enable input
Requested mode: 1 = jogging
Initial speed for jogging
Current position of the axis

Advertisement

loading