103BCommunication
10.2 PROFINET
S7-1200 Programmable controller
412
System Manual, 11/2011, A5E02486680-05
TSEND and TRCV
Table 10- 11 TSEND and TRCV instructions
LAD / FBD
SCL
Description
"TSEND_DB"(
req:=_bool_in_,
ID:=_word_in_,
len:=_uint_in_,
done=>_bool_out_,
busy=>_bool_out_,
error=>_bool_out_,
status=>_word_out_,
data:=_variant_inout_);
TCP and ISO on TCP: TSEND sends data
through a communication connection from the
CPU to a partner station.
"TRCV_DB"(
en_r:=_bool_in_,
ID:=_word_in_,
len:=_uint_in_,
ndr=>_bool_out_,
busy=>_bool_out_,
error=>_bool_out_,
status=>_word_out_,
rcvd_len=>_uint_out_,
data:=_variant_inout_);
TCP and ISO on TCP: TRCV receives data
through a communication connection from a
partner station to the CPU.
1
STEP 7 automatically creates the DB when you insert the instruction.
Table 10- 12 Data types for the parameters of TSEND and TRCV
Parameter and type
Data type
Description
REQ
IN
Bool
TSEND: Starts the send job on a rising edge. The data is
transferred from the area specified by DATA and LEN.
EN_R
IN
Bool
TRCV: Enables the CPU to receive; with EN_R = 1, the TRCV is
ready to receive. The receive job is processed.
ID
IN
CONN_OUC
(Word)
Reference to the associated connection. ID must be identical to
the associated parameter ID in the local connection description.
Value range: W#16#0001 to W#16#0FFF
LEN
IN
UInt
Maximum number of bytes to be sent (TSEND) or received
(TRCV):
Default = 0: The DATA parameter determines the length of the
data to be sent (TSEND) or received (TRCV).
Ad hoc mode = 65535: A variable length of data is set for
reception (TRCV).
DATA
IN_OUT
Variant
Pointer to send (TSEND) or receive (TRCV) data area; data area
contains the address and length. The address refers to I memory,
Q memory, M memory, or a DB.