Communication
11.2 PROFINET
S7-1200 Programmable controller
System Manual, V4.2, 09/2016, A5E02486680-AK
837
TSEND_C and TRCV_C (Send and receive data using Ethernet)
The TSEND_C instruction combines the functions of the TCON, TDISCON and TSEND
instructions. The TRCV_C instruction combines the functions of the TCON, TDISCON, and
TRCV instructions. (Refer to "TCON, TDISCON, TSEND, AND TRCV (Page 857)" for more
information on these instructions.)
The minimum size of data that you can transmit (TSEND_C) or receive (TRCV_C) is one
byte; the maximum size is 8192 bytes. TSEND_C does not support the transmission of data
from Boolean locations, and TRCV_C will not receive data into Boolean locations. For
information on transferring data with these instructions, see the section on data consistency
(Page 198).
Note
Initializing the communication parameters
After you insert the TSEND_C or TRCV_C instruction, use the "Properties"
of the instruction
807) to configure the communication parameters (Page 832). As you enter the
parameters for the communication partners in the inspector window, STEP
7 enters the
orresponding data in the DB for the instruction.
If you want to use a multi
-instance DB, you must manually configure the DB on both CPUs.
Table 11- 11 TSEND_C and TRCV_C instructions
req:=_bool_in_,
cont:=_bool_in_,
len:=_uint_in_,
done=>_bool_out_,
busy=>_bool_out_,
error=>_bool_out_,
status=>_word_out_,
connect:=_struct_inout_,
data:=_variant_inout_,
TSEND_C establishes a TCP or ISO on TCP
communication connection to a partner station,
sends data, and can terminate the connection.
After the connection is set up and established, it
is automatically maintained and monitored by
the CPU.
en_r:=_bool_in_,
cont:=_bool_in_,
len:=_uint_in_,
adhoc:=_bool_in_,
done=>_bool_out_,
busy=>_bool_out_,
error=>_bool_out_,
status=>_word_out_,
rcvd_len=>_uint_out_,
connect:=_struct_inout_,
data:=_variant_inout_,
TRCV_C establishes a TCP or ISO on TCP
communication connection to a partner CPU,
receives data, and can terminate the connection.
After the connection is set up and established, it
is automatically maintained and monitored by
the CPU.
1
STEP 7 automatically creates the DB when you insert the instruction.