Introduction
This article aims to help users troubleshoot communication issues between a Windows PC and a local Modbus server, specifically when using external client devices. The Windows PC runs two server applications: one BACnet SCADA server using port 47808 UDP, and the other Modbus 0 TCP server using port 502 TCP.
Understanding Modbus Communication
Modbus is a communication protocol used to exchange data between devices. It is widely used in industrial automation and process control applications. Modbus communication is typically divided into two types: Modbus RTU (Remote Terminal Unit) and Modbus TCP/IP. In this article, we will focus on Modbus TCP/IP.
Checking Server Status
Before troubleshooting, ensure both servers are running and listening on their respective ports. Use the following commands in the Command Prompt:
netstat -ano | findstr :47808
netstat -ano | findstr :502
The output should indicate that both servers are listening on their respective ports. If not, start the servers and check for any errors in the event log.
Configuring Firewall
Firewall settings may prevent the Modbus server from communicating with the external client device. Ensure that both the BACnet SCADA server and the Modbus server are added as exceptions in the Windows Firewall.
Verifying Modbus Slave ID
Make sure the Modbus slave ID on the client device matches the ID configured on the Modbus server. The ID can be found in the server configuration file or by querying the server using a Modbus scanner tool.
Checking Network Connection
Check the network connection between the client device and the Windows PC. Use a network scanner tool to ensure that both devices are on the same network and can communicate with each other.
Testing Modbus Communication
Use a Modbus communication tool, such as Modbus TCP/IP Driver for NI-VISA or Modbus Poller, to test communication between the client device and the Modbus server. The tool should be able to establish a connection and read/write data to the server.
Resolving Common Issues
- Modbus server not responding: Check the server logs for any errors, ensure the server is running and listening on the correct port, and verify the network connection.
- Modbus client cannot connect: Check the firewall settings, ensure the client device is on the same network as the server, and verify the Modbus slave ID.
References
1. Modbus Organization. (n.d.). Modbus Application Protocol V1.1. Retrieved October 13, 2021, from https://modbus.org/docs/Modbus_Application_Protocol_V1.1.pdf
2. Microsoft. (n.d.). netstat. Retrieved October 13, 2021, from https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/netstat