pyhys / minimalmodbus

Easy-to-use Modbus RTU and Modbus ASCII implementation for Python.
Apache License 2.0
306 stars 146 forks source link

Parity configuration in documentation is wrong #128

Closed HWHardsoft closed 5 months ago

HWHardsoft commented 7 months ago

Hi,

in the documentation parity configuration is decribed so:

instrument.serial.parity = serial.PARITY_NONE

This is not working! The right way:

instrument.serial.parity = 'N'

Please change the documentation.

Thx

j123b567 commented 7 months ago

Did you forget to import serial?

serial.PARITY_NONE is 'N', see https://github.com/pyserial/pyserial/blob/master/serial/serialutil.py#L79