python的serial连接三菱PLC时,为什么不管输入什么都返回95?

python的serial连接三菱PLC时,不管输入什么都返回95????

import serial

portx="COM4"

bps=9600

ser=serial.Serial(portx,bps,timeout=0.5)

result=ser.write("\x02\x30\x30\x31\x30\x30\x30\x31\x03\x35\x36".encode("utf-8"))

print(ser.read(8).hex())

ser.close()

输出:9595959595959595

https://blog.csdn.net/leos_blog/article/details/43114665

三菱plc我还是用过的,你得先看看你的协议写的对不对,一般来说排查这种问题,要用一个第三方的串口调试工具,发你想发的协议,查看返回,这样就能对比你程序进行验证。