Udp_Connect Instruction - Siemens SIMATIC S7 System Manual

Hide thumbs Also See for SIMATIC S7:
Table of Contents

Advertisement

Libraries
9.4 Open user communication library
9.4.2.3

UDP_CONNECT instruction

The UDP_CONNECT instruction creates a passive connection using UDP protocol. UDP is a
connectionless protocol so there is no actual connection created between this CPU and the
remote device. The UDP connection opens the selected local port to use with UDP protocol.
LAD/FBD
STL
UDP_CONNECT Req, ConnID,
LocPort, Done, Busy, Er-
ror, Status
The UDP_CONNECT instruction only requires a connection ID and a local port number to
create the connection. One UDP connection can send messages to any number of other
devices since the IP address and remote port are supplied with each UDP_SEND instruction.
You will need multiple UDP connections only if you require multiple local ports. You cannot
use the same local port number for multiple UDP connections. All local port numbers must
be unique.
The connect operation is asynchronous and can take several scans to complete. There is no
active connection establishment with the remote device, nor are we waiting for another
device to connect to this CPU. The Busy output is set while the connect operation is
pending. When the connect operation is complete, the program sets the Done output. The
program sets the Error output only if there is a problem with the input parameters or there is
no passive connection available. The Status output byte contains the error code if the
program sets the Error bit.
You must not change the parameters of the UDP_CONNECT while the instruction is busy so
that the CPU knows this is a continuation of the call that started the connection process.
You can call the UDP_CONNECT instruction to determine the current status of a connection.
Set the Req input FALSE and provide a valid connection ID (ConnID), and the
UDP_CONNECT instruction returns the following:
● The instruction sets the Done output if the connection is active and ready to send or
receive. This only means that you can use the connection. This is not an indication that
there is any remote device present.
● The instruction sets the Busy output if the connect is still processing.
● The instruction sets the Error output if the connection is not usable. The Status output
byte contains one of the error codes to specify the problem.
508
Description
The UDP_CONNECT creates a passive connection using UDP
protocol to open a selected local port.
System Manual, V2.3, 07/2017, A5E03822230-AF
S7-200 SMART

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Simatic s7-200 smart

Table of Contents