|
MobusRTU模块一共32个通道
通过 abc = mb_read_reg_03(1,0,32)读出数据输出为:
01 03 40 00 01 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 D9 29
继电器只开了1和3
print(#abc)输出31
encode后print是
{"1":0,"2":1,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0,"14":0,"15":0,"16":0,"17":0,"18":0,"19":0,"20":0,"21":0,"22":0,"23":0,"24":0,"25":0,"26":0,"27":0,"28":0,"29":0,"30":0,"31":0,"0":1}
虽然可以从abc[0]访问,但是#abc结果是31,大大们这个是咋肥事呢
|
|