103BCommunication
10.2 PROFINET
S7-1200 Programmable controller
416
System Manual, 11/2011, A5E02486680-05
●
UDP is a simpler transport control protocol than TCP, with a thin layer that yields low
overheads
●
Can be used very flexibly with many third-party systems
●
Routing-capable
●
Uses port numbers to direct the datagrams
●
Messages are unacknowledged: The application is required to take responsibility for error
recovery and security
●
Programming effort is required for data management due to the SEND / RECEIVE
programming interface
UDP supports broadcast communication. To use broadcast, you must configure the IP
address portion of the ADDR configuration. For example: A CPU with an IP address of
192.168.2.10 and seubnet mask of 255.255.255.0 would use a broadcast address of
192.168.2.255.
TUSEND and TURCV
The following instructions control the UDP communication process:
●
TCON establishes the communication between the client and server (CPU) PC.
●
TUSEND and TURCV send and receive data.
●
TDISCON disconnects the communication between the client and server.
Refer to TCON, TDISCON, TSEND, and TRCV (Page 408) in the "TCP and ISO-on-TCP"
section for more information on the TCON and TDISCON communication instructions.
Table 10- 15 TUSEND and TURCV instructions
LAD / FBD
SCL
Description
"TUSEND_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_);
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.
"TURCV_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_);
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.