Hi,
I'm using libmodbus on a custom board with the following characteristics:
- ARM9 processor, 400MHz 256MB RAM
- Linux version: Linux imx28evk 2.6.35.3-maintain+gb3912bb #2 PREEMPT Mon Mar 20 09:11:16 GMT 2017 armv5tejl GNU/Linux
- libmodbus (3.1.4) dynamically linked to a Qt application
I've been noticing so far a delay in each single modbus operation. I measure the time using Linux clock, and the time between each call appears to be up to 60 ms, and sometimes 80.
The application gets blocked for such long time, that's sounds me very odd.
If I set the timeout to 10ms the functions exit with timeout error or invalid data.
A timeout which seems good for an error free communication is 100ms at the moment.
The code doesn't do anything than write 2 registers in an infinite loop, I get the Linux time before and after the write call and subtract the millisecs.
I know libmodbus is quite popular and I also used it in the past without these timing issues.
I can confirm that it's not related to the slave because the same slave reply quicker with other applications. I simulated a slave on my PC and I gets the same timing, and libmodbus is successfully used on a PC application and communicates with the slave without any problem, so the issue is definitely on the board side.
I'd like to know if there are known timing issues related to specific architectures, hardware, Qt environment, and so on.
Has anyone got any idea?
Thank you very much,
Alessandro