python 远程客户端读取OPC服务器数据报错
问题相关代码,请勿粘贴截图
import OpenOPC,os
opc_host = "192.168.12.43"
opc_port = 7766
opc_serv = "Matrikon.OPC.Simulation.1"
opc = OpenOPC.open_client(opc_host, opc_port)
opc.connect(opc_serv, opc_host)
taglist =["PGP.3MW"]
print(opc.read(taglist))
运行结果及报错内容
Pyro4.errors.ProtocolError: invalid data or unsupported protocol version
我的解答思路和尝试过的方法
1.检查服务器和客户端dcom口,配置正常;
2. ping两台电脑,正常;
3. 客户端通过cmd命令opc -m open -H IP地址 -s Matrikon.OPC.Simulation.1 -r 数据,访问服务器数据,正常;
4. NET START openopcservice 服务器已开启;
5. 各种版本Pyro4都已经尝试过了。包括pyro 也都尝试过。不行;
我想要达到的结果
opc客户端能通过python读取到实时数据。
问题出现在哪里?