def write(args): print("Writing single register %s of device %s" % (args.address, args.register)) port = mursu.open_port() response = mursu_server.write_single_register(port,args.address,args.register, args.amount) mursu.print_response(response) mursu.close(port)
def read(args): print("Reading %s register(s) starting from register %s of device %s" % (args.amount,args.address, args.register)) port = mursu.open_port() response = mursu.read_holding_register(port,args.address,args.register, args.amount) mursu.print_response(response) mursu.close(port)