Technical data

Table Of Contents
Open Communication via Industrial Ethernet
System Software for S7-300/400 System and Standard Functions - Volume 2/2
23-24
A5E00739858-01
23.8 Terminating a Connection with FB 66 "TDISCON"
Use with TCP native and ISO on TCP
FB 66 "TDISCON" terminates a communications connection from the CPU to a
communications partner.
Use with UDP
The FB 66 "TDISCON" closes the local communications access point. The
connection between the user program and the communications level of the
operating system is terminated.
Function
FB 66 "TDISCON" is an asynchronously functioning FB, which means that its
processing extends over several FB calls. To start terminating a connection, call
FB 66 with REQ = 1.
After FB 66 "TDISCON" has been successfully called, the ID specified for
FB 65"TCON" is no longer valid and thus cannot be used for sending or receiving.
The job status is indicated at the output parameters RET_VAL and BUSY.
STATUS corresponds to the RET_VAL output parameter of asynchronously
functioning SFCs (see also Meaning of the Parameters REQ, RET_VAL and BUSY
with Asynchronous SFCs).
The following table shows the relationships between BUSY, DONE and ERROR.
Using this table, you can determine the current status of FB 66 or when the
establishment of the connection is complete.
BUSY DONE ERROR Description
TRUE irrelevant irrelevant The job is being processed.
FALSE TRUE FALSE The job was completed successfully.
FALSE FALSE TRUE The job was ended with an error. The cause of the error can be
found in the STATUS parameter.
FALSE FALSE FALSE The FB was not assigned a (new) job.