Siemens SIMATIC S7 System Manual page 227

Hide thumbs Also See for SIMATIC S7:
Table of Contents

Advertisement

TDCON
You use the TDCON instruction to terminate an existing communication connection. The
instruction terminates the connection when the REQ bit is set. It is recommended that you
put a positive edge trigger on the REQ input. If the your program calls the TDCON instruction
and the connection is already disconnected, then the instruction responds with error code
24, which means no operation pending.
TDCON instruction table
The following table contains the format and definitions for the TDCON instruction. Refer to
"OUC instruction error codes" (Page 228) for the error code listing. Refer to "Ports and
TSAPs" (Page 419) for port number restrictions and further information:
● Status: The first byte of the table returns the status of the operation to the user. The OUC
instructions ignore the value of the status byte as an input. The status byte is valid on the
return of the instruction. These are the status bit definitions:
– D = Done (Complete)
– A = Active (In progress, in other words, Busy)
– E = Error (Complete with error)
– Error Code
If there is an error, the Done and Error bits are both set. The error codes are listed in
"OUC instruction error codes" (Page 228).
● REQ: You use the REQ bit to initiate a new operation. The REQ bit is a level-triggered
value. Your program code must provide the one shot operation if required (a positive
edge contact). If the operation is not busy, a REQ value of TRUE initiates a new
operation. For example, if there is not currently a TSEND instruction in progress, a TRUE
value in the REQ bit causes the program to initiate a new TSEND instruction operation.
● Connection ID: The Connection ID is a 16-bit value that you select to pass into the
function. The range is 0 to 65534 (65535 is reserved). The Connection ID parameter is an
input to the OUC instructions. The TSEND, TRECV, and TDCON instructions use the
Connection ID that you select for the TCON instruction as a reference.
Table 7- 13
Byte
offset
S7-200 SMART
System Manual, V2.3, 07/2017, A5E03822230-AF
Definition of TDCON instruction TABLE parameter structure
Bit 7
Bit 6
0
D
A
1
2
3
Bit 5
Bit 4
Bit 3
E
Connection ID
(2 bytes)
Program instructions
7.3 Communication
Bit 2
Bit 1
Error code (5 bits)
Bit 0
REQ
227

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Simatic s7-200 smart

Table of Contents