Libraries
9.4 Open user communication library
The maximum amount of data that you can send in one send operation is 1024 bytes. The
program copies the data from the send buffer in user memory to an internal buffer when the
TCP_SEND executes with the Req input set TRUE. You can change the program send
buffer after the TCP_SEND executes and the instruction sets the Busy output.
Table 9- 17
Parameter
EN
Req
ConnID
DataLen
DataPtr
Done
Busy
Error
Status
Example
This is an example usage of the TCP_SEND instruction:
512
Parameters of the TCP_SEND instruction
Declaration Data type
IN
BOOL
IN
BOOL
IN
WORD
IN
WORD
IN
DWORD
OUT
BOOL
OUT
BOOL
OUT
BOOL
OUT
BYTE
Description
Enable input
The CPU starts the send operation if Req =
TRUE. If Req = FALSE, then the outputs show
the current status of the send operation.
The Connection ID (ConnID) is the number of the
connection for this send operation. Use the Con-
nID that you selected for the TCP_CONNECT
operation.
The DataLen is the number of bytes to transmit
(1 to 1024).
The DataPtr is the pointer to the data to be sent.
This is an S7-200 SMART pointer to I, Q, M, or V
memory (for example, &VB100).
The instruction sets the Done output when the
send operation is complete with no errors.
The instruction sets the Busy output while the
send operation is in progress.
The instruction sets the Error output when the
send operation is complete with an error. Refer to
"Open user communication library instruction
error codes" (Page 524) for further information.
The Status output shows the error code if the
instruction sets the Error output. Status is zero
(no error) if the instruction sets the Busy or Done
outputs.
System Manual, V2.3, 07/2017, A5E03822230-AF
S7-200 SMART