Program instructions
7.3 Communication
S7-200 SMART
System Manual, V2.3, 07/2017, A5E03822230-AF
225
Table 7- 11 Definition of TSEND and TRECV instruction TABLE parameter structure for TCP and
ISO-on-TCP
Byte
offset
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
0
D
A
E
Error code (5 bits)
1
REQ
1
2
Connection ID
(2 bytes)
3
4
Data Length
2
5
6
Data Pointer
3
7
8
9
1
REQ: You set the REQ bit to TRUE to initiate a new TSEND instruction operation. The TRECV
instruction ignores the REQ status bit. The REQ bit is only used for the TSEND instruction.
For the TRECV instruction, the Done bit means that the CPU received data (New Data Ready) and
the Data_Length value returns the actual number of bytes received. If there is no data available
when called, the TRECV instruction returns with the Active flag set and a Data_Length value of ze-
ro. If the number of received bytes exceeds the size of the receive buffer (data length input), the
program copies the maximum number of bytes into the buffer and returns an error to the TRECV
instruction.
2
Data Length: The Data Length in the TRECV instruction table is both an input and output parame-
ter. The input value is the maximum size of the receive buffer. The output value is the number of
bytes actually received.
The Data Length is an input value only for the TSEND instruction.
3
Data Pointer: An S7-200 SMART pointer to the data in the local CPU.