WB-MIR v2

Hi all,

Anyone know how to read the data inside modbus register after writing the IR command ? I just to make sure the data is correct.

https://wirenboard.com/wiki/WB-MIR_v2_Registers

Hi~
Step1:
Map IR bank to RAM
(edit port & device modbus address for your)

export DEV_PORT=/dev/ttyRS485-2
export DEV_ADDR=55
#BankNumber in {5200..5239}
export BankNumber=5200
modbus_client --debug -mrtu -pnone -s2 $DEV_PORT -a$DEV_ADDR -t0x05 -r$BankNumber 1

Step2:
After command IR bank may be read(and write for modify) in holding registers 2000…2510

for i in {2000..2510}
do
 echo "register $i $(modbus_client --debug -mrtu -pnone -s2 $DEV_PORT -a$DEV_ADDR -t0x03 -r$i | grep Data:)"
done

Step3:
Before normal work need unmap IR bank from RAM registers:

modbus_client --debug -mrtu -pnone -s2 $DEV_PORT -a$DEV_ADDR -t0x05 -r$BankNumber 0

https://wirenboard.com/wiki/WB-MSx_Consumer_IR_Manual/en