How to use the minimalmodbus.Instrument.__init__ function in minimalmodbus

To help you get started, we’ve selected a few minimalmodbus examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github pyhys / minimalmodbus / omegacn7500.py View on Github external
def __init__(self, portname, slaveaddress):
        minimalmodbus.Instrument.__init__(self, portname, slaveaddress)
        self.setpoint_max = SETPOINT_MAX
        self.time_max = TIME_MAX
github pyhys / minimalmodbus / eurotherm3500.py View on Github external
def __init__(self, portname, slaveaddress):
        minimalmodbus.Instrument.__init__(self, portname, slaveaddress)
github CINF / PyExpLabSys / PyExpLabSys / drivers / crowcon.py View on Github external
def __init__(self, serial_device, slave_address, debug=False, cache=True, retries=3):
        """Initialize the driver

        Args:
            serial_device (str): The serial device to use
            slave_address (int): The address of the slave device
            debug (bool): Whether debugging output from minimal modbus should be enabled
            cache (bool): Whether system configuration values (which are expected not to
                change within the runtime of the program) should be cached

        """
        LOGGER.info('__init__ called, serial device: %s, slave address: %s',
                    serial_device, slave_address)
        Instrument.__init__(self, serial_device, slave_address)
        self.serial.baudrate = 9600
        self.serial.stopbits = 2
        self.serial.timeout = 2.0
        self.retries = retries
        # Variables
        self.debug = debug
        self.cache = cache
        # Cache
        self.system_conf = {}
        self.channel_conf = {}
        LOGGER.info('__init__ complete')