Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/316.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用ModbusTcpClient库在三菱Q03udv PLC上读取Python modbus通信字_Python_Modbus - Fatal编程技术网

使用ModbusTcpClient库在三菱Q03udv PLC上读取Python modbus通信字

使用ModbusTcpClient库在三菱Q03udv PLC上读取Python modbus通信字,python,modbus,Python,Modbus,Pythonmodbus使用ModbusTcpClient库在Mitsubishi PLC上读取单词 如何读取数据寄存器D1DE或其他 我已经测试过了…连接正常,但读取错误。收到的消息不完整 from pymodbus.client.sync import ModbusTcpClient client = ModbusTcpClient('10.1.1.4',port=5007) client.connect() result = client.read_holding_registers(

Python
modbus
使用
ModbusTcpClient
库在
Mitsubishi PLC
上读取单词

如何读取数据寄存器
D1
DE
或其他

我已经测试过了…连接正常,但读取错误。收到的消息不完整

from pymodbus.client.sync import ModbusTcpClient

client = ModbusTcpClient('10.1.1.4',port=5007)
client.connect()

result = client.read_holding_registers(1,1)
print result
t = result.registers[0]
print t

您遇到了什么错误?连接成功,但找不到D1、D2或其他地址。在使用客户端读取时。读取\u持有\u寄存器(1,1),得到空结果。尝试将单元地址作为请求的一部分传递
result=client。读取\u持有\u寄存器(1,1,unit=)
也尝试过同样的方法,实际上我需要读取D1、D2等寄存器,但我不知道它们的地址,以及如何知道确切的单位地址。我的PLC是三菱的Q03UDVCPU。