Cookies are important for this site to function properly, to guarantee your safety, and to provide you with the best experience. By clicking OK, you accept all cookies. For more information, please access our Privacy Policy.
Table of Contents
Tutorials / 
Integrating EtherNet/IP Field Devices with Siemens PLCs
Intermediate

Integrating EtherNet/IP Field Devices with Siemens PLCs

Siemens
TIA Portal
Industrial Networking
PLC Programming
HMI Development

Introduction

PROFINET takes the lead as the most widely installed Ethernet-based fieldbus, with EtherNet/IP following closely. EtherNet/IP is notably prominent in numerous regions across the world. EtherNet/IP field devices are not inherently compatible with Siemens PLCs.

This tutorial explores how EtherNet/IP field devices can still function with Siemens PLCs, including the S7-1200 and S7-1500 series. The S7-1200 and the ET200SP MF function as EtherNet/IP field devices, with the S7-1500 responsible for handling them. In a different tutorial, we've covered working with PROFINET devices such as Servo Motors on TIA Portal.

The components of an EtherNet/IP network are the Scanner and the Adapter. Scanners, engaged in network monitoring, gather data like sensor readings from various field devices. These field devices are called Adapters.

Figure 1.1: Ethernet/IP and Siemens PLC connectivity - Application example overview
Figure 1.1: Ethernet/IP and Siemens PLC connectivity - Application example overview

Prerequisites

What you will need to follow along with this tutorial:

Principle of Operation

Using a TCP connection, the Scanner initiates the communication process. After associating the Scanner with Adapters, a transport connection is arranged for each Adapter. Upon success, the connection activates, and UDP datagrams facilitate data transfer.

Figure 2.1: Ethernet/IP and Siemens PLC connectivity - Operation principle
Figure 2.1: Ethernet/IP and Siemens PLC connectivity - Operation principle

Technical Setup

Launch the TIA Portal software. Begin by setting up a fresh project and continue by configuring the hardware required for your application example.

Figure 3.1: Ethernet/IP and Siemens PLC connectivity - Hardware configuration
Figure 3.1: Ethernet/IP and Siemens PLC connectivity - Hardware configuration

Download the 'Ethernet IP Scanner' library. Navigate to the 'Libraries' task card on the right, expand 'Global Libraries,' and use the 'Open Global Library' icon to load it.

Figure 3.2: Ethernet/IP and Siemens PLC connectivity - Importing the ‘Ethernet IP Scanner’ library
Figure 3.2: Ethernet/IP and Siemens PLC connectivity - Importing the ‘Ethernet IP Scanner’ library

Once the 'Ethernet IP Scanner' library is added, place the related function block and data types into their proper folders in Siemens controllers.

Figure 3.3: Ethernet/IP and Siemens PLC connectivity - Implementing ‘Ethernet IP Scanner’ library into the project
Figure 3.3: Ethernet/IP and Siemens PLC connectivity - Implementing ‘Ethernet IP Scanner’ library into the project

Also, consider creating a Cyclic Interrupt OB (OB30) for your project.

Figure 3.4: Ethernet/IP and Siemens PLC connectivity - Creating a cyclic interrupt OB
Figure 3.4: Ethernet/IP and Siemens PLC connectivity - Creating a cyclic interrupt OB

Once the Cyclic Interrupt OB opens in the editor, insert the 'Ethernet IP Scanner' function block into network 1. TIA Portal will prompt you to create an instance DB (data block). Choose a preferred name for the DB and confirm by clicking ok.

Figure 3.5: Ethernet/IP and Siemens PLC connectivity - Inserting the ‘Ethernet IP Scanner’ FB into the OB
Figure 3.5: Ethernet/IP and Siemens PLC connectivity - Inserting the ‘Ethernet IP Scanner’ FB into the OB

Choose the interface you plan to use and assign it as the parameter for the block.

Figure 3.6: Ethernet/IP and Siemens PLC connectivity - Interface selection and assignment
Figure 3.6: Ethernet/IP and Siemens PLC connectivity - Interface selection and assignment

The Scanner requires specific details to understand which Adapters fall within its range. This data includes Adapter addressing, the intervals at which Inputs and Outputs are updated, and the amount of data to transfer.

No graphical method is available in the TIA Portal for configuring inputs and outputs of the EtherNet/IP. Configuration for the 'Ethernet IP Scanner' function block is provided through an Adapter descriptions array. A global DB is the optimal place to keep descriptions.

Figure 3.7: Ethernet/IP and Siemens PLC connectivity - Creating a global DB for keeping adapter descriptions
Figure 3.7: Ethernet/IP and Siemens PLC connectivity - Creating a global DB for keeping adapter descriptions

The 'Ethernet IP Adapter Configuration' type array within the created global data block includes all the crucial information for the 'Ethernet IP Scanner' function block to work correctly.

Figure 3.8: Ethernet/IP and Siemens PLC connectivity - Ethernet IP adapter configuration array
Figure 3.8: Ethernet/IP and Siemens PLC connectivity - Ethernet IP adapter configuration array

It holds essential addressing details. Among these is the IPv4 address where the Adapter is accessible. Your first configuration task involves setting up the ET200SP MF Adapter.

Figure 3.9: Ethernet/IP and Siemens PLC connectivity - Inserting the ET200SP IP address into the global DB
Figure 3.9: Ethernet/IP and Siemens PLC connectivity - Inserting the ET200SP IP address into the global DB

Extra information is essential and will be drawn from the provided Electronic Data Sheet (EDS). ODVA has standardized the EDS file format, designed in text form and readable by humans. Several groups of information, referred to as segments, are marked by square brackets and labeled with their respective names. In the following, you will learn which sections are needed for the 'Ethernet IP Scanner' function block and must be included in the Adapter description. The second Adapter will be handled using the same method.

Figure 3.10: Ethernet/IP and Siemens PLC connectivity - ET200SP EDS file
Figure 3.10: Ethernet/IP and Siemens PLC connectivity - ET200SP EDS file

Details in the Device section help confirm the actual device matches the one set in the configuration. The device remains inactive if any mismatch is found before starting the operation. ODVA assigns the vendor identifier, labeled 'VendCode' in the EDS file, to identify the device manufacturer. The 'ProdType' in the EDS file represents a standardized numeric code identifying the device category. The 'ProdCode' number in the EDS file helps to uniquely recognize the device, its category, and its vendor ID. Ensuring compatibility involves checking both the major revision and minor revision numbers together.

Figure 3.11: Ethernet/IP and Siemens PLC connectivity - Device section of the ET200SP EDS file
Figure 3.11: Ethernet/IP and Siemens PLC connectivity - Device section of the ET200SP EDS file

Insert the specified data into the configuration within the global data block for this application example.

Figure 3.12: Ethernet/IP and Siemens PLC connectivity - Inserting the device section data into the global DB
Figure 3.12: Ethernet/IP and Siemens PLC connectivity - Inserting the device section data into the global DB

Other configuration parameters for the global data block, such as update intervals and input/output sizes, are in the 'Params' section of the EDS file. The update rate in microseconds is identified by the acronym RPI, standing for Requested Packet Interval. The range of update times for this device extends from 2ms (2.000µs) to 20s (20.000.000µs), and it defaults to 10ms (10.000µs). The EDS file also includes a vital parameter of the output data size in bytes. Valid sizes are between 0 and 246 Bytes, while the default value is the highest size available.

Figure 3.13: Ethernet/IP and Siemens PLC connectivity - Update intervals and output data size in EDS file
Figure 3.13: Ethernet/IP and Siemens PLC connectivity - Update intervals and output data size in EDS file

Scroll down to the 'Params' section to gather additional details such as input and configuration data sizes. The allowable range for input data size is from 0 to 500 Bytes. Since the configuration might not be present, the minimum size for the configuration data is not specified. Its maximum limit is 1 Byte.

Figure 3.14: Ethernet/IP and Siemens PLC connectivity - Input and configuration data sizes in EDS file
Figure 3.14: Ethernet/IP and Siemens PLC connectivity - Input and configuration data sizes in EDS file

Input the selected values into the designated fields within the global data block's Adapter description.

Figure 3.15: Ethernet/IP and Siemens PLC connectivity - Inserting RPI, input, output, and configuration sizes in the global DB
Figure 3.15: Ethernet/IP and Siemens PLC connectivity - Inserting RPI, input, output, and configuration sizes in the global DB

You must set up three crucial settings (assembly IDs) before enabling communication between the 'Ethernet IP Scanner' function block and the ET200SP. This information is presented mysteriously within the EDS file's 'Connection Manager' section.

Figure 3.16: Ethernet/IP and Siemens PLC connectivity - Locating assembly IDs in EDS file
Figure 3.16: Ethernet/IP and Siemens PLC connectivity - Locating assembly IDs in EDS file

These assembly IDs are ready to be loaded into the global data block of the Adapter.

Figure 3.17: Ethernet/IP and Siemens PLC connectivity - Inserting assembly IDs in the global DB
Figure 3.17: Ethernet/IP and Siemens PLC connectivity - Inserting assembly IDs in the global DB

Verify that your global data block holds a minimum of two variables. Stored within the 'Adapters' variable is the freshly created ET200SP description. Data zones for Adapter exchange are kept in the 'Datas' variable.

Figure 3.18: Ethernet/IP and Siemens PLC connectivity - Variables of the ET200SP adapter
Figure 3.18: Ethernet/IP and Siemens PLC connectivity - Variables of the ET200SP adapter

Expand the 'Adapters' variable to fit two units. Verify your input.

Figure 3.19: Ethernet/IP and Siemens PLC connectivity - Expanding the adapters variable to fit two units
Figure 3.19: Ethernet/IP and Siemens PLC connectivity - Expanding the adapters variable to fit two units

You will get a separate record for the second Adapter.

Figure 3.20: Ethernet/IP and Siemens PLC connectivity - Created record of the ET200SP adapter
Figure 3.20: Ethernet/IP and Siemens PLC connectivity - Created record of the ET200SP adapter

Fill in the second Adapter's IP address designated for the S7-1200 PLC.

Figure 3.21: Ethernet/IP and Siemens PLC connectivity - Inserting the S7-1200 IP address to the global DB
Figure 3.21: Ethernet/IP and Siemens PLC connectivity - Inserting the S7-1200 IP address to the global DB

Use a text editor like Notepad to open the second Adapter's EDS file and record the vital data from the different segments.

Figure 3.22: Ethernet/IP and Siemens PLC connectivity - Essential data of the S7-1200 EDS file
Figure 3.22: Ethernet/IP and Siemens PLC connectivity - Essential data of the S7-1200 EDS file

Insert the recorded details into the global data block.

Figure 3.23: Ethernet/IP and Siemens PLC connectivity - Inserting the essential data of the S7-1200 EDS file into the global DB
Figure 3.23: Ethernet/IP and Siemens PLC connectivity - Inserting the essential data of the S7-1200 EDS file into the global DB

Designate the variables to their matching parameters in the 'Ethernet IP Scanner' function block. The 'Ethernet IP Scanner' function block has been adjusted to include only the fundamental parameters.

Figure 3.24: Ethernet/IP and Siemens PLC connectivity - Configuring the ‘Ethernet IP Scanner’ function block
Figure 3.24: Ethernet/IP and Siemens PLC connectivity - Configuring the ‘Ethernet IP Scanner’ function block

Transfer the compiled program to the PLC, and if it is needed, change its status to run Mode. Once this process is complete, the PLC should operate and run the 'Ethernet IP Scanner' function block on a regular interrupt cycle (cyclic interrupt). A cyclic interrupt ensures the execution happens at specific intervals, keeping update rates consistent and jitter low.

Figure 3.25: Ethernet/IP and Siemens PLC connectivity - Compiling and downloading the program to the PLC
Figure 3.25: Ethernet/IP and Siemens PLC connectivity - Compiling and downloading the program to the PLC

Executing and Performing

Generate a new watch table and configure it with the parameters you want to monitor in real-time mode.

Figure 4.1: Ethernet/IP and Siemens PLC connectivity - Creating a watch table
Figure 4.1: Ethernet/IP and Siemens PLC connectivity - Creating a watch table

Bring the watch table online for real-time value observation and modification.

Figure 4.2: Ethernet/IP and Siemens PLC connectivity - Bringing the watch table online
Figure 4.2: Ethernet/IP and Siemens PLC connectivity - Bringing the watch table online

To activate the 'Enable' variable, set it to 'TRUE' by entering 'TRUE' or '1' in the 'Modify value' field or right-click to access the context menu and command from there.

Figure 4.3: Ethernet/IP and Siemens PLC connectivity - Activating the ‘Ethernet IP Scanner’ function block
Figure 4.3: Ethernet/IP and Siemens PLC connectivity - Activating the ‘Ethernet IP Scanner’ function block

Consequently, the 'Ethernet IP Scanner' function block initiates communication with the specified Adapters, beginning the data transfer process. The 'Ethernet IP Scanner' has a status of 16#7002, which points to it being busy, and the proper flags have been set accordingly.

Figure 4.4: Ethernet/IP and Siemens PLC connectivity - Activation status of the ‘Ethernet IP Scanner’ function block
Figure 4.4: Ethernet/IP and Siemens PLC connectivity - Activation status of the ‘Ethernet IP Scanner’ function block

For each Adapter, update the output and supervise the incoming input data.

Figure 4.5: Ethernet/IP and Siemens PLC connectivity - Controlling and monitoring of the adapter descriptions
Figure 4.5: Ethernet/IP and Siemens PLC connectivity - Controlling and monitoring of the adapter descriptions

If you want to deactivate the 'Ethernet IP Scanner' function block, change the 'Enable' parameter to 'FALSE'. It leads to the freezing of input values and cessation of updates. The 'Ethernet IP Scanner' function block terminates connections to every configured Adapter.

Figure 4.6: Ethernet/IP and Siemens PLC connectivity - Deactivating the ‘Ethernet IP Scanner’ function block
Figure 4.6: Ethernet/IP and Siemens PLC connectivity - Deactivating the ‘Ethernet IP Scanner’ function block

Conclusion

In conclusion, you learned how to integrate EtherNet/IP field devices with Siemens PLCs, specifically the S7-1200 and S7-1500 series. This tutorial guided you through the setup process, including configuring the 'Ethernet IP Scanner' function block and managing Adapter descriptions using the Electronic Data Sheet (EDS) format. You also learned how to adjust critical parameters such as assembly IDs, update intervals, and data sizes to ensure smooth communication between the Scanner and Adapters. Finally, you gained insights into monitoring and managing the real-time communication process and how to manage the activation and deactivation of the 'Ethernet IP Scanner' function block to maintain operational efficiency.