EtherCAT to Modbus Gateway Using Modbus Slave to Simulate Slave Station Configuration Example

Publisher:epsilon15Latest update time:2024-03-29 Source: elecfans Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

Xingda E-control EtherCAT to Modbus Gateway can be used as a configuration for Modbus slaves. The EtherCAT to Modbus Gateway allows the Modbus protocol to be converted to EtherCAT, achieving interoperability between different communication systems. By configuring the Modbus from the slave to the gateway, you can access and control Modbus devices. At the same time, the gateway can also expand the scope of the Modbus network, allowing more devices to be connected to the network.
image.png

1. The specific configuration steps of the gateway as a MODBUS slave are as follows:

1. Use a network cable to connect your computer to the LAN network port of the gateway.

2. Set the eighth position of the switch to ON to enable the gateway to be configured. Then turn on the power of the gateway.

Open GW Modbus Builder, select Modbus Configuration, and click OK to enter the settings screen.
image.png

4. Double-click "Modbus Master" in the device list on the right side of the software to add a virtual master to the project. After adding, you can see the master in the project tree on the left side of the software, as shown below:
image.png

5. Double-click Modbus Slave in the device list on the right side of the software to add the slave's Modbus to the master. After adding, you can see all stations in the Modbus bus in the main window of the software, as shown below:
image.png

6. Since the gateway to be configured is a Modbus slave, only one slave can be added.

7. Double-click the "Modbus Master" icon in the main window to pop up the Modbus parameter setting window. In this window, users can set the Modbus operating parameters, as shown in the figure below
image.png

8. Double-click Modbus Slave in the main window to set the slave address. When the gateway operates as a slave Modbus station, you only need to change the station address and do not need to configure the data packet. The read data area (3xxxx area) and write data area (4xxxx area) of the gateway Modbus are sorted starting from address 0.

9. After configuring the Modbus data packet, you can download the configuration to the gateway. Before downloading the configuration, the eighth position of the DIP switch needs to be set to ON. The PC is connected to the LAN port of the gateway via an Ethernet cable.

10. Click the menu bar "Settings-Communication Settings-Ethernet Settings" to download the network port settings, as shown below. Note: The network adapter indicates the IP address of the computer used by the user, and the IP address of the device must be in the same network

11. If the user needs to change the IP address of the gateway LAN port, please click "Settings-Communication Settings-Modify Device IP" on the menu bar to download the network port settings, as shown in the figure below.
image.png

12. The user clicks "Tool Download" and waits for the "Status" bar below the software to reach 100%, indicating that the download is complete.
image.png

2. Start the Modbus slave of the gateway

(1) The first dip position of the gateway is set to OFF, indicating that the gateway operates as a slave Modbus station.

(2) Switch the 8th position of the gateway DIP switch to OFF. Then turn on the gateway power again. The gateway is in operation.

(3) Run the ETHERCAT master software and then click Restart TwinCAT (Config Mode) to run the ETHERCAT master software.

(4) Modbus Poll software is used as the master station and connected to the RTU terminal of the gateway for testing.

Click "Connect--Connect..." in the software menu bar, set the correct port number, and then click "OK" to start running. As shown below:
image.png

Click the "Settings - Read/Write Definition" menu bar in the software to set the data area that the master station wants to access. Note that the Slave ID is selected as 2, as shown below:
image.png

(7) On the ETHERCAT master software, click the first output in the project tree on the left. In the main window, right-click the data and select "Online Write" to modify the real-time data value.
image.png

The first word of the output data is assigned a value of 1 (control word = 1), and MODBUS-RTU starts communicating.
image.png

(8) Test data:

The gateway gets data from the Modbus master and stores it in the 4xxxx area. We use the Modbus polling software to manually modify the value of the 4xxxx register, as shown in the following figure:
image.png

The data uploaded for the first time can be monitored in the TWINCAT software and the data modification is successful.
image.png

Manually modify the output data value on the TWINCAT software, as shown below: image.png

This can be monitored in the 3xxx part of the Modbus Poll software and the data has been read successfully.
image.png

3. Configure the input and output length of the gateway

(1) Use a network cable to connect your computer to the EtherCAT network port of the gateway.

(2) Switch the eighth position of the DIP switch to ON to enable the gateway to be configured. Then turn on the power of the gateway.

(3) When the gateway is in configuration state, the IP address of the network port is 192.168.1.201, and the computer's IP segment should be set to 192.168.1.xxx.

(4) Open the GW Modbus software, first set the IP address used by the software, click the menu bar "Settings-Communication Settings-Ethernet Settings", as shown in the figure below, the computer's IP is 192.168.1.111. (No need to set the device IP address and configure the module address.)
image.png

(5) Click "Tools-Online" in the menu bar and select "EtherCAT Configuration" in the pop-up window.
image.png

(6) Click the "Connect to Slave" button. Once the connection is successful, the other buttons will become clickable:
image.png

(7) After clicking the "Read Configuration" button, the actual data length configuration of the gateway is displayed:
image.png

(8) Fill in the input and output data length required by the user. Note that the data length is cumulative. Click "Write Configuration".
image.png

(9) After writing successfully, the "OK" dialog box will pop up.
image.png

(10) After the setting is completed, turn the 8th position of the gateway dial to "OFF" and power on the gateway again.
image.png

EtherCAT to Modbus gateway plays an important role in the field of industrial automation , simplifying system integration and improving communication efficiency. The above is the configuration of EtherCAT to Modbus gateway as a Modbus slave.


Reference address:EtherCAT to Modbus Gateway Using Modbus Slave to Simulate Slave Station Configuration Example

Previous article:EtherCAT to Modbus Gateway as MODBUS Slave Configuration Example
Next article:Compatibility design of distributed system communication network based on Modbus protocol and PLC devices

Recommended ReadingLatest update time:2024-11-16 11:26

Siemens SMARTP implements one master and multiple slaves via MODBUS RTU
When programming with SMART PLC, you will often encounter the need to transmit data from multiple RTU slaves. The master station of SMART PLC receives data transmitted from multiple slaves and displays it synchronously. In this case, the first thing to consider is the device address of the slave device. N
[Embedded]
Siemens SMARTP implements one master and multiple slaves via MODBUS RTU
Latest Embedded Articles
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号