Communication
10.2 PROFINET
S7-1200 Programmable controller
536 System Manual, 03/2014, A5E02486680-AG
Table 10- 13 TUSEND and TURCV instructions
req:=_bool_in_,
ID:=_word_in_,
len:=_udint_in_,
done=>_bool_out_,
busy=>_bool_out_,
error=>_bool_out_,
status=>_word_out_,
The TUSEND instruction sends data via UDP to
the remote partner specified by the parameter
ADDR.
To start the job for sending data, call the TUSEND
instruction with REQ = 1.
en_r:=_bool_in_,
ID:=_word_in_,
len:=_udint_in_,
ndr=>_bool_out_,
busy=>_bool_out_,
error=>_bool_out_,
status=>_word_out_,
rcvd_len=>_udint_out_,
The TURCV instruction receives data via UDP.
The parameter ADDR shows the address of the
sender. After successful completion of TURCV, the
parameter ADDR contains the address of the
remote partner (the sender).
TURCV does not support ad hoc mode.
To start the job for receiving data, call the TURCV
instruction with EN_R = 1.
1
STEP 7 automatically creates the DB when you insert the instruction.
TCON, TDISCON, TUSEND, and TURCV operate asynchronously, which means that the job
processing extends over multiple instruction executions.
Table 10- 14 TUSEND and TURCV data types for the parameters
REQ
IN Bool
Starts the send job on a rising edge. The data is transferred from
the area specified by DATA and LEN.
EN_R
(TURCV)
IN Bool
• 0: CPU cannot receive.
• 1: Enables the CPU to receive. The TURCV instruction is
ready to receive, and the receive job is processed.
ID IN Word Reference to the associated connection between the user
program and the communication level of the operating system.
ID must be identical to the associated parameter ID in the local
connection description.
Range of values: W#16#0001 to W#16#0FFF.
LEN IN UDInt Number of bytes to be sent (TUSEND) or received (TURCV).
• Default = 0. The DATA parameter determines the length of
the data to be sent or received.
• Otherwise, range of values: 1 to 1472
DONE
(TUSEND)
IN Bool Status parameter DONE (TUSEND):
• 0: Job is not yet started or still running.
• 1: Job completed without error.