www.8devices.com
|
|
|
Page 1 of 1
|
[ 2 posts ] |
|
Libmodbus and select timeout problem
Author |
Message |
Darlard
Joined: 08 Oct 2014, 06:53 Posts: 4
|
Hi, i am developing a modbus master device on Carambola 2 eval which has to manage a slave board. I am using an FTDI 485 converter to connect to the slave board but i have lots of communication errors.
Problem is that i get a lot of timeout error from select() function.
Looking at 485 with a scope i could see that the slave is not compliant with Modbus specifications reagarding intra-frame delay. Baudrate is set 19200 but the slave sometimes replies with 500us delay and less, where it should be not less then ~2ms.
Seems like the reply arrives before the device enters select(). So i get timeout. More than 20% of the request gets no answer. This is frustrating because, with response timeout set at 500ms, this becomes a bottleneck.
If i simulate a slave via software and set a delay of ~80 ms, i get no errors and everything is fine. This is why i think the problem is with libmodbus being "slow".
Does anyone has suggestions? Have you ever experienced such errors?
Greetings!
|
08 Oct 2014, 07:43 |
|
|
karlp
Joined: 27 Aug 2013, 14:40 Posts: 10
|
You should really take this up with libmodbus. Depending on your rs485 adapter, and libmodbus, make sure you're not doing anything that involves userspace toggling of an RTS line for instance.
However, if you have a device that is replying that fast, at 19200 baud, then it's not just going to be you having problems, it's going to be thousands of other modbus masters. Often these devices have a configuration register that lets you modify the turnaround time / reply delay time / similar names. Definitely try and get the slave reconfigured!
|
15 Jan 2015, 10:54 |
|
|
|
Page 1 of 1
|
[ 2 posts ] |
|
Who is online |
Users browsing this forum: No registered users |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot post attachments in this forum
|
|