Automation and Drives
Field Data Link connections (FDL)
SITRAIN IK-PBSYS / FDL Connections
Page 1
Co n t en t s Field Field Data Data Link Link connec connectio tions ns (FDL) (FDL)
03/2007 © Siemens AG 2007 - Subject to change without prior notice
Pag e ...... ......... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...
2
Basic procedure procedure ........... ................ ........... ............ ........... .......... .......... ........... ........... .......... ........... ........... ........... ............ ........... .......... .......... ........... ............ ......... ......... ........... .......... .......
3
Configured Configured FDL connections connections ........... ................ .......... .......... .......... ........... ............ ........... .......... ........... ............ ........... .......... ........... ............ ........... ........... ........... ........... ......
4
Operating Operating principle: principle: AG-SEND AG-SEND and AG-RECEIVE AG-RECEIVE ............ ................. .......... .......... ........... ........... .......... ........... ............ ........... .......... .......... .......... ....... ..
5
Send block: block: AG-SEND AG-SEND ........... ................ ........... ........... .......... ........... ............ ........... .......... .......... .......... .......... .......... ........... ............ ............ ........... .......... ........... .......... .......... ........
6
Receive Receive block: AG-RECEIV AG-RECEIVE E ............ ................. .......... .......... ........... ........... .......... .......... .......... ........... ........... .......... ........... ............ ............ ........... .......... .......... .......... .......
7
DONE, ERROR ERROR and STATUS STATUS parameters parameters ........... ................. ........... .......... .......... .......... .......... .......... ........... ............ ........... .......... ........... ........... .......... ......... ....
8
Networ Network/p k/proj roject ect Variant Variant:: One subnet subnet - multip multiple le projects projects ...... ......... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ..... .. What does does "unspecifi "unspecified ed connecti connection" on" mean? mean? ............ ................. .......... .......... .......... .......... ........... ........... .......... .......... .......... ........... ........... .......... .......... ....... ..
9 10
Unspecified Unspecified FDL connect connection, ion, propert properties ies ........... ................ .......... .......... .......... ........... ............ ............ ............ ............ ........... ........... ........... .......... .......... .......... .....
11
Unspecified Unspecified connectio connection n (in every station) station) .......... ................ ........... .......... .......... .......... .......... .......... ........... ............ ........... .......... .......... ........... ........... .......... ....... ..
12
Load connection connection configurati configuration on (general) (general) .......... ................ ............ ........... ........... ........... .......... .......... .......... ........... ............ ............ ............ ........... .......... ......... ....
13
Properties Properties of the FDL connection connection ........... ................. ........... ........... ........... .......... .......... .......... .......... ........... ............ ........... .......... ........... ............ ........... .......... ......... .... Configurati Configuration on results results ........... ................ .......... ........... ............ ........... .......... .......... .......... ........... ........... .......... ........... ............ ............ ............ ............ ........... ......... ......... .......... ........ ...
14 15
User programs: programs: AG-SEND AG-SEND and AG-RECEIV AG-RECEIVE E (for (for both CPUs) .......... ............... ........... ............ ........... .......... .......... .......... .......... ......... ....
16
Exercise 1: 1: FDL FDL connection connection ........... ................ .......... .......... .......... ........... ............ ........... ........... ............ ............ ............ ........... .......... .......... .......... .......... ........... ............ ........
17
Properties Properties of the Free Layer 2 connection connection
........... ................. ........... ........... ........... .......... .......... .......... ........... ............ ............ ............ ........... ........... .......... ....
18
........... ................. ........... .......... .......... .......... ........... ............ ........... .......... .......... .......... ........... ............ .......... ....
19
Reservation Reservation of job header header (send mailbox mailbox)) .......... ................ ........... .......... .......... .......... ........... ............ ........... .......... .......... .......... ........... ............ ........... ......... ......
20
Program Program in station station AS1 with AG-SEND AG-SEND
........... ................. ........... ........... ........... ........... ........... ........... ........... ........... ........... ........... ........... ........... ........... ......... ....
21
Reservation Reservation of job job header (receiv (receive e mailbox) mailbox) ........... ................ .......... ........... ............ ............ ........... .......... .......... ........... ........... .......... .......... ........... ........... .....
22
Program Program in station station AS2 AS2 with with AG-REC AG-RECEIVE EIVE ........... ................ .......... ........... ........... .......... ........... ........... ........... ........... ........... ........... .......... ........... ........... .......
23
Exercise 2: 2: FDL connection connection of type "Free "Free Layer 2" .......... ............... ........... ........... .......... ........... ............ ........... .......... ........... ............ ............ ........... .....
24
Free Layer 2 connec connection tion in stations stations 1 and 2
SITRAIN trainin training g for Automation and Industrial Solutions
Page 1
IK-PBSYS FDL Connections
Automation and Drives
Field Data Link connections (FDL)
SITRAIN IK-PBSYS / FDL Connections
Page 2
Co n t en t s
03/2007 © Siemens AG 2007 - Subject to change without prior notice
Pag e
If you want want to know know more ........... ................ .......... .......... .......... ........... ............ ............ ............ ........... .......... .......... .......... ........... ............ ........... .......... ........... ........... .......... ....... .. FDL connec connection tion with with broadca broadcast, st, defini definition tion ........... ................ .......... .......... .......... ........... ............ ........... .......... .......... .......... .......... ........... ........... .......... .......... .....
25 26
Broadcast Broadcast connection connection
.......... ............... ........... ........... .......... .......... .......... .......... ........... ........... .......... .......... .......... ........... ........... .......... .......... .......... ........... ........... .......... .......... .....
27
User program program in in the send send station station .......... ................ ........... .......... .......... .......... ........... ........... .......... .......... .......... ........... ............ .......... .......... ........... .......... .......... ......... ....
28
Receive Receive program program in the broadcast broadcast stations stations
........... ................. ........... ........... ............ ........... .......... .......... .......... ........... ............ ............ ........... .......... ......... ....
29
Exercise 3: 3: FDL connection connection of type broadcast broadcast .......... ............... ........... ........... .......... ........... ............ ........... .......... ........... ............ ........... .......... ........... ......
30
FDL connection connection with with multicast, multicast, definit definition ion .......... ............... ........... ........... ........... ........... .......... .......... .......... .......... ........... .......... .......... ........... .......... .......... ........ ...
31
Multicast Multicast connection connection
32
.......... ................ ........... .......... .......... .......... ........... ............ ............ ........... .......... .......... .......... .......... .......... ........... ............ ........... ........... ........... .......... ......... ....
User program program in the send station station
.......... ................ ............ ........... .......... .......... .......... ........... ........... ........... ............ ........... .......... .......... .......... ........... ............ .......... ....
Receiv Receive e progra program m in the multicas multicastt statio station n
33
...... ......... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... .....
34
Exercise 4: 4: FDL FDL connection connection of type type multicast multicast .......... ............... ........... ............ ............ ............ ........... ........... ............ ............ ........... ........... ........... .......... .....
35
Connections Connections to partners partners in other projects projects
36
SITRAIN trainin training g for Automation and Industrial Solutions
.......... ............... .......... ........... ............ ........... .......... .......... .......... ........... ............ ............ ............ ........... .......... ........ ...
Page 2
IK-PBSYS FDL Connections
Automation and Drives
Field Data Link connections (FDL)
SITRAIN IK-PBSYS / FDL Connections
Page 2
Co n t en t s
03/2007 © Siemens AG 2007 - Subject to change without prior notice
Pag e
If you want want to know know more ........... ................ .......... .......... .......... ........... ............ ............ ............ ........... .......... .......... .......... ........... ............ ........... .......... ........... ........... .......... ....... .. FDL connec connection tion with with broadca broadcast, st, defini definition tion ........... ................ .......... .......... .......... ........... ............ ........... .......... .......... .......... .......... ........... ........... .......... .......... .....
25 26
Broadcast Broadcast connection connection
.......... ............... ........... ........... .......... .......... .......... .......... ........... ........... .......... .......... .......... ........... ........... .......... .......... .......... ........... ........... .......... .......... .....
27
User program program in in the send send station station .......... ................ ........... .......... .......... .......... ........... ........... .......... .......... .......... ........... ............ .......... .......... ........... .......... .......... ......... ....
28
Receive Receive program program in the broadcast broadcast stations stations
........... ................. ........... ........... ............ ........... .......... .......... .......... ........... ............ ............ ........... .......... ......... ....
29
Exercise 3: 3: FDL connection connection of type broadcast broadcast .......... ............... ........... ........... .......... ........... ............ ........... .......... ........... ............ ........... .......... ........... ......
30
FDL connection connection with with multicast, multicast, definit definition ion .......... ............... ........... ........... ........... ........... .......... .......... .......... .......... ........... .......... .......... ........... .......... .......... ........ ...
31
Multicast Multicast connection connection
32
.......... ................ ........... .......... .......... .......... ........... ............ ............ ........... .......... .......... .......... .......... .......... ........... ............ ........... ........... ........... .......... ......... ....
User program program in the send station station
.......... ................ ............ ........... .......... .......... .......... ........... ........... ........... ............ ........... .......... .......... .......... ........... ............ .......... ....
Receiv Receive e progra program m in the multicas multicastt statio station n
33
...... ......... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ...... .....
34
Exercise 4: 4: FDL FDL connection connection of type type multicast multicast .......... ............... ........... ............ ............ ............ ........... ........... ............ ............ ........... ........... ........... .......... .....
35
Connections Connections to partners partners in other projects projects
36
SITRAIN trainin training g for Automation and Industrial Solutions
.......... ............... .......... ........... ............ ........... .......... .......... .......... ........... ............ ............ ............ ........... .......... ........ ...
Page 2
IK-PBSYS FDL Connections
Automation and Drives
Basic procedure
Configuring CP 342-5 DP
SITRAIN IK-PBSYS / FDL Connections
Configuration
S7 program
Use of library blocks
Page 3
03/2007 © Siemens AG 2007 - Subject to change without prior notice
1.
Conf Config igur ure e the the DP mas maste terr syst system em,, i.e. i.e. spe speci cify fy the the DP DP mast master er and and associated DP slaves in the configuration table.
2.
Assign Assign the DP master master system system parame parameter ters s (IO (IO addr address esses, es, groups, groups, etc). etc).
You program the user program in the S7-CPU : 1.
Exch Exchan ange ge of of data data bet betwe ween en the the DP DP mas maste terr and and CPU. CPU. Blo Block cks s FC1 FC1 FC1 "DP_SEND" and FC2 "DP_RECV" are used used for this purpose.
2.
Functi Functiona onall proce processi ssing ng of IO data data from from DP DP slav slaves es in in the the S7 S7 prog program ram..
3.
Detect Detection ion of slave slave faults faults by progra programm mmed ed diagno diagnosti stic c rout routine ines, s, i.e. i.e. in contrast to the integrated interface, faults are not automatically detected (OB86) if a slave fails. For this purpose, another block FC3 "DP_DIAG" in the S7 program must be used.
Library
The functions described here (blocks of type type FC) plus the STEP 7 basic package and the loadable option NCM S7 for PROFIBUS PROFIBUS are all supplied as a library. Instructions on how to use these blocks can be found below.
SITRAIN trainin training g for Automation and Industrial Solutions
Page 3
IK-PBSYS FDL Connections
Automation and Drives
Configured FDL connections
SITRAIN IK-PBSYS / FDL Connections
Appl icati on
Page 4
03/2007 © Siemens AG 2007 - Subject to change without prior notice
Data communication via a configured FDL connection is suitable for transferring related data blocks between two or more PROFIBUS nodes. FDL connections are categorized as follows:
Specified FDL connection The communicating nodes are uniquely defined by the connection configuration. The connection partner can be located inside or outside the STEP 7 project (multiprojects). Unspecifi ed FDL connecti on (Free Layer 2 access) The address of the connection partner is not specifically configured. The communicating nodes are determined by address data in the communication job in the user program. This means that up to 126 nodes can be accessed by means of an "unspecified" FDL connection provided that they are nodes which support FDL connections. The connection partner can be located inside or outside the STEP 7 project. FDL connection w ith broadcast All nodes on PROFIBUS ready to receive with broadcast can be accessed. FDL connection with mu lticast All nodes on PROFIBUS ready to receive with multicast can be accessed. . Appl icati on
The following diagram illustrates the application of FC blocks AG_SEND / AG_LSEND and AG_RECV / AG_LRECV for bidirectional data transfers via one configured FDL connection. A job header must be provided in the user data area for certain types of connection.
SITRAIN training for Automation and Industrial Solutions
Page 4
IK-PBSYS FDL Connections
Automation and Drives
Operating principle: AG-SEND and AG-RECEIVE
SITRAIN IK-PBSYS / FDL Connections
Page 5
03/2007 © Siemens AG 2007 - Subject to change without prior notice
Operating principle of SEND The flowchart above shows the normal chronological sequence for a data transmission initiated with AG_SEND in the user program. The send job is executed as soon as parameter ACT = 1 is passed. Parameter ACT = 0 must then be transferred in at least one further call. The status display in output parameters DO NE, ERROR and STATUS is updated in every block call and can be evaluated. To update the status display again without executing another send job, therefore, another block call containing parameter ACT = 0 must be issued in each case. Operating principle of RECV The flowchart above shows the normal chronological sequence for data reception initiated with AG_RECV in the user program. Every AG_RECV job in the user program is acknowledged by the PROFIBUS CP with a display in output parameters NDR, ERROR and STATUS.
SITRAIN training for Automation and Industrial Solutions
Page 5
IK-PBSYS FDL Connections
Automation and Drives
Send block: AG-SEND
Library SIMATIC_NET_CP
SITRAIN IK-PBSYS / FDL Connections
FC2 “AG-SEND”
Page 6
03/2007 © Siemens AG 2007 - Subject to change without prior notice
The FC block AG_SEND / AG_LSEND passes data to the PROFIBUS CP for transfer via a configured FDL connection. The data area specified can be a process image area, a memory area or a data block area. Execution without errors is indicated when the complete user data area has been successfully transferred via PROFIBUS.
Call interface
Call FC 5 ACT
:= M 20.0
// Task activation with memory bit
ID
:= MW 22
// Connection ID (as configured)
LADDR
:= W#16#0100
// Log. address (hardware config.)
SEND
:= P#DB99.dbx10.0 Byte 240 // Buffer containing send data
LEN
:= MW 24
// Length data for send data
DONE
:= M 20.1
// Indication of completion
ERROR := M 20.2
// Error indication
STATUS := MW 26
// Status display
SITRAIN training for Automation and Industrial Solutions
Page 6
IK-PBSYS FDL Connections
Automation and Drives
Receive block: AG-RECEIVE
SITRAIN IK-PBSYS / FDL Connections
FC6 “ AG_RECV“
Page 7
03/2007 © Siemens AG 2007 - Subject to change without prior notice
The FC block AG_RECV accepts data from the PROFIBUS CP which have been transferred via a configured FDL connection. The data area specified for data transfer can be a process image area, a memory area or a data block area. Execution without errors is indicated when the data from the PROFIBUS CP have been successfully transferred.
Call interface
Call FC 6 ID
:= MW 30
// Connection ID (as configured)
LADDR
:= W#16#0100
// Log. address (hardware config.)
RECV
:= P#DB99.dbx10.0 Byte 240 // Buffer containing receive data
NDR
:= M 26.0
// New incoming data ?
ERROR := M 26.1
// Error indication, see ONLINE help
STATUS := MW 28 LEN := MW 30
// Status indication, see ONLINE help // Number of bytes that were accepted
SITRAIN training for Automation and Industrial Solutions
Page 7
IK-PBSYS FDL Connections
Automation and Drives
DONE, ERROR and STATUS parameters Jo b
Job executed no error
Job runs with = 8302H Job runs 8181H no receive data available
SITRAIN IK-PBSYS / FDL Connections
Status inf ormation
Job done with = 8302H No receive resources on the destination station; the receiving station cannot process received data quickly enough or has not prepared any receive resources. 8311H The destination station cannot be obtained at the specified PROFIBUS address or the service used is not possible for the specified PROFIBUS address. 80C3H Resources (memory) occupied. 80D2H Module start address incorrect.
Page 8
03/2007 © Siemens AG 2007 - Subject to change without prior notice
The following parameters must be evaluated for job status information in the user program: -
DONE or NDR These parameters (DONE for send jobs and NDR for receive jobs) signal the (successful) execution of a job.
-
ERROR Indicates that a job has not been successfully executed.
-
STATUS This parameter supplies detailed information on job execution. Status displays can be supplied while a job is being executed (DONE= 1 and ERROR=0).
SITRAIN training for Automation and Industrial Solutions
Page 8
IK-PBSYS FDL Connections
Automation and Drives
Network/project variant: One subnet - multiple projects
Part 1
Part 2
PROFIBUS Subnet 1
SITRAIN IK-PBSYS / FDL Connections
Page 9
03/2007 © Siemens AG 2007 - Subject to change without prior notice
Configuration
For plants in a complex network, it can be practical in order to achieve a more efficient division of work to manage plant sections in different (sub)projects. In such a setup, data may need to be exchanged via a cross-project subnet and for this reason, cross-project connections must be set up.
Organization
The resulting requirements for user-friendly, consistent ways of configuring the communication are supported additionally in STEP 7 V5.2 or later with multiproject feature. The multiproject functions in STEP 7 enable management of multiple projects in one multiproject with distributed authoring, splitting and merging of projects.
Options
The new multiproject functionality has added the following new options: •
Connection to a partner in an unknown project usingMultiproject
•
Specified connections with proxy objects
•
Unspecified connections (with / without Layer 2)
SITRAIN training for Automation and Industrial Solutions
Page 9
IK-PBSYS FDL Connections
Automation and Drives
What does "unspecified connection" mean?
SITRAIN IK-PBSYS / FDL Connections
Page 10
03/2007 © Siemens AG 2007 - Subject to change without prior notice
Unspecif ied FDL connecti on (Free Layer 2 access) The address of the connection partner is not specifically configured. The communicating nodes are determined by address data in the communication job in the user program. This means that up to 126 nodes can be accessed by means of an "unspecified" FDL connection provided that they are nodes which support FDL connections. The connection partner can be located inside or outside the STEP 7 project.
Jobs
When data are transferred via an unspecified FDL connection, the PROFIBUS CP performs the following tasks: -
For receiving data: Enters the sender and the FDL service in the job header.
-
For sending data: Evaluates the job header and addresses the partner , executes the selected FDL service.
SITRAIN training for Automation and Industrial Solutions
Page 10
IK-PBSYS FDL Connections
Automation and Drives
Unspecified FDL connection, properties
SITRAIN IK-PBSYS / FDL Connections
Page 11
03/2007 © Siemens AG 2007 - Subject to change without prior notice
Properties of an unspecif ied FDL connecti on (Free Layer 2 access) An unspecified FDL connection with open Layer 2 access allows programcontrolled addressing of the communication partner and data exchange between two nodes on PROFIBUS. The key features of this connection type are: •
Data transfer is bidirectional, in other words, it is possible to send and receive on the FDL connection at the same time.
•
The local node is fixed in the configuration. The remote node is entered in the job header of the job buffer by the user program when AG_SEND is called. This means that every node on PROFIBUS (PROFIBUS addresses 0 to 126) can be reached.
•
The PB address, LSAP and the sender service can be read from the job header of AB_RECV.
Data volume To find out how many FDL connections the relevant PROFIBUS CP can support, please refer to the product information supplied with the PROFIBUS CP. You can increase the number of connections per station by adding more CPs. Up to 236 bytes of user data can be transferred per job buffer. The job header occupies a further 4 bytes. Options
The new multiproject functionality has added the following new options: •
Connection to a partner in an unknown project usingMultiproject
•
Specified connections with proxy objects
•
Unspecified connections (with / without Layer 2)
SITRAIN training for Automation and Industrial Solutions
Page 11
IK-PBSYS FDL Connections
Automation and Drives
Unspecified connection (in every station)
SITRAIN IK-PBSYS / FDL Connections
Page 12
03/2007 © Siemens AG 2007 - Subject to change without prior notice
Notes
SITRAIN training for Automation and Industrial Solutions
Page 12
IK-PBSYS FDL Connections
Automation and Drives
Load connection configuration (general)
Selected stations and partners can be loaded
SITRAIN IK-PBSYS / FDL Connections
General principle
Page 13
03/2007 © Siemens AG 2007 - Subject to change without prior notice
In general, all connections etc. configured in the NetPro tool must be compiled and loaded. Analogous to the hardware configuration process, compilation generates additional system data blocks which must be loaded to the selected stations and/or partners.
SITRAIN training for Automation and Industrial Solutions
Page 13
IK-PBSYS FDL Connections
Automation and Drives
Properties of the FDL connection
"Free Layer 2 access"
SITRAIN IK-PBSYS / FDL Connections
Page 14
03/2007 © Siemens AG 2007 - Subject to change without prior notice
Tabs
The properties dialog is implemented as a tab dialog which displays related parameter groups on individual tab sheets. The following tabs are provided for FDL connections:
General tab
Displays the global parameters of the connection and the local connection name of the FDL connection
Ad dresses tab
Displays the local and remote address information.
Overview tab
Displays an overview of all configured FDL connections of the selected S7 station with relevant parameters (local and remote LSAPs).
Local SAPs
Local LSAP (Link ServiceAccessPoint ): • The local LSAP controls the readiness of the PROFIBUS CP to receive. The receive resources for the LSAP are provided in the PROFIBUS CP for receiving data on the FDL connection. • Remote LSAP (Link ServiceAcc essPoint): The remote LSAP controls transmission in the PROFIBUS CP. Over the LSAP, the PROFIBUS CP sends data to the node on the FDL connection. The destination node must be ready to receive for this service access point.
Unspecified FDL connection An unspecified FDL connection can be used in 2 different ways: • Connection to an "Other s tation" in a different project You can specify the remote PROFIBUS address and the LSAP for any destination station. The destination station can be either inside or outside the current STEP 7 project. Until the remote address is specified, no data can be exchanged via the FDL connection. Another option is to use a "Free Layer 2 connection". SITRAIN training for Automation and Industrial Solutions
Page 14
IK-PBSYS FDL Connections
Automation and Drives
Configuration results
SITRAIN IK-PBSYS / FDL Connections
Page 15
03/2007 © Siemens AG 2007 - Subject to change without prior notice
Notes
SITRAIN training for Automation and Industrial Solutions
Page 15
IK-PBSYS FDL Connections
Automation and Drives
User programs: AG-SEND and AG-RECEIVE (for both CPUs)
SITRAIN IK-PBSYS / FDL Connections
Page 16
03/2007 © Siemens AG 2007 - Subject to change without prior notice
Notes
SITRAIN training for Automation and Industrial Solutions
Page 16
IK-PBSYS FDL Connections
Automation and Drives
Exercise 1 : FDL connection
"AS1" Unspecified connection configured
Station1
"AS2" Unspecified connection configured
Log. FDL connection
CPU
CP MPI=2
CPU
CP MPI=2
Station2
PROFIBUS=3
Physical connection via PROFIBUS
PROFIBUS=2
" AG_SEND"
"AG_RECEIVE"
" AG_RECEIVE"
" AG_SEND"
SITRAIN IK-PBSYS / FDL Connections
Page 17
03/2007 © Siemens AG 2007 - Subject to change without prior notice
Task description
Your task is to configure a data exchange via an FDL connection between two S7 controls which are located in different S7 projects.
Procedure
1.
Use PROFIBUS and the CP342-5 modules to network your training case with your neighboring group. Agree which bus addresses are to be used with your neighboring group.
2.
Create a new S7 project Station1.
3.
Engineer the HW configuration to match your station.
4.
Follow the procedure outlined in the theory section to set up an unspecified FDL connection in your station. Discuss which connection addresses to use with your partner group so that the address settings match.
5.
Transfer the hardware and the connection to your CPU
6.
Write an S7 program for this CPU with which you can SEND and RECEIVE data to and from the other station.
SITRAIN training for Automation and Industrial Solutions
Page 17
IK-PBSYS FDL Connections
Automation and Drives
Properties of the Free Layer 2 connection
SITRAIN IK-PBSYS / FDL Connections
Free Layer 2
Page 18
03/2007 © Siemens AG 2007 - Subject to change without prior notice
To configure a Free Layer 2 access, click on the appropr iate button. You cannot then make entries in the input fields for the remote PROFIBUS address or remote LSAP because the destination addresses will be defined by the user program in this case. The alternative is to make a connection to an "Other station" in a different project.
B loc k paramet er
at tr ibu tes - ID:
This value must be entered as the block call parameter ID to identify the connection in the user p rogram.
- LAADR:
This value must also be programmed as the actual parameter for FC SEND / FC RCV in the user program.
SITRAIN training for Automation and Industrial Solutions
Page 18
IK-PBSYS FDL Connections
Automation and Drives
Free Layer 2 connection in stations 1 and 2
SITRAIN IK-PBSYS / FDL Connections
Page 19
03/2007 © Siemens AG 2007 - Subject to change without prior notice
Notes
SITRAIN training for Automation and Industrial Solutions
Page 19
IK-PBSYS FDL Connections
Automation and Drives
Reservation of job header (send mailbox)
SITRAIN IK-PBSYS / FDL Connections
Job header
Page 20
03/2007 © Siemens AG 2007 - Subject to change without prior notice
The following connection types require a job header in the FDL user data area: •
Unspecified FDL connection with Free Layer 2 access
•
FDL connection with broadcast
•
FDL connection with multicast
The diagram above shows the structure of the job buffer and the meaning and location of the parameters in the job header. The user data area can be up to 240 bytes in length. Up to 236 bytes of user data can be transferred. 4 bytes are reserved for the job header. Please note that the data length specified in the block call (LEN parameter) must include the header and the user data! Call
Please refer to the table for the types of connection and job which require parameter assignments in the job header. The job header is located in the FDL (user) data area. It occupies the first 4 bytes in this data area and must be included in the length specification in parameter LEN. The maximum user data length is therefore reduced to 236 bytes in jobs with a job header.
SITRAIN training for Automation and Industrial Solutions
Page 20
IK-PBSYS FDL Connections
Automation and Drives
Program in station AS1 with AG-SEND
SITRAIN IK-PBSYS / FDL Connections
Page 21
03/2007 © Siemens AG 2007 - Subject to change without prior notice
Notes
SITRAIN training for Automation and Industrial Solutions
Page 21
IK-PBSYS FDL Connections
Automation and Drives
Reservation of job header (receive mailbox)
SITRAIN IK-PBSYS / FDL Connections
Call
Page 22
03/2007 © Siemens AG 2007 - Subject to change without prior notice
Please refer to the table below for the types of connection and job which require parameter assignments in the job header. The job header is located in the FDL (user) data area. It occupies the first 4 bytes in this data area and must be included in the length specification in parameter LEN. The maximum user data length is therefore reduced to 236 bytes in jobs with a job header.
SITRAIN training for Automation and Industrial Solutions
Page 22
IK-PBSYS FDL Connections
Automation and Drives
Program in station AS2 with AG-RECEIVE
SITRAIN IK-PBSYS / FDL Connections
Page 23
03/2007 © Siemens AG 2007 - Subject to change without prior notice
Notes
SITRAIN training for Automation and Industrial Solutions
Page 23
IK-PBSYS FDL Connections
Automation and Drives
Exercise 2 : FDL connection of type "Free Layer 2" "AS1" Unspecified connection configured
Station1
"AS2" Unspecified connection configured
Log. FDL connection
CPU
CP MPI=2
CPU
CP MPI=2
Station2
PROFIBUS=3
Physical connection via PROFIBUS
PROFIBUS=2
"AG_SEND"
"AG_RECEIVE"
" AG_RECEIVE"
"AG_SEND"
SITRAIN IK-PBSYS / FDL Connections
Page 24
03/2007 © Siemens AG 2007 - Subject to change without prior notice
Task description
Your task is to configure a data exchange via an FDL connection between two S7 controls which are located in different S7 projects. You must use a type "Free Layer 2" connection to that you can choose the connection partner in the S7 program.
Procedure
1.
Use PROFIBUS and the CP342-5 modules to network your training case with your neighboring group. Agree which bus addresses are to be used with your neighboring group.
2.
Create a new S7 project Station1
3.
Engineer the HW configuration to match your station.
4.
Create an unspecified FDL connection of type "Free Layer " in your station according to the procedure described in the theory section. To obtain the correct settings for the connection addresses, discuss and coordinate the address settings with your partner group.
5.
Transfer the hardware and the connection to your CPU
6.
Write an S7 program for this CPU with which you will SEND / RECEIVE data to / from the other station.
7.
Evaluate the data in the receive header of your station.
SITRAIN training for Automation and Industrial Solutions
Page 24
IK-PBSYS FDL Connections
Automation and Drives
If you want to know more
SITRAIN IK-PBSYS / FDL Connections
Note
Page 25
03/2007 © Siemens AG 2007 - Subject to change without prior notice
The following pages provide additional information for reference.
SITRAIN training for Automation and Industrial Solutions
Page 25
IK-PBSYS FDL Connections
Automation and Drives
FDL connection with broadcast, definition
SITRAIN IK-PBSYS / FDL Connections
Properties
Page 26
03/2007 © Siemens AG 2007 - Subject to change without prior notice
A broadcast connection allows a message to be transmitted to several receivers with one job. A node can therefore receive messages on the same broadcast connection at the same time as other nodes are receiving them on PROFIBUS: •
Data transfer is bidirectional, i.e. data can be transmitted and received simultaneously on the broadcast connection.
•
Data are sent and received with the FDL service SDN (Send Data with No Acknowledge).
•
A job buffer must be specified with the AG_SEND call for send jobs. The job header area must be reserved, but the content is not relevant.
•
The PB address, LSAP and the broadcast sender service can be read from the job header of AG_RECV.
•
The LSAP area from 1 to 56 is used for send jobs. LSAP 63 is reserved for all broadcast nodes for receive jobs.
Broadcast
Select "All broadcast nodes" as the connection partner/station when you set up the FDL connection.
Data volume
Each PROFIBUS CP can support one broadcast connection. Up to 236 bytes of user data can be transferred per job buffer. The job header occupies a further 4 bytes. If you use an FDL connection with broadcast, you cannot receive messages on any other broadcast connection on the same CP.
SITRAIN training for Automation and Industrial Solutions
Page 26
IK-PBSYS FDL Connections
Automation and Drives
Broadcast connection
"Broadcast partner"
SITRAIN IK-PBSYS / FDL Connections
Broadcast
Page 27
03/2007 © Siemens AG 2007 - Subject to change without prior notice
The remote address parameters are predefined for FDL connections with broadcast. All broadcast nodes can be reached via PROFIBUS address 127. Receive data from all broadcast nodes are received via LSAP 63. The local address parameters are entered in the job header of the message for send jobs and supplied to the receiver node. The user program on the remote partner can thus identify the sender of the broadcast message frame.
Note
If you are using an FDL connection with broadcast, you cannot use any other broadcast connection on the same CP, e.g. an y PROFIBUS FMS connections with broadcast.
SITRAIN training for Automation and Industrial Solutions
Page 27
IK-PBSYS FDL Connections
Automation and Drives
User program in the send station
SITRAIN IK-PBSYS / FDL Connections
Page 28
03/2007 © Siemens AG 2007 - Subject to change without prior notice
Notes
SITRAIN training for Automation and Industrial Solutions
Page 28
IK-PBSYS FDL Connections
Automation and Dri
SITRAIN IK-PBSYS / FDL Connections
Page 29
Notes
SITRAIN training for Automation and Industrial Solutions
Page 29
IK-PBSYS FDL Connections
Automation and Drives
Exercise 3 : FDL connection of type broadcast Your station
CP
CPU
Other station 2
Other station 1
CPU
MPI=2
CP
CP
CPU
MPI=2
MPI=2 PROFIBUS
Unspecified connection configured
Unspecified connection configured
Unspecified connection configured
" AG_SEND" broadcast
" AG_RECEIVE"
" AG_RECEIVE"
"AG_RECEIVE"
" AG_RECEIVE"
"AG_SEND" broadcast
"AG_RECEIVE"
" AG_SEND" broadcast
"AG_RECEIVE"
SITRAIN IK-PBSYS / FDL Connections
Page 30
03/2007 © Siemens AG 2007 - Subject to change without prior notice
Task description
Your task is to configure a data exchange via an FDL connection between several S7 controls which are located in different S7 projects. One station in each case must send a broadcast message to all other stations in the network.
Procedure
1.
Use PROFIBUS and the CP342-5 modules to network the training cases of all training groups. Discuss and agree the bus addresses to be used with your neighboring group.
2.
Create a new S7 project Station1.
3.
Engineer the HW configuration to match your station.
4.
Create an unspecified FDL connection of type "Free Layer " in your station according to the procedure described in the theory section. To obtain the correct settings for the connection addresses, agree which ones to use with the other groups.
5.
Transfer the hardware and the connection to your CPU
6.
Write an S7 program for this CPU with which you can broadcast data to all other stations in the network.
7.
Evaluate the data in the receive header of your station.
SITRAIN training for Automation and Industrial Solutions
Page 30
IK-PBSYS FDL Connections
Automation and Drives
FDL connection with multicast, definition
SITRAIN IK-PBSYS / FDL Connections
Properties
Data volume
Page 31
03/2007 © Siemens AG 2007 - Subject to change without prior notice
With an FDL connection with multicast, it is possible to use one job to send a message to multiple nodes within a multicast network. The properties of this type of FDL connection are as follows: •
Data transfer is bidirectional, i.e. it is possible to transmit and receive simultaneously on the FDL connection with multicast.
•
Data are sent and received with the FDL service SDN (Send Data with No Acknowledge).
•
Data are sent via the same LSAP (area 1 to 56) for the entire multicast network.
•
A job buffer must be specified with the AG_SEND call for send jobs. The job header area must be reserved, but the content is not relevant.
•
The PROFIBUS address, the LSAP and the multicast sender service can be read from the job header of the AG_RECV.
For the number of FDL connections which can be supported by the re levant PROFIBUS CP, please refer to the product information supplied with the CP. It is possible to increase the number of connections per station by adding further CPs. Up to 236 bytes of user data can be transferred per job buffer. The job header occupies a further 4 bytes.
SITRAIN training for Automation and Industrial Solutions
Page 31
IK-PBSYS FDL Connections
Automation and Drives
Multicast connection
"Multicast partner" SITRAIN IK-PBSYS / FDL Connections
Page 32
03/2007 © Siemens AG 2007 - Subject to change without prior notice
Multicast
The remote address parameters are predefined for FDL connections with multicast. All the S7 stations in the relevant multicast network use the same LSAP (area 1 to 56) to send and receive data. For this reason, the LSAP can only be selected locally and is automatically transferred to the remote LSAPs.
Exception:
You can configure the value of the local LSAP for a PC station independently of the partner's LSAP value.
SITRAIN training for Automation and Industrial Solutions
Page 32
IK-PBSYS FDL Connections
Automation and Drives
User program in the send station
SITRAIN IK-PBSYS / FDL Connections
Page 33
03/2007 © Siemens AG 2007 - Subject to change without prior notice
Notes
SITRAIN training for Automation and Industrial Solutions
Page 33
IK-PBSYS FDL Connections
Automation and Drives
Receive program in the multicast station
SITRAIN IK-PBSYS / FDL Connections
Page 34
03/2007 © Siemens AG 2007 - Subject to change without prior notice
Notes
SITRAIN training for Automation and Industrial Solutions
Page 34
IK-PBSYS FDL Connections
Automation and Drives
Exercise 4 : FDL connection of type multicast Your station
CP
CPU
Other station 2
Other station 1
CPU
MPI=2
CP
CP
CPU
MPI=2
MPI=2 PROFIBUS
Unspecified connection configured
Unspecified connection configured
Unspecified connection configured
" AG_SEND" broadcast
" AG_RECEIVE"
" AG_RECEIVE"
"AG_RECEIVE"
" AG_RECEIVE"
"AG_SEND" broadcast
"AG_RECEIVE"
" AG_SEND" broadcast
"AG_RECEIVE"
SITRAIN IK-PBSYS / FDL Connections
Page 35
03/2007 © Siemens AG 2007 - Subject to change without prior notice
Task description
Your task is to configure a data exchange via an FDL connection between several S7 controls which are located in different S7 projects. One station in each case must send a multicast message to a group of other stations.
Procedure
1.
Use PROFIBUS and the CP342-5 modules to network the training cases of all training groups. Discuss and agree the bus addresses to be used with your neighboring group.
2.
Create a new S7 project Station1.
3.
Engineer the HW configuration to match your station.
4.
Create an unspecified FDL connection of type "Free Layer " in your station according to the procedure described in the theory section. To obtain the correct settings for the connection addresses, agree which ones to use with the other groups.
5.
Transfer the hardware and the connection to your CPU
6.
Write an S7 program for this CPU with which you can multicast data to all other stations in the network.
7.
Evaluate the data in the receive header of your station.
SITRAIN training for Automation and Industrial Solutions
Page 35
IK-PBSYS FDL Connections