pymodbus、python 2.7、および Windows を使用して、WAGO 750-881 PLC からレジスタを読み取るのに問題があります。Modbus Poll ユーティリティで問題なく読み取ることができるので、問題は Python コードにあると思います。次のコードを使用すると、エラーが発生します。runfile('C:/Users/Mike/modbustest2.py', wdir='C:/Users/Mike')
Exception Response(131, 3, IllegalValue)
from pymodbus.client.sync import ModbusTcpClient
c = ModbusTcpClient(host="192.168.1.20")
chk = c.read_holding_registers(257,10, unit = 1)
response = c.execute(chk)
print response
自分のコードを読む必要があることはわかっていますprint response.registers
が、.registers
拡張機能を利用できないようです。print response.registers
このエラーがスローされます。エラーAttributeError: 'ExceptionResponse' object has no attribute 'registers'
が含まれているのはprint response
、何らかの形で役立つかもしれないと思ったからです。誰が問題が何であるかを知っていますか?