I am working on a Modbus client in 'C'.
I don't have deep knowledge about Modbus, and I am facing an issue with the implementation.
The ReadCoil function code work fine but many times I get Request Timeout error. I have used the 'interframe_delay' = 10ms and 'request_timeout' = 2 sec as configuration parameters. I have tried multiple combinations of the above two config parameters, yet I am unable to find a solution. Also in the ReadCoil function I try to read approx 500 coils in one request. I tried reading with quantity = 1, yet the issue is observed sometimes.
Does this have anything to do with the slave device ?
Do we need to have same config for slave devices as well ?
Any suggestion on how I can tackle this problem ?