show the entry list
S7-300 CPU 31x -- Configuring and programming communication -- Using communication blocks
What is the volume of data that you can transfer with function blocks FB34 "GET_E" and FB35 "PUT_E"?
How do you cyclically read out the 8 channels of the FM 350-2 counter module as quickly as possible?
How do you read out the IP address of the S7-300 CPU in the user program at runtime?
How do you enable the ad-hoc mode when you call the TRCV instruction?
How do you use the blocks for MODBUS/TCP communication over the integrated PROFINET interface of the S7-300 and S7-400 CPUs and IM151-8 PN/DP CPU in STEP 7 Professional (TIA Portal)?
Which security modules can be reached with SOFTNET Security Client V4 over a secure IPsec tunnel connection?
What is the difference between the initialization and runtime parameters on the blocks for Modbus TCP?
Why is the status value A090 (hex) output for Modbus TCP although you have entered the correct license?
What are the differences between the licensed version and the downloadable demo version of the blocks for Modbus TCP?
Why is the value A083 (hex) output permanently at the STATUS output parameter of the block for Modbus TCP when the ENQ_ENR=true input parameter has been set?
Which blocks for Modbus TCP can you rename or re-wire when the block numbers of the Modbus blocks are already being used in the user program?
How do you implement chronological messaging with S7-300 CPUs and WinCC?
How do you program communication blocks FB14 "GET" and FB15 "PUT" for data exchange in the S7 program of an S7-300 CPU?
How can you read out diagnostics data from a SIRIUS 3RK3 modular safety system using a S7-300/400 CPU?
Which ports are released for Modbus/TCP communication and how many Modbus clients can communicate with a SIMATIC S7 CPU as Modbus server?
How do you configure a specified and an unspecified S7 connection for data exchange between S7-300 and/or S7-400 by way of Industrial Ethernet CPs?
What restrictions are there for active jobs when communicating with SFC 58 / SFC 59 and SFB 52 / SFB 53 via PROFIBUS DP and PROFINET IO?
How do you program communication blocks FB12 "BSEND" and FB13 "BRCV" for data exchange in the S7 program of an S7-300 CPU?
How do you program the communication blocks FB63 "TSEND", FB64 "TRECV", FB65 "TCON" and FB66 "TDISCON" in order to use the ISO-on-TCP protocol for data exchange by way of the integrated PROFINET interface of a CPU or by way of the CP443-1 Advanced?
How do you program the communication blocks FB63 "TSEND", FB64 "TRCV", FB65 "TCON" and FB66 "TDISCON" in order to use the TCP protocol for data exchange by means of the integrated PROFINET interface of an S7-300 or S7-400 CPU?
How do you establish OPEN MODBUS / TCP communication from a SIMATIC S7 and where can you find further information?
How do you program the communication blocks FB67 "TUSEND", FB68 "TURCV", FB65 "TCON" and FB66 "TDISCON" in order to use the UDP protocol for data exchange by means of the integrated PROFINET interface of a CPU?
How does data communication work between S7-300/S7- 400 and S7-200 via MPI using S7 basic communication?
How great is data consistency in the PUT and GET S7 communication functions for the individual S7-300 CPUs and C7 complete devices?
How can you access via PROFIBUS DP another CPU, which is connected to the PROFIBUS DP as a slave, from a DP master using basic communication with SFC72 "I_GET" and SFC73 "I_PUT"?
How can you access consistent data without SFC14/15 as part of the process image?
ET 200S (standard modules) -- Configuring and programming communication -- Using communication blocks
When using the FB81 S_MODB on an S7-400 with more than 8 Kbytes of marker, how do you access the marker area above MB 255?
How do you set the input parameter TIME_RTS_OFF of the S_V24 instruction in the case of low data transfer rates?
How do you use the ET200S 1SI module in conjunction with a CPU S7-15xx?
How in WinAC MP 2008 do you program data transfer with the ET200S 1SI module for the 4-byte or 8-byte communication type?
Which CPU can you operate as a PROFINET I device?
What restrictions are there for active jobs when communicating with SFC 58 / SFC 59 and SFB 52 / SFB 53 via PROFIBUS DP and PROFINET IO?
Which ports are released for Modbus/TCP communication and how many Modbus clients can communicate with a SIMATIC S7 CPU as Modbus server?
How do you program the communication blocks FB63 "TSEND", FB64 "TRCV", FB65 "TCON" and FB66 "TDISCON" in order to use the TCP protocol for data exchange by means of the integrated PROFINET interface of an S7-300 or S7-400 CPU?
How do you program the communication blocks FB63 "TSEND", FB64 "TRECV", FB65 "TCON" and FB66 "TDISCON" in order to use the ISO-on-TCP protocol for data exchange by way of the integrated PROFINET interface of a CPU or by way of the CP443-1 Advanced?
How do you program the communication blocks FB67 "TUSEND", FB68 "TURCV", FB65 "TCON" and FB66 "TDISCON" in order to use the UDP protocol for data exchange by means of the integrated PROFINET interface of a CPU?
What should you watch out for when connecting a SIMATIC HMI device configured with WinCC flexible ES to a SIMATIC ET 200 CPU?
"Report System Errors" function can be used with ET 200S CPU from firmware version V2.1
Using the SFB75 (send alarm to the DP master) on an ET 200S CPU
ET 200pro -- Configuring and programming communication -- Using communication blocks
What restrictions are there for active jobs when communicating with SFC 58 / SFC 59 and SFB 52 / SFB 53 via PROFIBUS DP and PROFINET IO?
How do you program the communication blocks FB63 "TSEND", FB64 "TRCV", FB65 "TCON" and FB66 "TDISCON" in order to use the TCP protocol for data exchange by means of the integrated PROFINET interface of an S7-300 or S7-400 CPU?
How do you program the communication blocks FB63 "TSEND", FB64 "TRECV", FB65 "TCON" and FB66 "TDISCON" in order to use the ISO-on-TCP protocol for data exchange by way of the integrated PROFINET interface of a CPU or by way of the CP443-1 Advanced?
How do you program the communication blocks FB67 "TUSEND", FB68 "TURCV", FB65 "TCON" and FB66 "TDISCON" in order to use the UDP protocol for data exchange by means of the integrated PROFINET interface of a CPU?
Industrial Ethernet S7-300/400 CPs -- Configuring and programming communication -- Using communication blocks
How do you use the predefined data type UDT1 "FILE_DB_HEADER" for FTP communication in the S7-300 and S7-400?
How do you enable the ad-hoc mode when you call the TRCV instruction?
How do you use the blocks for MODBUS/TCP communication over an Industrial Ethernet CP of S7-300 and S7-400 in STEP 7 Professional (TIA Portal)?
How do you copy the CFC chart "Modbus" from the sample project for OPEN MODBUS / TCP into your user project?
What is the difference between the initialization and runtime parameters on the blocks for Modbus TCP?
Why is the status value A090 (hex) output for Modbus TCP although you have entered the correct license?
What are the differences between the licensed version and the downloadable demo version of the blocks for Modbus TCP?
Why is the value A083 (hex) output permanently at the STATUS output parameter of the block for Modbus TCP when the ENQ_ENR=true input parameter has been set?
How is data with variable message length transferred via the TCP protocol and received by an S7-300 station via the Industrial Ethernet CP?
How do you program the function blocks FB14 "GET" and FB15 "PUT" in the S7 program of the S7-300 in order to transfer more than 160 bytes of data?
Where can you find sample programs and documentation for communication from SIMATIC S5 modules to SIMATIC S7 modules via Industrial Ethernet using the UDP protocol?
Where can you find sample programs and documentation for communication from SIMATIC S5 modules to SIMATIC S7 modules via Industrial Ethernet using the TCP protocol?
Where can you find sample programs and documentation for communication from SIMATIC S5 modules to SIMATIC S7 modules via Industrial Ethernet using the ISO transport protocol?
How do you program the FC10 "AG_CNTRL"?
Which commands (CMD) of the FC10 "AG_CNTRL" are supported by the IE CPs?
How many communication jobs may be used simultaneously in an S7-300 CPU for S7 communication via a CP343-1?
Which ports are released for Modbus/TCP communication and how many Modbus clients can communicate with a SIMATIC S7 CPU as Modbus server?
Notes on using an instance for multiple connection IDs
Internal call of FC5 (AG_SEND) with FTP client blocks (FC 40-44) for the CP343-1 IT (6GK7 343-1GX11-0XE0)
How do you program the communication blocks FB63 "TSEND", FB64 "TRECV", FB65 "TCON" and FB66 "TDISCON" in order to use the ISO-on-TCP protocol for data exchange by way of the integrated PROFINET interface of a CPU or by way of the CP443-1 Advanced?
How do you program communication blocks FC11 and FC12 for the PROFINET IO device?
Block calls for communications processors in multiple runtime layers
Changing the input parameter of the user blocks "AG_SEND" and "AG_RECV" during the runtime of a job
What should you watch out for if you transfer variables with the data type "REAL" when calling the communication blocks FC5/50 "AG_SEND/AG_LSEND" and FC6/60 "AG_RCV/AG_LRCV"?
What should you pay attention to when using the communication blocks FC53 "AG_SSEND" and FC63 "AG_SRECV"?
What points do you need to remember when calling communication blocks FC5/50 and FC6/60 in the STEP 7 user program of the CPU?
How do you program communication blocks FC11 and FC12 for the PROFINET IO controller?
How do you establish OPEN MODBUS / TCP communication from a SIMATIC S7 and where can you find further information?
How do you program the communication blocks FC50 and FC60?
Error STATUS "0x7000" on function block FC6 / FC60 (AG_SEND) with Send/Receive communication on the S7-400 controller
How do you program the communication blocks FC5 and FC6?
Sample program: S7 communication with the blocks SFB14 ("GET") and SFB15 ("PUT") with S7-400
Sample Program: S7 Communication with blocks FB14 ("GET") und FB15 ("PUT") of the CPU 317-2PN/DP
How do you program communication blocks FB8 "USEND" and FB9 "URCV" for data exchange on the S7-300?
"STATUS = 27" (0x001B) with the loadable S7 communication on the S7-300
How do you program communication blocks FB14 "GET" and FB15 "PUT" for data exchange in the S7 program of an S7-300 CPU?
How do you program communication blocks FB12 "BSEND" and FB13 "BRCV" for data exchange in the S7 program of an S7-300 CPU?
Repeating the "BSEND" job (SFB12) when the "BRCV" block (SFB13) is in the "disabled" state ("EN_R = 0")
S7-400 CPU 41x -- Configuring and programming communication -- Using communication blocks
When using the FB81 S_MODB on an S7-400 with more than 8 Kbytes of marker, how do you access the marker area above MB 255?
How do you enable the ad-hoc mode when you call the TRCV instruction?
How do you use the blocks for MODBUS/TCP communication over the integrated PROFINET interface of the S7-300 and S7-400 CPUs and IM151-8 PN/DP CPU in STEP 7 Professional (TIA Portal)?
How do you establish a redundant MODBUS/TCP communication over the integrated PROFINET interface of a CPU 41x-H in STEP 7 V5.5?
What is the difference between the initialization and runtime parameters on the blocks for Modbus TCP?
Why is the status value A090 (hex) output for Modbus TCP although you have entered the correct license?
What are the differences between the licensed version and the downloadable demo version of the blocks for Modbus TCP?
Why is the value A083 (hex) output permanently at the STATUS output parameter of the block for Modbus TCP when the ENQ_ENR=true input parameter has been set?
Which blocks for Modbus TCP can you rename or re-wire when the block numbers of the Modbus blocks are already being used in the user program?
How can you read out diagnostics data from a SIRIUS 3RK3 modular safety system using a S7-300/400 CPU?
Which communication options are there in SIMATIC S7?
How does data communication work between S7-300/S7- 400 and S7-200 via MPI using S7 basic communication?
Consistent data in S7-400, summary of mechanisms
Which ports are released for Modbus/TCP communication and how many Modbus clients can communicate with a SIMATIC S7 CPU as Modbus server?
How do you implement chronological messaging with S7-400 CPUs and WinCC?
How do you configure a specified and an unspecified S7 connection for data exchange between S7-300 and/or S7-400 by way of Industrial Ethernet CPs?
How do you establish OPEN MODBUS / TCP communication from a SIMATIC S7 and where can you find further information?
How do you use WinCC flexible to transfer a project to an operator panel via S7 routing?
What restrictions are there for active jobs when communicating with SFC 58 / SFC 59 and SFB 52 / SFB 53 via PROFIBUS DP and PROFINET IO?
How do you program the communication blocks FB63 "TSEND", FB64 "TRECV", FB65 "TCON" and FB66 "TDISCON" in order to use the ISO-on-TCP protocol for data exchange by way of the integrated PROFINET interface of a CPU or by way of the CP443-1 Advanced?
How do you program the communication blocks FB63 "TSEND", FB64 "TRCV", FB65 "TCON" and FB66 "TDISCON" in order to use the TCP protocol for data exchange by means of the integrated PROFINET interface of an S7-300 or S7-400 CPU?
How do you program the communication blocks FB67 "TUSEND", FB68 "TURCV", FB65 "TCON" and FB66 "TDISCON" in order to use the UDP protocol for data exchange by means of the integrated PROFINET interface of a CPU?
How can you access consistent data without SFC14/15 as part of the process image?
How great is data consistency in the PUT and GET S7 communication functions for the individual S7-400 CPUs?
How do you program the communication blocks FB63 "TSEND", FB64 "TRECV", FB65 "TCON" and FB66 "TDISCON" in order to use the ISO-on-TCP protocol for data exchange by way of the integrated PROFINET interface of a CPU or by way of the CP443-1 Advanced?
Part number:

Description
You can use the open communication over Industrial Ethernet for data exchange by way of the integrated PROFINET interface of a CPU or by way of CP4431 Advanced, for example. The protocols below are supported for this:

  • TCP
  • ISO-on-TCP
  • UDP

The following communication blocks are available for open communication over Industrial Ethernet using ISO-on-TCP Protocol:

  • FB65 "TCON" for establishing the connection
  • FB66 "TDISCON" for ending the connection
  • FB63 "TSEND" for sending data
  • FB64 "TRECV" for receiving data

These communication blocks are available in the Standard Library -> Communication Blocks.
Copy the latest versions of the above-mentioned communication blocks from the standard library into your user program and then call them in your user program.
The connection parameters for establishing the ISO-on-TCP connection are saved in a data structure. In this example, the data structure UDT65 "TCON_PAR" is used, which is parameterized by the user. The ISO-on-TCP connection is not configured in NetPro.

Description of the sample program
The S7 program contains the call of the FB65 "TCON" and the data structure UDT65 "TCON_PAR" with the connection parameters for establishing the ISO-on-TCP connection. The S7 program also includes the call of the communication blocks FB63 "TSEND" and FB64 "TRECV" from the Standard Library -> Communication Blocks. The FB63 "TSEND" is for sending data to an S7 station or to an S5 station, to a PC station or to a third-party system. The FB64 "TRECV" is for receiving data from another S7 station or an S5 station, from a PC station or from a third-party system.

First create the hardware configuration for your S7-300 station. Configure Marker byte 10 as clock marker. The send request is triggered by this clock marker. Save and compile the hardware configuration of your S7-300 station and load it into the CPU.

The STEP 7 program consists of blocks OB100, OB1, FB400, DB400, FB420, UDT65 and FB63, FB64, FB65 and FB66.

OB100
The OB100 is a restart OB and is run when the CPU is restarted (warm start). In this OB the first communication trigger is enabled with marker M0.3.

OB1
OB1 is called cyclically. The FB400 is called in OB1 with the instance data block DB400 and marker M0.3 as INIT_COM parameter. The marker M0.3 is reset in OB1 after the FB400 has been called.


Fig. 01

FB400
The FB400 is called cyclically in OB1. The following function blocks are called in FB400:

  • FB420 "SET_ISO_PARAM"
  • FB65 "TCON",
  • FB63 "TSEND",
  • FB64 "TRECV",
  • FB66 "TDISCON"


Fig. 02

Using the input parameters of the function FB420 "SET_ISO_PARAM" you define the local and remote parameters of the ISO-on-TCP connection.
 
Input parameters Data type Description
ID Word Connection number
DEV_ID Byte B#16#0 for the CP443-1 Adv
B#16#1 for the IM151-8 PN/DP CPU or
B#16#2 for the CPU 31x-2PN/DP, IM154-8 CPU or
B#16#3 for the CPU 319-3PN/DP or
B#16#5 for the CPU 412-2 PN, CPU 414-3 PN/DP, CPU 416-3 PN/DP
ACTIVE Bool True = connection established actively
False = connection established passively
TSAP Struct Local TSAP in the CPU and remote TSAP of the communication partner
IP_ADDR1 Int IP address of the communication partner
IP_ADDR2 Int
IP_ADDR3 Int
IP_ADDR4 Int
Table 01

The input parameter "TSAP" of the Struct data type is structured as follows:
 
Parameter Data type Description
LOC_RACK_SLOT Byte

Define the LOC_RACK_SLOT parameter with the value B#16#0 if the local TSAP is not to be prefixed with the two bytes with the values 0xE0 (hex) and 0x02 (hex). In the case of CPUs that support the ASCII format for the TSAPs, then the first two bytes of the local TSAP must not be defined with the values 0xE0 and 0x02.

Define the LOC_RACK_SLOT parameter with the value B#16#0 if the local TSAP is not to be prefixed with the two bytes with the values 0xE0 (hex) and 0x02 (hex). This is necessary for CPUs that do not support the ASCII format for the TSAPs.

LOC_TSAP String
  • Local TSAP (connection end point)
  • The user-defined ASCII string has the following values: 'TCP-1'.
CP_RACK_SLOT Byte Specify the rack and slot of the CP when communication is made over a CP443-1 Advanced.
REM_RACK_SLOT Byte

Define the REM_RACK_SLOT parameter with the value B#16#0 if the TSAP in the communication partner is not to be prefixed with the two bytes with the values 0xE0 (hex) and 0x02 (hex). In the case of CPUs that support the ASCII format for the TSAPs, then the first two bytes of the local TSAP must not be defined with the values 0xE0 and 0x02.

Define the REM_RACK_SLOT parameter with the value B#16#2 if the TSAP in the communication partner is to be prefixed with two bytes with the values 0xE0 (hex) and 0x02 (hex). This is necessary for CPUs that do not support the ASCII format for the TSAPs.

REM_TSAP String
  • TSAP (connection end point) in the communication partner
  • The user-defined ASCII string has the following values: 'TCP-1'.
Table 02

The CPUs below support the ASCII format for the TSAPs.

  • CPU 314C-2 PN/DP
  • CPU 315-2 PN DP, CPU 317-2 PN/DP as from V3.1
  • CPU 319-3 PN/DP as from V2.7
  • CPU 414-3 PN DP, CPU 416-3 PN/DP as from V5.2
  • CPU 412-2 PN as from V6.0
  • IM 151-8 PN/DP CPU as from V2.7
  • IM 154-8 CPU as from V3.2

Define local TSAP and TSAP in the communication partner
In this case the following TSAPs (connection end points) are used.
 
  Local TSAP in the CPU Remote TSAP of the communication partner
Initial value (ASCII) TCP-1 TCP-1
Initial value (hex) E0.02.54.43.50.2D.31 54.43.50.2D.31
Table 03

In the interface parameterization of FB400, you change the value of the local and remote TSAP in accordance with your configuration (see Fig. 04). In the "T_TSAP" structure, for the "LOC_TSAP" and "REM_TSAP" parameters you enter the local and remote TSAP of your configuration as initial value.
If the first two bytes of the local TSAP in the CPU are to be defined with the values 0xE0 and 0x02, then you change the interface parameters of FB400. In the "T_TSAP" structure, you define the initial value "B#16#2" for the "LOC_RACK_SLOT" parameter.
If the first two bytes of the remote TSAP are to be defined with the values 0xE0 and 0x02, then you change the interface parameters of FB400. In the "T_TSAP" structure, you define the initial value "B#16#2" for the "LOC_RACK_SLOT" parameter.


Fig. 03

Define connection number
You can change the connection number separately. Change the connection number in network 2 of FB400 in accordance with your configuration. The connection number is stored in a static tag and so in the instance data block DB400.
The connection number "1" is defined in this example.


Fig. 04

Connection setup
Establishing a connection is started by a positive edge in the "REQ" input parameter of the FB65 "TCON". The data structure UDT65 "TCON_PAR" with the connection parameterization is incorporated in the instance data block of the FB400.
On the input parameter "CONNECT" of the FB65 "TCON", the memory area is specified that contains the connection parameterization.
The connection is set up at system start and remains until it is disabled with FB66 "TDISCON", or the CPU goes into STOP mode, or the power supply is switched off.


Fig. 05

The send request is triggered by a positive edge at the input parameter "REQ" of the FB63 "TSEND". The send job trigger is controlled by clock marker M10.6 and the "C1.SEND_BUSY" tag. If the send job is running, "C1.SEND_BUSY" is set. It is then not possible to trigger a new send request.
You specify the memory area that contains the data to be sent at the input parameter "DATA".
You enter the number of bytes to be sent at the input parameter "LEN".
The output parameters "DONE", "ERROR" and "STATUS" are required for job evaluation.


Fig. 06

If the send job is successfully completed, "C1.SEND_BUSY" is reset. A new send job can now be triggered.
If the send job is completed with an error, then "C1.SEND_BUSY" is likewise reset and the value of the output parameter "STATUS" of FB63 is saved for error analysis.


Fig. 07


Fig. 08

The data can be received as soon as the ISO-on-TCP connection is established.
At the input parameters "DATA" and "LEN" you specify the address and length of the data area where the received data is saved.


Fig. 09

The output parameter "NDR" is for showing that new data has been received. The "RECV_LEN" output parameter indicates the length of the data received.
If the data is received successfully, then the value of the "RECV_LEN" output parameter is saved.


Fig. 10 

If the data is not received successfully, then the value of the "STATUS" output parameter is saved and evaluated.


Fig. 11 

You can clear down the ISO-on-TCP connection with FB66 "TDISCON". You start the request to clear down the ISO-on-TCP connection with a positive edge on the "REQ" input parameter of FB66 "TDISCON".


Fig. 12 

The STEP 7 project as a download
The STEP 7 project contains a sample program for calling FB400 "TSEND_TRECV_ISO1" and the function blocks FB420 "SET_ISO_PARAM", FB65 "TCON", FB66 "TDISCON", FB63 "TSEND" and FB64 "TRECV" with status evaluation. It has been created with STEP 7 V5.4 SP5.

Sample_open_ISO.zip ( 52 KB )

Configuring additional ISO-on-TCP connections
To configure additional ISO-on-TCP connections you copy the FB400 so that you receive another function block (such as FB401). Change the parameters and generate a new instance data block.

Additional Information

  • Detailed information on open communication over Industrial Ethernet is available in the manual "System and Standard Functions for S7-300/400 Volume 1 and Volume 2" in Entry ID: 44240604.
  • Instructions for configuring an ISO-on-TCP connection for communication with S7-300 and S7-400 Industrial Ethernet CPs are available in Entry ID: 47885440.

 Entry ID:29737976   Date:2012-11-16 
I regard this article....as helpfulas not helpful                                 
mySupport
My Documentation Manager 
Newsletter 
CAx-Download-Manager 
Support Request
To this entry
Print
Create PDF 
Send to a friend
QuickLinks
Compatibility tool 
Topics
Help
Online Help
Guided Tour