devices.modbusdevice:ModbusDevice

Driver for Modbus devices using the minimalmodbus library.

Usage

Source

devices.modbusdevice:ModbusDevice(
    portname,
    slaveaddress,
    baudrate,
    parity=serial.PARITY_NONE,
)

Extends minimalmodbus.Instrument to provide thread-safe register read/write operations with error handling.

Note that devices implemented based on this class will likely be deprecated in the future.

Parameters

portname: str

Name of the serial port

slaveaddress: int

Slave address of the Modbus device

baudrate: int

Communication speed in baud (bits/s)

parity: str = serial.PARITY_NONE
Parity setting for serial communication (default serial.PARITY_NONE)