[Python-modules-team] Bug#763350: python-pymodbus, Reading from serial clients always reaches timeout

D.S. Ljungmark spider at aanstoot.se
Mon Sep 29 15:47:28 UTC 2014


Package: python-pymodbus
Version: 1.2.0-2


When using a ModbusSerialClient to read from serial terminal connected
units, each register read will take timeout seconds ( timeout as
specified when instansiating the class)

this is because the ModbusTransactionManager on line 64 of
transaction.py  reads a static 1024 bytes of data from the serial terminal.

This works fine on tcp as tcp recv will return a short read, only
containing the data. On a serial terminal, this will result in a stall
until reading 1024 bytes of data, or reaching the timeout.

The correct process would be to read an expected Header size of data,
calculate the remaining size of the buffer ( as expressed in the third
byte of the modbus RTU protocol), adding the CRC size, and reading that
amount of bytes from the serial terminal.



//D.S.
-- 
8362 CB14 98AD 11EF CEB6  FA81 FCC3 7674 449E 3CFC

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <http://lists.alioth.debian.org/pipermail/python-modules-team/attachments/20140929/019d88b9/attachment.sig>


More information about the Python-modules-team mailing list