def __init__(self, template, template_directory, args, timeout=5): self.timeout = timeout databank = slave_db.SlaveBase(template) # Constructor: initializes the server settings modbus.Server.__init__(self, databank if databank else modbus.Databank()) # not sure how this class remember slave configuration across instance creation, i guess there are some # well hidden away class variables somewhere. self.remove_all_slaves() self._configure_slaves(template)
def __init__(self, template, template_directory, args, timeout=5): self.timeout = timeout self.delay = None self.mode = None databank = slave_db.SlaveBase(template) # Constructor: initializes the server settings modbus.Server.__init__(self, databank if databank else modbus.Databank()) # retrieve mode of connection and turnaround delay from the template self._get_mode_and_delay(template) # not sure how this class remember slave configuration across # instance creation, i guess there are some # well hidden away class variables somewhere. self.remove_all_slaves() self._configure_slaves(template)