标签: python serial-port pyserial uart modbus
为了获得测量设备的输出,我使用pySerial,如下所示:
k = [addr, 0x04, (register/256)&0xFF, register&0xFF, (length/256)&0xFF, length&0xFF] ser.write("".join([chr(x) for x in k])) # read response rsp = [ord(x) for x in ser.read(2000)]
rsp始终为空str
rsp
str
你有什么想法吗?