Modbus I/O Server: Can't Communicate Between Master and Slave VI

Updated Sep 23, 2024

Issue Details

  • I have tried running my master and slave VIs on the same computer and on different computers, but I cannot communicate between them. There are no errors, but there is no communication between them.
  • I have a Modbus TCP Slave I/O Server implemented on my PC that I am trying to access from a third-party Modbus Master. Even though I can see the shared variables of my Slave I/O Server changing their values in the NI Distributed System Manager, the master cannot access the data. No errors are displayed, but communication is not established between them. 

Solution

The most common issues we run into when this occurs is when the Modbus ports are already being utilized by another program (or another deployed shared library) or the Windows Firewall configuration is blocking the communication. Most standard Modbus protocols utilize Port 502. To solve the issue, you can try the following:
  • Review your firewall configuration and make sure there are no rules blocking incoming communication on TCP Port 502. If necessary, create an exception in the firewall configuration. Refer to the instructions listed in Configure firewall rules with group policy, for more information. 
  • Each time you deploy a Modbus I/O Server it remains running in the background regardless of if you close your vi or project. In order to open up the TCP port for your current Modbus I/O Server you are trying to deploy you'll need to close any previously running servers.
1. You can see which Modbus I/O Servers and/or Shared Libraries that are deployed by using the NI Distributed System Manager.



2. Select the previously deployed Modbus I/O Server and click Stop Process.


 

Additional Information

Any deployed Shared library and/or Modbus I/O Server that you deploy remains running in the background regardless if the project/VI is up and running or not. If you have multiple Shared Libraries or Modbus I/O servers running, only the first deployment will establish proper communication if they are both targeting the same port.