diff --git a/examples/common/asynchronous-processor.py b/examples/common/asynchronous-processor.py index b5d3f8f48..e903610de 100755 --- a/examples/common/asynchronous-processor.py +++ b/examples/common/asynchronous-processor.py @@ -19,8 +19,8 @@ #---------------------------------------------------------------------------# #from pymodbus.transaction import ModbusBinaryFramer as ModbusFramer #from pymodbus.transaction import ModbusAsciiFramer as ModbusFramer -#from pymodbus.transaction import ModbusRtuFramer as ModbusFramer -from pymodbus.transaction import ModbusSocketFramer as ModbusFramer +from pymodbus.transaction import ModbusRtuFramer as ModbusFramer +# from pymodbus.transaction import ModbusSocketFramer as ModbusFramer #---------------------------------------------------------------------------# # configure the client logging @@ -33,7 +33,7 @@ #---------------------------------------------------------------------------# # state a few constants #---------------------------------------------------------------------------# -SERIAL_PORT = "/dev/ttyS0" +SERIAL_PORT = "/dev/ttyp0" STATUS_REGS = (1, 2) STATUS_COILS = (1, 3) CLIENT_DELAY = 1 @@ -62,7 +62,7 @@ def fetch_holding_registers(self): ''' Defer fetching holding registers ''' log.debug("Starting the next cycle") - d = self.read_holding_registers(*STATUS_REGS) + d = self.read_holding_registers(*STATUS_REGS, unit=1) d.addCallbacks(self.send_holding_registers, self.error_handler) def send_holding_registers(self, response): @@ -72,7 +72,7 @@ def send_holding_registers(self, response): ''' self.endpoint.write(response.getRegister(0)) self.endpoint.write(response.getRegister(1)) - d = self.read_coils(*STATUS_COILS) + d = self.read_coils(*STATUS_COILS, unit=1) d.addCallbacks(self.start_next_cycle, self.error_handler) def start_next_cycle(self, response):