Kepware Modbus TCP Server with multiple IP addresses
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Kepware Modbus TCP Server with multiple IP addresses
Hello,
I am currently in the process of converting SNMP data to Modbus TCP for a power monitoring server using Kepware. Since there are over 300 devices, each with 14 registers, I wanted to distribute the output across 3 different IP addresses.
For example: 192.168.22.124, 192.168.22.125, 192.168.22.126
Initially, I assigned all addresses to a single virtual network card. Since I encountered issues with this setup, I created additional virtual network cards to assign each address to a separate network adapter. Unfortunately, this did not change the following behavior.
The Kepware server and the monitoring client are running on the same virtual machine. The translation from SNMP to Modbus TCP works so far, but I have the problem that the values of the same IDs from different IPs overwrite each other.
In Kepware, I can see that, for example, 192.168.22.124/502/45 sometimes takes values from 192.168.22.125/502/45 or 192.168.22.126/502/45.
I can see values on 192.168.22.126/502/130, although only the IP 192.168.22.125 outputs IDs above 120. Is it possible to send on three different IPs and read it on the same machine?
- Labels:
-
Configuration
-
IoT Gateway
-
KEPServerEX
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Your issue likely arises because Kepware is treating all three IP addresses as a single logical device, causing register values to overwrite each other. To resolve this, create separate channels in Kepware for each IP, assign unique Device IDs, and consider using different Modbus TCP port numbers like 502, 503, 504 to avoid conflicts. Also, check Network Binding settings to ensure each IP is correctly assigned to a virtual adapter. If issues persist, verify that your monitoring client can distinguish between multiple Modbus sources properly.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hello AKshara,
Thank you for your support.
I have already created various channels, each assigned to the respective network adapter and IP address.
I have assigned the corresponding IP and a unique ID (for the channel) to each device. IDs duplicate across channels since there are over 300 devices. Unfortunately, I cannot set the ports for the channels independently. As soon as I change the port on one channel, I change it for all channels. The network bindings should be correctly set up.
Not only does the client show the mentioned switching values, but this can also be observed in the Quick-Client of Kepware.
I am using the "Modbus TCP/IP Ethernet" driver, should I perhaps choose a different driver?
It might also be important to mention that I am using Kepware on the same Windows Server where the client is running.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi, thank you for reaching out. I have a few questions about your set up, in this case you are using the KEPServerEx to act as an unsolicited device with IP address of 192.168.2.124, and the device id is showing 192.168.2.124.45, and 192.168.2.125.45 respectively, correct? If this is true, could you enumerate the Station IDs up to 46 for one of them?
Here is what I found on this in the driver docs:
"The device ID for a Modbus server device is specified as YYY.YYY.YYY.YYY.XXX. The YYY can either be the loopback address or the local IP address of the PC that is running the driver. The XXX designates the Modbus server's Station ID and can be in the range 0 to 255.
Multiple Modbus server devices can have the same Station ID. In this scenario, all the devices that share the Station ID point to one common simulated device. If the remote Modbus client requests data from a Modbus server device (Station ID) that does not exist, the response contains data from station 0. Once a Modbus server device is created in the project, that Modbus server is enabled and stays enabled until the server is shut down. Changing the Station ID enables a new Modbus server device that stays enabled until the server is shut down."
I understand you have 300 devices, so the 0-255 station ID's may be an issue for you, so some of the devices may need to store the data into different memory locations, but this is due to a Modbus protocol limitation. "One byte station IDs."
Let me know it this helps you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hello and thank you for the feedback.
Yes, that's exactly how I use it. I could increase the ID to 46, and this would probably solve the problem. The issue here is that there are currently around 300 SNMP devices that need to convert data into Modbus via the LinkTag. The number will likely at least double in the future. I understand that instead of using 2 devices with 14 registers, I could create 1 device with 28 registers or even more. However, this would again cause problems on the client side with the driver, as the registers for devices would then be different. If this is the only solution, I would have to try to implement it.
I had hoped that since I assign a separate IP for each channel, only the corresponding data of the channel would be output, but the channels can still overwrite each other, right?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Thank you for the follow up, correct when the driver acts in an unsolicited manner the Modbus memory map is allocated on startup per station ID AKA Slave node ID, and at this time the driver uses a one-byte station ID,
If you do need the server to support a two-byte station ID in unsolicited mode, 0-65535 possible nodes it would require an enhancement request.
Or it could be a better use case to reproduce the Modbus TCP protocol in the Universal device driver.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
I have now rebuilt everything and am writing in 18 groups, each with the same IP and ID addresses, but always different registers.
I initially tested this with 2 groups and there were no problems. Now I have implemented the remaining 16 groups and the Modbus registers of all 18 groups only write '0'. Could this be related, or could something else be the reason?
Additionally, the license was finally activated today, so the server is now running without time limitation.
I hope this is not related to my problem.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
I can have a look at your issue, could you open a support ticket so that we can pass files?
