Siemens SIMATIC S7 System Manual page 502

Hide thumbs Also See for SIMATIC S7:
Table of Contents

Advertisement

Libraries
9.4 Open user communication library
The connect operation is asynchronous and can take several scans to complete. The Busy
output has a value of TRUE while the connect operation is pending. When the CPU
completes the operation, the instruction sets either the Done or Error output. If there is an
error, the Status output contains the error code.
You must not change the input parameters of the TCP_CONNECT while the instruction is
busy. The CPU requires this so that it knows that this is a continuation of the call that started
the connection process.
You assign the connection ID (ConnID) input to the connection and then use this ConnID to
reference this connection when sending, receiving, or disconnecting.
The Active input bit determines whether this is an active connection (Active set to TRUE) or
a passive connection (Active set to FALSE).
If this is an active connection (a client), then the S7-200 SMART CPU attempts to contact
and create a connection to the specified IP address and remote port number (RemPort). The
CPU opens a local port (LocPort) to receive messages from the remote device.
When the Active input is set to FALSE, the S7-200 SMART CPU creates a passive (server)
connection. In this case, the CPU opens the requested local port (LocPort) and accepts
connection requests from a remote device. You should set the IP address to 0.0.0.0 if you
wish to accept a connection request from any remote IP address. If the IP address is non-
zero, the CPU accepts a connection request only from the specified IP address. The CPU
ignores the remote port number (RemPort) for a passive connection, and RemPort can be
set to zero.
You can call the TCP_CONNECT instruction anytime to determine the current status of a
connection. Set the Req input to FALSE and provide a valid connection ID (ConnID), and
TCP_CONNECT returns the following:
● Busy if the connect process is still progressing.
● Done if the connection is active and ready to send or receive.
● Error if the connection is not usable. Status contains one of the error codes to specify the
problem.
Note that active connections can require up to 30 seconds to determine if the remote device
will allow the connection or not. Passive connections show a Busy status until a remote
device attempts to connect to the CPU.
502
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