def __init__(self, slave_id, dom): Slave.__init__(self, slave_id) self._fn_code_map = {defines.READ_COILS: self._read_coils, defines.READ_DISCRETE_INPUTS: self._read_discrete_inputs, defines.READ_INPUT_REGISTERS: self._read_input_registers, defines.READ_HOLDING_REGISTERS: self._read_holding_registers, defines.WRITE_SINGLE_COIL: self._write_single_coil, defines.WRITE_SINGLE_REGISTER: self._write_single_register, defines.WRITE_MULTIPLE_COILS: self._write_multiple_coils, defines.WRITE_MULTIPLE_REGISTERS: self._write_multiple_registers, defines.DEVICE_INFO: self._device_info, } self.dom = dom
def __init__(self, slave_id, dom): Slave.__init__(self, slave_id) self._fn_code_map = { defines.READ_COILS: self._read_coils, defines.READ_DISCRETE_INPUTS: self._read_discrete_inputs, defines.READ_INPUT_REGISTERS: self._read_input_registers, defines.READ_HOLDING_REGISTERS: self._read_holding_registers, defines.WRITE_SINGLE_COIL: self._write_single_coil, defines.WRITE_SINGLE_REGISTER: self._write_single_register, defines.WRITE_MULTIPLE_COILS: self._write_multiple_coils, defines.WRITE_MULTIPLE_REGISTERS: self._write_multiple_registers, defines.DEVICE_INFO: self._device_info, } self.dom = dom
def __init__(self, slave_id, dom): Slave.__init__(self, slave_id) self._fn_code_map = {defines.READ_COILS: self._read_coils, defines.READ_DISCRETE_INPUTS: self._read_discrete_inputs, defines.READ_INPUT_REGISTERS: self._read_input_registers, defines.READ_HOLDING_REGISTERS: self._read_holding_registers, defines.WRITE_SINGLE_COIL: self._write_single_coil, defines.WRITE_SINGLE_REGISTER: self._write_single_register, defines.WRITE_MULTIPLE_COILS: self._write_multiple_coils, defines.WRITE_MULTIPLE_REGISTERS: self._write_multiple_registers, defines.DEVICE_INFO: self._device_info, defines.REPORT_SLAVE_ID: self._report_slave_id, } self.dom = dom logger.debug("Modbus slave (ID: %d) created" % self._id)
def __init__(self, slave_id, dom): Slave.__init__(self, slave_id) self._fn_code_map = { defines.READ_COILS: self._read_coils, defines.READ_DISCRETE_INPUTS: self._read_discrete_inputs, defines.READ_INPUT_REGISTERS: self._read_input_registers, defines.READ_HOLDING_REGISTERS: self._read_holding_registers, defines.WRITE_SINGLE_COIL: self._write_single_coil, defines.WRITE_SINGLE_REGISTER: self._write_single_register, defines.WRITE_MULTIPLE_COILS: self._write_multiple_coils, defines.WRITE_MULTIPLE_REGISTERS: self._write_multiple_registers, defines.DEVICE_INFO: self._device_info, defines.REPORT_SLAVE_ID: self._report_slave_id, } self.dom = dom logger.debug("Modbus slave (ID: %d) created" % self._id)
def __init__(self, slave_id): Slave.__init__(self, slave_id)