Siemens SIMATIC S7 System Manual page 226

Hide thumbs Also See for SIMATIC S7:
Table of Contents

Advertisement

Program instructions
7.3 Communication
Table 7- 12
Byte
offset
REQ: You set the REQ bit to TRUE to initiate a new TSEND instruction operation. The TRECV
1
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.
Data Length: The Data Length in the TRECV instruction structures is both an input and output
2
parameter. 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.
Data Pointer to the data area: An S7-200 SMART pointer to the data in the local CPU.
3
Remote IP address: This is the IP address of the remote device for a TSEND instruction. The IP
4
address must be different than that of the local CPU and cannot be a multicast or broadcast ad-
dress. Since the S7-200 SMART supports routing, the IP address may be on a different subnet
than the local CPU. (The IP address must be supplied for each UDP send operation.)
The IP address is a returned value for a UDP receive operation. The IP address is the address of
the sender of UDP message.
Remote Port: This is the port number in the remote device.
5
The remote port is a returned value for a UDP receive operation. The port is the port number of the
sender of the UDP message.
UDP requires the remote port number for each TSEND instruction message.
226
Definition of TSEND and TRECV instruction TABLE parameter structure for UDP
Bit 7
Bit 6
0
D
A
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
Bit 5
Bit 4
Bit 3
E
Connection ID
(2 bytes)
Data Length
Data Pointer
Remote
IP
Address
4
Remote port
System Manual, V2.3, 07/2017, A5E03822230-AF
Bit 2
Bit 1
Error code (5 bits)
2
3
5
Bit 0
REQ
1
S7-200 SMART

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Simatic s7-200 smart

Table of Contents