Baldanos/rd6006

Serial timeout not set in Python 3

Closed this issue · 1 comments

In my own project I had to add

self.instrument.serial.timeout = 0.5

after this line

self.instrument = minimalmodbus.Instrument(port=port, slaveaddress=address)

to get good performance. Without that line the default of 0.05 is used, causing a retransmission in

https://github.com/Baldanos/rd6006/blob/master/rd6006/rd6006.py#L47

Hi ! You should now be able to use ´read_timeout´ and ´write_timeout´ properties to change these values :

>>> import rd6006
>>> r = rd6006.RD6006('/dev/ttyUSB3')
RD6006 or other detected
>>> r.read_timeout
0.05
>>> r.read_timeout = 1
>>> r.read_timeout
1