show the entry list

PROFIBUS S7-300/400 CPs -- Configuring and programming communication -- Configuring connections 
How do you configure an FDL connection between the SIMATIC S5 (CP5431) and SIMATIC S7 via PROFIBUS? 
Where can you find sample programs and documentation for communication from SIMATIC S5 modules to SIMATIC S5, S7 and PC modules in the SIMATIC NET Quick Start Collection? 
Where can you find sample S7 programs and documentation for communication via PROFIBUS in the SIMATIC NET Quick Start Collection? 
How do you configure a PC station as DP slave for connecting an S7 station (as DP master) for the SIMATIC NET OPC server with the SIMATIC NET PC software? 
How do you configure an FDL connection to the SIMATIC S7 via PROFIBUS for the SIMATIC NET OPC server with the SIMATIC NET PC software? 
Establishing a connection from a PC to the S7-400   
What differences are there when configuring S7 connections? 

How do you configure an FDL connection between the SIMATIC S5 (CP5431) and SIMATIC S7 via PROFIBUS?Go to beginning
Part number:

Description:
Direct access is made to Layer 2 services in order to exchange data between a SIMATIC S5 (with SINEC CP5431) and a SIMATIC S7 via PROFIBUS. The Layer 2 services are called FDL (Fieldbus Data Link) services.

SINEC L2 is former designation for PROFIBUS. SINEC L2 supports baud rates from 9.6 kbit/s to 1.5 Mbit/s. PROFIBUS supports baud rates from 9.6 kbit/s to 12 Mbit/s.

This entry describes how to configure an FDL connection for data exchange between SIMATIC S5 (with SINEC CP5431) and SIMATIC S7 via PROFIBUS.

Configure the FDL connection for the SIMATIC S7
Use the SIMATIC Manager to open your STEP 7 project that contains the SIMATIC S7 controller.

Open the "NetPro" tool via the menu "Options > Configure Network". The FDL connection is configured in NetPro.


Fig. 01

Mark the CPU of the SIMATIC S7-300 station and insert a new connection via the menu "Insert > New Connection...".


Fig. 02

In the "Insert New Connection" dialog, select "Unspecified" under Connection Partner, because the communication partner (SIMATIC S5) is not integrated in the STEP 7 project.
Select "FDL connection" as the connection type. Click "OK" to close the dialog.  The Properties dialog of the FDL connection opens.


Fig. 03

Enter a practical name for the FDL connection, e.g. "FDL-S5".


Fig. 04

Switch to the "Addresses" tab. Under Remote you specify the PROFIBUS address of the CP5431 in the SIMATIC S5.

Define the local and remote LSAPs to specify the FDL connection uniquely. You must take the defined LSAPs into account when configuring connections for the SIMATIC S5 (see Fig. 17).


Fig. 05

Confirm the settings with "OK".

If you mark the CPU of the SIMATIC S7 300 station, the FDL connection inserted is displayed in the connection table.


Fig. 06

Check the following PROFIBUS bus parameter and change them if necessary.

  • Transmission rate
  • Bus profile

Right-click on the PROFIBUS subnetwork and via the "Object Properties..." menu open the "Properties - PROFIBUS" dialog.


Fig. 07

Switch to the "Network Settings" tab. For the FDL connection between SIMATIC S5 and SIMATIC S7, use the "User-defined" bus profile, because the bus parameters are preset by the SIMATIC S5. Click on the "Bus Parameters..." button to open the "Bus Parameters" dialog.


Fig. 08

Change the bus parameters according to the specifications of the CP5431 of the SIMATIC S5 (see Fig. 18). The transmission rate, bus profile and bus parameters must be set the same on all nodes of the PROFIBUS subnetwork.


Fig. 09

Confirm the settings with "OK".

Save and compile the configuration in NetPro via the menu "Network > Save and compile...".

Then load the configuration into the CPU.

Close NetPro and switch to the SIMATIC Manager.

Description of the S7 program
An S7-300 is used in this example. You call the communication functions FC5 "AG_SEND" and FC6 "AG_RECV" in the S7 program of the S7-300.

Please follow the instructions below for programming the communication functions FC5 "AG_SEND" and FC6 "AG_RECV".

In the SIMATIC Manager, you open the "Open Project" dialog via the menu "File > Open". Switch to the "Libraries" tab and select the "SIMATIC_NET_CP" library. Click "OK" to close the dialog. 


Fig. 10

You will find the communication blocks FC5 "AG_SEND" and FC6 "AG_RCV" in the "SIMATIC_NET_CP" library under "CP 300 > Blocks".

If you are using an S7-400, you call the communication functions FC50 "AG_LSEND" and FC60 "AG_LRECV" in the S7 program. You will find these in the SIMATIC_NET_CP library under "CP 400 > Blocks".


Fig. 11

Copy the communication functions FC5 "AG_SEND" and FC6 "AG_RECV" into the S7 program of the S7-300.

Close the "SIMATIC_NET_CP" library.

In the S7 program, you open the block (e.g. FB or FC) in which the communication functions FC5 "AG_SEND" and FC6 "AG_RECV" are to be called and programmed. The block is called cyclically in OB1.

Add the call of FC5 "AG_SEND" to the program code. The input and output parameters of the FC5 "AG_SEND" are displayed.


Fig. 12

The values for the input parameters "ID" and "LADDR" must be taken from the connection configuration in NetPro. Right-click on the input parameter "ID" and select the menu item "Connections...". The "Block parameters for connection" dialog opens. The values for the input parameters "ID" and "LADDR" are entered automatically.


Fig. 13

Select the FDL connection and click "OK" to close the dialog. The values for the input parameters "ID" and "LADDR" are entered automatically.


Fig. 14

Enter the values for the remaining input and output parameters of FC5 "AG_SEND".

Please follow the instructions below for calling and programming the communication function FC6 "AG_RECV".

A sample program for the call of FC5 "AG_SEND" and FC6 "AG_RECV" might look like this:


Fig. 15

To enable the communication function FC5 "AG_SEND", you set the marker 100.0 in a run OB (e.g. OB100). This triggers communication when the CPU is restarted.

The send job is triggered when clock marker 10.5 has a positive edge and no other send job is already running. Termination of the send job is indicated via the output parameters "DONE" (M15.0) and "ERROR" (M15.1). A new configuration cannot be created when a configuration is already open. When the send job is successfully completed, the status word is saved and evaluated. FC6 "AG_RECV" is called after job evaluation of FC5 "AG_SEND".

Define a sufficient length for the receive and send buffer for the data (in this example DB10). In our example the length of the send and receive data is 10 bytes in each case, i.e. the send and receive area in DB10 should be at least 10 bytes (= 5 words) long.

Load the S7 program into the CPU. Configuring the SIMATIC S7 is now complete.

Initialize the CP5431 and create the PLC-PLC connection
Start STEP 5 via "Start > SIMATIC > STEP 5 > STEP 5".

Via the "F9" key, switch to the configuration tool of CP5431, "SINEC NCM COM 5431".

The configuration tool "SINEC NCM COM 5431" is additional software that is integrated in STEP 5 to configure the CP5430. This software is not included in the standard STEP 5 package and must be ordered separately.

Initialize the CP5431 via the menu "Edit > CP_Init".

Enter the L2 address (PROFIBUS address) of the CP5431. This address must match the PROFIBUS address entered in NetPro (see Fig. 08).
The Base SSNR (base interface number) specifies the CP5431 in the rack. This interface number is to be used later for block calls in the S5 program.

More configuration notes for initializing the CP5431 are available in the basic configuration rules at the end of this entry.

Acknowledge the settings with "F7".


Fig. 16

Open the dialog "Edit > Connections > PLC-PLC Connections".

Data transfer via PLC-PLC connections is suitable for transferring consistent data blocks of lengths of up to a maximum of 128 bytes.
With data transfer through direct access to Layer 2 services, you can send/receive data blocks of lengths of up to a maximum of 240 bytes.
More information on data transfer through direct access to Layer 2 services is available in the manual "SINEC CP 5430 TF with COM 5430 TF, CP 5431 FMS with COM 5431 FMS" in Entry ID: 1804226.

The following specifications are based on those in the configuration in NetPro (see Fig. 17).

  • For "Remote L2 station address" you add the PROFIBUS address of the SIMATIC S7 (see Fig. 05).
  • In "PRIO", set the priority to low (L). For data exchange with an S7-300/400 via FDL, it is mandatory for "PRIO (H/I/L)" to be set to L = Low. Otherwise, the S7-300/400 cannot receive data!
  • To identify the connection, you enter the "SSAP" (source SAP) and "DSAP" (destination SAP). Enter the value "3" as "SSAP" (remote LSAP in NetPro, see Fig. 05). Enter the value "2" as "DSAP" (local LSAP in NetPro, see Fig. 05).
  • For data transfer between the S5 and the S7 you must set the "Send Parameters:" and "Receive Parameters:" . For SSNR you enter the offset interface number of the CPU (the offset is always 0 for a CPU). The specified job numbers have to be taken into account when calling SEND and RECEIVE in the S5 program (see Fig. 20 and Fig. 21).


Fig. 17

Acknowledge the settings with "F7".

Open the global bus parameters and bus times of the CP5431 via "Edit > Global Network Parameters".

For "Data rate" you select the desired transfer rate and via F1 "Calculate" you have the bus times recalculated. In our example the data rate is 1500000 baud (1.5 Mbit/s). Now compare the network parameters with the settings in NetPro (see Fig. 09).


Fig. 18

Acknowledge the bus time configuration with "F7".

Do a network comparison via "Network > Network Comparison". The global bus parameters set are adopted in the local bus parameters.

Then load the configuration into the CP5431 via "Transfer > FD > CP".

Via "File > Close" and "ESC" you switch to the STEP 5 configuration mask.

Description of the S5 program
The function blocks of the S5 program depend on the CPU used. This example is based on the blocks of AG135 and AG155.

The handling blocks for AG135 and AG155 are available at a charge. You can order these blocks from your regional Siemens sales partner (MLFB: 6ES5 842-7CB01 individual license).

A comparison between the PLCs and the associated communication FBs is available in the basic configuration rules at the end of this entry.

  • Synchronization of CP5431 with the CPU via the SYNCHRON call in the start-up OBs

Insert the start-up OBs OB20, OB21 and OB22 in your STEP 5 project.

In these OBs you program the call of FB125 "SYNCHRON", which triggers synchronization between the CPU and the CP5431.


Fig. 19

More information on the call of FB125 (SYNCHRON) is available in the basic configuration rules at the end of this entry.

  • Call of the SEND/RECEIVE blocks in OB1

Create the OB1.

For cyclic sending, you create an RLO = 1 with the two statements

  • O M 0.0
  • ON M 0.0

If the data is not be sent cyclically, then you have to program locking of the SEND call via evaluation of the display word (error analysis of the job). Possible statuses of the display word are described in the manual "SINEC CP 5430 TF with COM 5430 TF, CP 5431 FMS with COM 5431 FMS", section "7.1.2 Checking with ANZW and PAFE" in Entry ID: 1804226 .

Insert the call of the SEND block (FB120).


Fig. 20

The length of the send area is specified in words (parameter: "QLAE: +5" > 5 words).

Create an RLO = 1 with the two statements

  • O M 0.0
  • ON M 0.0

Then add the call of the RECEIVE block (FB121) after that.


Fig. 21

  • The "SEND" and "RECEIVE" blocks will now be triggered by just one RLO = 1. In the case of an RLO = 0 only the parameters "ANZW" and "PAFE" are updated.
  • If the length of the receive area is preset with "-1", then the length of the data is recognized automatically (parameter: "ZLAE: -1").

More information on the call of FB120 (SEND) and FB121 (RECEIVE) is available in the basic configuration rules at the end of this entry.

Save the OB1 with "F7".

  • Creation of the Send/Receive buffer

Since the send/receive buffer is located in DB10, you must create this in the project and declare it with a sufficient length. In our example, the length of the data is 10 bytes, i.e. the send and receive area in DB10 must at least 5 words long.

Then load the complete program into the CPU.

Basic configuration rules:

Interface number (SSNR)

  • The interface number of the CP is assigned in the mask "Edit > CP Init" in the configuration tool of CP5431, "SINEC NCM COM 5431 TCP".
  • The SSNR must be assigned as parameter in all communication blocks of the CPU (FB120, FB121, FB125).
  • The interface number must always be divisible by 4 (0, 4, 8, 16, ...).

Comparison of PLCs with function blocks SYNCHRON, SEND, RECEIVE
 
  SYNCHRON SEND RECEIVE
AG 95U - FB252 FB253
AG 115 FB249 FB244 FB245
AG 135 FB125 FB120 FB121
AG 155 FB125 FB120 FB121

SEND (FB120) and RECEIVE (FB121) and SYNCHRON (FB125)

  • Specifications QLAE and ZLAE are word specifications (QLAE = 0.10 > 10 words send; ZLAE = 0.10 > 10 words receive).
  • The parameters PAFE and ANZW are output parameters. These are for diagnostics and job monitoring. More information is available in the CP manuals.
  • The job number (ANR) specifies the connection configured in the CP (see Fig. 17).
  • The blocks must be called absolutely, for example, SPA FB120.

Keywords:
Hardware configuration, Getting Started, Guidelines, Instructions, Step by step, Send, Receive, FDL protocol, PLC-PLC connection, S5-compatible communication, Link

Where can you find sample programs and documentation for communication from SIMATIC S5 modules to SIMATIC S5, S7 and PC modules in the SIMATIC NET Quick Start Collection?Go to beginning
Part number:

Description:
The SIMATIC NET Quick Start Collection provides simple sample programs designed to help when starting to configure plants with SIMATIC NET products.

The following links take you to the SIMATIC NET Quick Start Collection. There you find sample programs and documentation for communication from SIMATIC S5 modules to SIMATIC S5, S7 and PC modules.

Here you will find sample programs and documentation for the following SIMATIC NET products:

  • CPs for SIMATIC S5, e.g. CP143, CP1430, CP5431
  • CPs for SIMATIC S7, e.g. CP343-1, CP443-1, CP342-5, CP343-5, CP443-5
  • PC CPs, e.g. CP1413, CP5412 A2, CP1613

Keywords:
FMS protocol, FDL protocol-, ISO transport, ISO-on-TCP, TCP native, Send/Receive, UDP

Where can you find sample S7 programs and documentation for communication via PROFIBUS in the SIMATIC NET Quick Start Collection?Go to beginning
Part number:

Description:
The SIMATIC NET Quick Start Collection provides simple sample programs designed to help when starting to configure plants with SIMATIC NET products.

The following links take you to the SIMATIC NET Quick Start Collection. There you will find sample programs and documentation for communication via PROFIBUS using the following protocols:

Here you will find sample S7 programs and documentation for the following SIMATIC NET products:

  • PROFIBUS CPs for S7-300, S7-400 and S7-200
  • PROFIBUS PC CPs, e.g. CP5611, CP5613
  • Gateway, e.g. DP/AS Interface Link

Keywords:
S7 communication, Send/Receive, DP Master, DP Slave, Connection configuration, FDL

How do you configure a PC station as DP slave for connecting an S7 station (as DP master) for the SIMATIC NET OPC server with the SIMATIC NET PC software?Go to beginning
Part number:

Instructions:
In this example, a CP5611 is used for the communication via the OPC server as DP slave with an S7 station as DP master on the PROFIBUS.

Note:
The procedure described here also applies for communication processors CP5511, CP5512 and CP5621.

General information:
You can choose between two different configuration tools:

  • NCM PC:
    NCM PC is supplied with the SIMATIC NET CD and permits you to create PC projects and open STEP 7 projects. However, it is not possible to use this software to edit the S7 blocks in the STEP 7 project. 
  • STEP 7:
    STEP 7 is a separate software package and permits you to create S7-400, S7-300 and PC projects. It is possible to use this software to edit the S7 blocks.
The requirement is that STEP 7 is installed and that the DP master is already configured (for example, STEP 7 project with the configuration of an S7 station). If the DP master is also a PC station, then the configuration of the PC station as DP slave can also be made with NCM PC.

Please follow the instructions below for configuring the PC station.

Guide_DPSlave_e.pdf ( 1366 KB )

More information on using and configuring a PC station as DP slave or DP master is available in the applications listed below:
 
Title of application Entry ID
Distributed Automation with the PC - The SIMATIC NET OPC Server as PROFIBUS DP Slave 21040390
Controlling with the PC - The SIMATIC NET OPC Inproc Server as DP Master 21045282

Keywords:
DP-Slave, CP5611, CP5511, CP5512, CP5621, Hardware Configuration, SIMATIC NET PC software, Configuration, Guidelines, SOFTNET DP slave, Link DP slave, PC station.

How do you configure an FDL connection to the SIMATIC S7 via PROFIBUS for the SIMATIC NET OPC server with the SIMATIC NET PC software?Go to beginning
Part number:

Instructions:
In this example, a CP5611 is used to establish the FDL connection with an S7 station on the PROFIBUS via the OPC server.

Note:
The procedure described here also applies for communication processors CP5613/14 A2, CP5621 and CP5511/CP5512.

General information:
The requirement is that one of the two following configuration tools is installed.

  • NCM PC: 
    NCM PC is supplied with the SIMATIC NET CD and permits you to create PC projects and open STEP 7 projects. However, it is not possible to use this software to edit the S7 blocks in the STEP 7 project.
  • STEP 7:  
    STEP 7 is a separate software package and permits you to create S7-400, S7-300 and PC projects. It is possible to use this software to edit the S7 blocks.

Only one of these tools can be installed.

Please follow the instructions below for configuring the PC station.

Guide_FDLS7_OPC_e.pdf ( 1670 KB )

Keywords:  
FDL connection, SIMATIC NET OPC server, SIMATIC NET PC software, Configuration, Guidelines, SOFTNET DP, SOFTNET S7, Send, Receive, CP5611 A2, CP5613 A2, CP5614 A2, CP5511, CP5512, CP5621

Establishing a connection from a PC to the S7-400  Go to beginning
Part number:

QUESTION:
What do I have to consider when connecting a PC to a S7-300 and  S7-400?

ANSWER:
In figure 1 you see a configured connection from an OPC-Server to a SIMATIC 400 and an unconfigured connection from a OPC-Server to the SIMATIC 300. 

Figure 1  Connection configuration in NETPRO

Figure 2  Configured connection (S7 400)  

Figure 3:  Unconfigured connection (S7-300)

In figure 2 you can see that a bi-directional connection has been configured for the SIMATIC 400.

In figure 3 you can see that a uni-directional connection has been configured for the SIMATIC 300.

After the connection has been established the configuration has to be transferred to the PC station.

Detailed informationen about this topic can be found on the SIMATIC NET CD under "Advanced PC Configuration" 

ATTENTION:
The configured connection has to be transferred also onto the S7-400 station.

Explanation:
When configuring a connection to a S7-400 in NETPRO, the project has to be transferred to both stations, here the "PC_Station" and the "SIMATIC 400", with "Load to station". This is called a configured connection. The S7 connections that have been defined on the server as well as on the client side - e.g. from the PC to a AS S7-400 station - are called also bi-directional connections.

When configuring a connection to a S7-300 in NETPRO, the project has to be transferred only to the PC station. This is an unconfigured connection. S7 connections that are defined only on the client side - e.g. from a PC to an AS S7-300 station - are also called uni-directional.

What differences are there when configuring S7 connections?Go to beginning
Part number:

Description:
In this description of how to configure S7 connections it is assumed that all the stations are in one S7 project.

Types of S7 connections:
With S7 connections you differentiate between bilaterally configured and unilaterally configured S7 connections.

Bilaterally configured S7 connections
You recognize bilaterally configured connections by the fact that they receive a connection ID at both endpoints. The partner ID can be identical for both connection partners, but doesn't have to be. The remote endpoint of the S7 connection created is entered automatically in the connection table on the partner side.
You can use the following communication blocks in the S7-300 or S7-400 station for data communication via bilaterally configured S7 connections:

  • FB/SFB14 "GET" and FB/SFB15 "PUT"
  • FB/SFB12 "BSEND" and FB/SFB13 "BRCV" or
  • FB/SFB8 "USEND" and FB/SFB9 "URCV"

Unilaterally configured S7 connections
Unilaterally configured S7 connections are configured on the module that actively sets up the S7 connection.
You can use the communication blocks FB/SFB14 "GET" and FB/SFB15 "PUT" in the S7-300 or S7-400 station for data communication via unilaterally configured S7 connections. You can use these for data communication via unilaterally and bilaterally configured S7 connections. You can only use the communication blocks FB/SFB12 "BSEND" and FB/SFB13 "BRCV" and FB/SFB8 "USEND" and FB/SFB9 "URCV" for data communication via bilaterally configured S7 connections.

More information on the properties and special features of the S7 protocol and on the properties of the different S7 protocol services is available in Entry ID: 26483647.

In NetPro there is a connection table with all the configured communication connections. Unilaterally configured S7 connections have no entry in the "Partner ID" column of the connection table. This field remains empty in the connection table. No S7 connection is configured on the server and no communication blocks are called. The server is managed independently by the CPU's operating system and has resource 0x03. No system data is created for this in the connection partner.


Fig. 1: Bilaterally and unilaterally configured S7 connection

Summary:

  • All S7 connections that have a connection ID at both connection endpoints are bilaterally configured S7 connections.

  • S7 connections that have no partner ID are unilaterally configured S7 connections or have been created via "unspecified" S7 connections with resource 0x03.

Important:

  • With bilaterally configured S7 connections you must load the configuration in both connection partners after creating the S7 connection.
  • With unilaterally configured S7 connections you must load only the one station in whose connection table the S7 connection is shown.

Note:
In the sample S7 connection configuration given above all the stations are in one S7 project. You can also set up an S7 connection to an unspecified partner and the endpoints of these connections can be in different projects. More information on this is available in the Online Help of STEP 7:

  • Configuring cross-project connections.
  • Connection types for partners in other projects.
  • Creating cross-project subnetworks.

Keywords:
Connection configuration, S7-300, S7-400, SIMATIC, Connections, Creating a connection, Client, Server, Connection setup, NetPro

 Entry ID:28526800   Date:2010-04-21 
I regard this article....as helpfulas not helpful                                 






























related links
How do you configure an FDL conne ...
How do you configure an FDL conne ...
How do you configure an S7 connec ...
How do you configure a PC station ...
How do you configure an S7 connec ...
mySupport
My Documentation Manager 
Newsletter 
CAx-Download-Manager 
Support Request
To this entry
Print
Create PDF 
Send to a friend
QuickLinks
Compatibility tool 
Help
Online Help
Guided Tour