Open JODLatGit opened 1 year ago
Did another test instead of reading 16 registers I read only 2 but the execution time stays the same 2 sec . It seems that readHoldingRegisters cmd takes up 2 seconds ??
Another test learns me that apparently changing underneath the value from 2000 to 50 in the header file the readHoldingRegisters command response in 50ms instead of the 2000 !!?? // Modbus timeout [milliseconds] static const uint16_t ku16MBResponseTimeout = 50; ///< Modbus timeout [milliseconds] Seems that the readHoldingRegisters command isn't working properly !!! Took almost 1 day to solve it.
Another test learns me that apparently changing underneath the value from 2000 to 50 in the header file the readHoldingRegisters command response in 50ms instead of the 2000 !!?? // Modbus timeout [milliseconds] static const uint16_t ku16MBResponseTimeout = 50; ///< Modbus timeout [milliseconds] Seems that the readHoldingRegisters command isn't working properly !!! Took almost 1 day to solve it.
That is not a solution, but a workaround. Still, if your implementation is hit by the timeout, be it 2 or 0.05 seconds, then there is something wrong with your communication or modbus slave. please check the return value of readHoldingRegisters (). It should be 0 on success, but will be ku8MBResponseTimedOut (0xE2) in case of timeout.
I am using a Seneca Z-8NTC to readout NTC's resistors. I have seen that underneath commands:
The command readHoldingRegisters takes up 2 seconds ? It of course slows down the response time of my Controllino application .
The serial settings are :
// Init RS485 Controllino_RS485Init(19200); //NTC module Modbus1.begin(2, Serial3 );
Do I something wrong ? What can I do to let it response faster ? It is always almost exactly 2 seconds measured with the millis() function.
ModbusMaster version
[Version : 2.0.1]
Arduino IDE version
[Version : 1.8.19]
Arduino Hardware
[Controllino Max]