This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Problems with Modbus Communication with HMI

Other Parts Discussed in Thread: MSP430F5438A

Hi, I am using MSP430F5438A as a controller and a Schneider HMI GXO3502 for modbus RTU communication.

I am using Modbus Poll and Modbus Slave softwares for simulation.

I have used RS485 at the controller side and RS232 at the HMI side with a converter in between.

The communication between the controller(Slave) and the PC Software(Modbus Poll Master) works without errors.

Similarly the communication between the HMI(Master) and the PC Software(Modbus Slave) also works without errors.

However when I communicate the Controller(Slave) with the HMI(Master), I am getting a PLC Timeout error on the HMI and the communication halts for some milliseconds before getting restored again. The settings throughout the Simulation softwares, Controller and HMI are 9600-8-Even-1. 

I have tried increasing the controller timeout as well as increasing the HMI transmit time and HMI receive timeout period.

I am using a script which runs every 1 second to write RTC values from HMI to controller. Other than that the HMI sends a read command(0x03) for every element present on the current screen. Thus, there are two functions read and write sent one after the other. 

I would like to know what else I need to try out to make the communication between the HMI and the controller work.

Thanks,

Tanmay Gadekar

  • I would recommend you install a drop off your RS485 and hook that up to your PC to spy on the communications. Use HyperTerminal or RealTerm on the PC. Analyze the bytes that are going pass. Is the command message correct including checksum? Did the slave respond at all?
  • I think that the slave was slow. Because when I read 40 addresses from the master instead of all 125 registers(func code 0x03), the code seemed to work without errors.
  • I don't know if you checked this already, but...

    Is the slave slow or is the master that is slow? What if the slave is sending the response message with 125 register values but the master's receive buffer is overflowing - so the checksum for the message received would be incorrect? If you haven't checked already, check if the master is getting any bytes and if the buffer overflowed.

**Attention** This is a public forum