deathwish88 / modbus-tk

Automatically exported from code.google.com/p/modbus-tk
Other
0 stars 0 forks source link

RTU modbus slave inner char time problems #13

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1.
I found a problem when using the library as the Modbus RTU Slave on baudrate 
9600bps. The library presents me the "Invalid CRC in request" when I send a 
FC16 cmd from WAGO I/O 750-841. Finaly the problem was the inner char timing -- 
one frame was received as the two separated ones.

What is the expected output? What do you see instead?

FC16 frame should be accepted as the FC16 frame not as two separated frames. 
This gives the CRC exception.

What version of the product are you using? On what operating system?
0.4

Please provide any additional information below.

See the code, the modbus_rtu.py, RtuServer class where the inner timing is 
calculated from the baudrate parameter (i.e. self._t0)

self._serial.interCharTimeout = 1.5 * self._t0
self._serial.timeout = 1.5 * self._t0

when I change it to

self._serial.interCharTimeout = 5 * self._t0
self._serial.timeout = 5 * self._t0

all works pretty well and the bug was fixed. Can you add some parameter to 
change the 1.5 constant?

Original issue reported on code.google.com by krakora....@googlemail.com on 23 Jul 2010 at 8:46

GoogleCodeExporter commented 8 years ago
I will make the 1.5 configurable

Original comment by luc.jean@gmail.com on 23 Jul 2010 at 8:50

GoogleCodeExporter commented 8 years ago
It is now configurable in the RtuMaster constructor. 

Please get svn rev 120 and verify that it works ok.
Best
luc

Original comment by luc.jean@gmail.com on 24 Jul 2010 at 2:14