Today, most modern control systems consist of a variety of hardware and field devices using a range of communication protocols, which means multiple methods are needed to ensure seamless communication between the distributed control system (DCS) and these field devices.
In two recent blog posts we explored how to integrate PROFINET devices into PCS 7 and S7 PLCs into PCS 7, now we will focus on how to integrate Modbus TCP/IP devices into PCS 7 by communicating directly with the PLC via Modbus TCP/IP (which is just one of several integration options available). The content in this post will likely be most helpful for instances where you need the main DCS to communicate with equipment provided by an OEM such as a boiler, chiller, or air compressor.
To start, it is important to know that there are two different Modbus/TCP communications libraries Siemens maintains. The Modbus TCP/IP library is a great option for working with standard Modbus TCP/IP-compatible devices while the Open Modbus/TCP library is a good choice if you are working with advanced, non-standard Modbus implementations. In this post, we will discuss using the Modbus TCP/IP library and will reference devices that use onboard ports rather than an in-rack communication processor (CP) card.
Two of the first things you need to identify include if you will use one of the onboard PROFINET ports or an in-rack CP-443 card, and if you have a redundant automation system (AS) or a simplex AS, as there are different configurations to implement depending on the system architecture. Our licensing scheme in this example allows for redundant Modbus TCP/IP connections on both the server and client, allowing us to communicate between redundant PCS 7 controllers and Modbus TCP/IP servers.
Additionally, before you can start integrating your Modbus TCP/IP devices with your PCS 7 system, be sure you have the following information readily available:
Also, here is some information to consider regarding the maximum number of devices and jobs that are supported in PCS 7:
To get started, the Modbus/TCP wizard first needs to be installed separately from the standard PCS 7 install media. The Modbus/TCP wizard can be found on the Siemens site here.
Below, we take you through a detailed configuration example for a duplex (redundant) PROFINET TCP Modbus communication system. Note that our hardware example does not have a CP card on the controller so we will use the PROFINET form of the Modbus/TCP communication and licensing. We have chosen the X8 ports on each controller for redundant Modbus/TCP communication. Also, we are the Modbus client in this scenario so we can read/write to the Modbus server, which is a different PLC.
With our communication methods selected and redundancy decided, we can move on to the Wizard.
1. Initial screen
2. Product selection screen
We chose “SIMATIC Modbus/TCP PN Red” since we are using redundant Modbus/TCP via PROFINET. If you were using either simplex or a CP card, one of the other options should be chosen.
3. Create the parameter data block
4. Select the blocks folder of the project
5. Upload connections
Since we already have some Modbus/TCP connections created for this project, several connections are already visible. If you do not have connections created, you would continue with a new connection. We will review the connection on ID 6/7.
6. Select the Modbus general parameters
We are a Modbus client and we want to connect to the Modbus server at startup. Single write is left unchecked in this example.
7. Enter the properties of the communication partner
Our Modbus server (i.e. device A) is not redundant, but we do have redundant controllers, so we will select the first option, “S7 is redundant.” The “Used interface” is the 410-5H CPU X8 port as we discussed earlier. An ID number and connection name will need to be assigned. The remote IP and remote port are the IP address and port of the Modbus server and will be identical on both connections in our example.
8. Identify and define the Modbus addresses
In this example, we are only using registers to transfer data; any bits that need to be transferred are packed into a register. The maximum length of a Modbus read register is 125 and 123 for write register. We have designated Jobs 1, 2, 7, and 8 as read registers. We have designated jobs 3, 4, 5, and 6 as write registers.
Some Modbus servers/clients will have an offset of 1 between the register number and the actual data address location; the end device offset should be checked to see if the data addresses differ. The register range of 7000 is short for register 47,000, which is the arbitrary start range selected by the Modbus server PLC (in this case it was a specific range reserved for communication by the customer). CFC data collector is selected, and we will use the CFC to set up the Job_List and Modbus communication block later on.
9. Create your Modbus parameter DB
We created DB2.
10. Review your connections
The overview screen lets you see what connections will be made. Press “Next” to create your DB parameter block.
11. Review the compilation report
Once the data block is created, it will give a compilation report. The checkbox to license the Modbus block can be selected for licensing.
12. License the Modbus Block
The Modbus license block must first be downloaded from the Modbus/TCP library, then installed into the PCS 7 project. Download it to the controller. The license code will be written into the CPU0 (not the SEC card) when the controller is online.
13. Send the screenshot you receive, like the one below, to Siemens support to assign a registry key.
Once successfully licensed, you can move on to configure the Job_List and Modbus/TCP communication CFC blocks.
14. Configuring the Job_List and Modbus Blocks
The next step is to place the Job_List block and MB_PNHCL blocks down from the Modbus/TCP library and interconnect them. The Job data, start, length, and read/write information must be configured for each job and should match the registers assigned in the wizard.
Below are some additional resources that may be helpful when configuring Modbus/TCP communication to PCS 7:
If you run into issues when configuring your Modbus TCP/IP communication with PCS 7, here are some troubleshooting tips based on what we commonly see:
As a certified Siemens Solutions Partner, we are well-qualified to help you integrate the latest Modbus TCP/IP devices into your PCS 7 system. Contact us today to see how we can partner with you to develop customized solutions designed to optimize performance and efficiency.