I’m having trouble accessing my WAGO 750-8001 using Modbus TCP in Python. I think that maybe the configuration on the 750-8001 is not correct or I’m not addressing the registers correctly. I have added the ethernet device and ModbusTCP_Server_Device
and can see the connection in Python (I’m trying to read values from the PLC and write values to the PLC using python) but when I try and read values nothing gets returned.
When I connect using python I can see that I have the connection (Modbus TCP server status changes to running, number of connection goes from 0 to 1).
In the image (at the bottom of this post) is the General
tab for the ModbusTCP_Server_Device
along with the Status
tab.
In python, when I try and read for example, %QW274
, as addressed in my global variables, the python code returns Exception Response(131, 3, IllegalAddress)
. Below is the Python code that I am testing with:
from pymodbus.client.sync import ModbusTcpClient
device_ip = "192.168.1.130"
client = ModbusTcpClient(device_ip)
client.connect()
print (client.connect())
Start = 274
total_points = 1
rq = client.read_holding_registers(address=Start, count=total_points, unit=1)
print (rq)
print (rq.registers)
Any help would be appreciated. Sorry all the clipped parts are all in one image, as a ‘new user’ I can only post one.