Read input registers

 1'''
 2Modbus_master - read_input_registers.py.
 3
 4""" Read 10 input registers from the slave device. """
 5
 6For other examples please check:
 7    https://github.com/WPC-Systems-Ltd/WPC_Stand-alone_Python_release/tree/main/examples
 8
 9Copyright (c) 2024 WPC Systems Ltd.
10All rights reserved.
11'''
12
13## WPC
14import pywpc
15
16host_ip = ""
17salve_id = 1
18address = 0
19registers = 10
20
21## Open Modbus master
22pywpc.ModbusMaster_open(host_ip, salve_id)
23
24## Read 10 registers at address 0, store result in regs list
25regs_l = pywpc.ModbusMaster_readInputRegister(address, registers)
26
27print(regs_l)
28
29## Close Modbus master
30pywpc.ModbusMaster_close()