Reputation: 1
Good morning,
I installed pymodbus with pip
sudo pip install pyModbusTCP
I can call the function client with
from pyModbusTCP.client import ModbusClient
and I can read some registers from remote server correctly. Now I have to swap the result to create float32 data. The problem is that: if I try to call the extra function BinaryPayloadDecoder (line below)
from pyModbusTCP.payload import BinaryPayloadDecoder
after pyModbusTCP. it appears only the class client, utilities and other classes but it's not showed payload class.
How can I add the missing classes (in particular I need payload class)?
Thank you
from pyModbusTCP.client import ModbusClient
from pyModbusTCP.payload import BinaryPayloadDecoder
c = ModbusClient(host="192.168.x.x", port=502, unit_id=1, auto_open=True)
regs = c.read_holding_registers(40000, 2)
missing payload after from pyModbusTCP.
Upvotes: 0
Views: 24