Communication
11.2 PROFINET
S7-1200 Programmable controller
System Manual, V4.2, 09/2016, A5E02486680-AK
853
The following functions describe the operation of the TRCV_C instruction:
● To establish a connection, execute TRCV_C with parameter CONT = 1.
● To receive data, execute TRCV_C with parameter EN_R = 1. TRCV_C receives the data
continuously when parameters EN_R = 1 and CONT = 1.
● To terminate the connection, execute TRCV_C with parameter CONT = 0. The
connection will be aborted immediately, and data could be lost.
TRCV_C handles the same receive modes as the TRCV instruction. The following table
shows how data is entered in the receive area:
Table 11- 17 Entering the data into the receive area
Entering the data in the
receive area
Parameter
"connection_type"
Value of the LEN parameter
Value of the RCVD_LEN
parameter (bytes)
TCP Data reception with
B#16#11 0 (recommended) or 1 to
1 to 8192
ISO on TCP Protocol-controlled B#16#12 0 (recommended) or 1 to
1 to 8192
Note
Ad hoc mode
The "ad hoc mode" exists with the TCP and ISO on TCP protocol variants. You set "ad hoc
mode" by assigning "65535" to the LEN param
eter. The receive area is identical to the area
formed by DATA. The length of the received data will be output to the parameter
RCVD_LEN.
If you store the data in an "optimized" DB (symbolic only), you can receive data only in
arrays of Byte, Char, USInt,
and SInt data types.
Note
Importing of S7-300/400 STEP 7 projects containing "ad hoc mode" into the S7-1200
In S7
-300/400 STEP 7 projects, "ad hoc mode" is selected by assigning "0" to the LEN
-1200, you set "ad hoc mode" by assigning "65535" to the LEN
-300/400 STEP 7 project containing "ad hoc mode" into the S7-1200, you
must change the LEN parameter to "65535".