【发布时间】:2022-09-29 19:59:32
【问题描述】:
使用 Siemens Logo!Soft Comfort,我想连接 Siemens Logo! (8) 使用 pymodbus
siemens soft comfort 的网络输入设置(我还尝试了 Unit ID 255 和 Modbus 类型“DI”(数字输入))
Pymodbus 代码:
import time
client = ModbusTcpClient(\'192.168.0.3\')
print(client.connect())
while True:
time.sleep(1)
print(client.write_coil(1, True))
time.sleep(1)
print(client.write_coil(1, False))
输出:
True
Modbus Error: [Input/Output] [WinError 10054] An existing connection was forcibly closed by the remote host
Modbus Error: [Input/Output] [WinError 10054] An existing connection was forcibly closed by the remote host
标签: python-3.x pymodbus siemens