show the entry list
Industrial Ethernet S7-300/400 CPs -- Configuring and programming communication -- Configuring connections
What should you watch out for when configuring fault-tolerant S7 connections over ISO-on-TCP?
How do you configure an ISO transport connection for data exchange between S7-300 and/or S7-400 by way of Industrial Ethernet CPs?
How do you configure a UDP connection for data exchange between S7-300 and/or S7-400 by way of Industrial Ethernet CPs?
How do you configure an ISO-on-TCP connection for data exchange between S7-300 and/or S7-400 by way of Industrial Ethernet CPs?
Where can you find sample S7 programs and documentation for communication via PROFINET on the SIMATIC NET Quick Start Collection?
Where can you find sample S7 programs and documentation for communication in the IWLAN in the SIMATIC NET Quick Start Collection?
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 Industrial Ethernet in the SIMATIC NET Quick Start Collection?
How do you send/receive data to/from multiple communication partners via the IE CP of an S7-300 or S7-400 station using the UDP protocol?
How do you configure a PC station as PROFINET IO controller for connecting to a S7 station (as PROFINET IO device) for the SIMATIC NET OPC server with the SIMATIC NET PC software?
How do you configure S5-compatible communication to the SIMATIC S7 via Industrial Ethernet for the SIMATIC NET OPC server with the SIMATIC NET PC software?
How do you configure an S7 connection for data communication between an S7-200 and an S7-300 or S7-400 on the Industrial Ethernet?
Establishing a connection from a PC to the S7-400 
What differences are there when configuring S7 connections?
What restrictions are there with Industrial Ethernet CPs when the communications service ISO-on-TCP is being used in parallel via the open TCP/IP communication and the SEND/RECEIVE interface?
What do you have to watch out for, in particular, in the assigning of TSAPs in ISO transport connections and ISO-on-TCP connections?
Procedure and meaning of multicast connections with Industrial Ethernet CPs
How do I set up an ISO connection between a SIMATIC S7 (CP343-1) and a SIMATIC 505 (CP1434) via INDUSTRIAL ETHERNET?
How do you configure the WRITE and FETCH services via Industrial Ethernet (ISO transport connection, ISO-on-TCP connection) for the S7-300/400 with Industrial Ethernet CP343-1 or CP443-1?
Commissioning and Configuring an ISO Transport Connection between the SIMATIC S5 and SIMATIC S7 via Industrial Ethernet
How do you configure a specified and an unspecified S7 connection for data exchange between S7-300 and/or S7-400 by way of Industrial Ethernet CPs?
Configuring a TCP connection via Ethernet (TCP native) between a SIMATIC S7 and a PC with Socket Interface
How do you configure a TCP connection for data exchange between S7-300 and/or S7-400 by way of Industrial Ethernet CPs?
How do you send/receive data to/from multiple communication partners via the IE CP of an S7-300 or S7-400 station using the UDP protocol?
Part number:

Configuration Notes:
An S7-300 station sends/receives data to/from multiple communication partners using the UDP protocol.

The advantages of the connectionless UDP protocol are:

  • Very rapid data transfer
  • Very flexible, can be well implemented with third-party systems
  • Routing-compatible
  • Multicast-compatible / broadcast-compatible
  • Suitable for small to medium volumes of data (<= 2048 bytes)

The disadvantages of the connectionless UDP protocol are:

  • Data is transferred packet-oriented (not stream-oriented)
  • Send and receive jobs are not acknowledged by the communication partners. This has to be done in the user program.
  • Lost data packets are not sent again
  • Multiple deliveries of individual packets is possible
  • The order of arrival of the packets at the receiver's end cannot be predicted
  • Broadcast function can only be used in send direction

Entry ID 26484229 gives you detailed information on the properties and special features of the UDP protocol.

In this example, only one local UDP endpoint is configured in the S7-300 station. UDP datagrams can be sent/received via this local UDP endpoint to/from multiple remote UDP endpoints.


Fig. 01: Configuration

Configuring the local UDP endpoint:
Proceed as follows to configure the local UDP endpoint.

Open the STEP 7 project with the configuration of your S7-300 station. In NetPro you configure an unspecified UDP connection for the S7-300 station.


Fig. 02: Configuring an unspecified UDP connection

In the Properties dialog of the UDP connection you switch to the "Addresses" tab. Here you enable the option "Address assignment in block". Now it is no longer possible to assign the target parameters like IP address and port of the partner at this point.


Fig. 03: Properties dialog of the UDP connection -> "Addresses" tab

The UDP endpoint must be configured in both the sending and the receiving station.

The S7 program:
The IP address and the port of the partner are specified in the user program, i.e. the target parameters are defined in the first 6 bytes of the user data to be transferred. The user data is transferred with the function FC5 "AG_SEND" or FC50 "AG_LSEND" as the case may be.
In this way, the data can be sent via a local UDP endpoint to multiple remote UDP endpoints (i.e. to multiple communication partners). Since only one UDP endpoint is configured, only one connection resource of the IE CP is occupied. Consequently, the resources saved can be used to configure other communication connections.

The IE CP takes the IP address and port data of the communication partner from the first 6 bytes of the user data sent by the CPU. The data delivered is not checked for plausibility.

The structure of the user data to be transferred is explained below taking the example of a data block (DB10) as the data source.


Fig. 04: Data structure in the send station user program

In this example, the data is sent to port 2001 of the IP address 140.80.0.3.

The target IP address 140.80.0.3 is an IP address of a class B network, i.e. the first two bytes are relevant for the subnetwork address and the last two for the computer address.

In this example, the IE CP that sends the UDP datagrams via a configured local UDP endpoint has the IP address 140.80.0.2. If the user program transfers the target IP address 140.80.0.3 to the IE CP, then communication works without errors.

Furthermore, in the S7 program you call function FC6 "AG_RCV" or FC60 "AG_LRCV" as the case may be to have the UDP datagrams received by one or multiple remote UDP endpoints via the local UDP endpoint. The following entries include a detailed sample program for communication blocks FC5 "AG_SEND" and FC6 "AG_RCV" or FC50 "AG_LSEND" and FC60 "AG_LRCV" as the case may be: 17853532 and 18513371.

FC6 "AG_RCV" or FC60 "AG_LRCV" is only called once in the user program, even if the UDP datagrams are received by multiple remote UDP endpoints. The address data of the sender (source port and source IP address) is transferred by the send station to the receive station in the first 6 bytes of the user data.

The structure of the user data received then looks like this:


Fig. 05: Structure of the user data received

 Entry ID:1964928   Date:2009-07-29 
I regard this article....as helpfulas not helpful                                 
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