python连接OPC(python2.7 win32版本)

环境:python2.7,MatrikonOPCServer
OpenOPC-1.3.1.win32-py2.7下载地址
pywin32-2221 提取码:gddq
MatrikonOPC Explorer 提取码:d3a8

1.安装python2.7(win32版本)
2.安装MatrikonOPCServer.exe
3.打开MatrikonOPC Explorer,右击Matrikon.OPC.Simulation.1(opc Server的名称),Connect-Add Tags,弹出图2,添加随机数“Random.Int1”,运行
在这里插入图片描述
在这里插入图片描述

4.运行OpenOPC-1.3.1.win32-py2.7.exe,默认安装选择
5.运行pywin32-221.win32-py2.7.exe文件,默认安装选择
6.测试代码

import OpenOPC

opc = OpenOPC.client()
opc.connect('Matrikon.OPC.Simulation.1')
print opc[' Random.Int1']
opc.close()
原创文章 11 获赞 1 访问量 2万+

猜你喜欢

转载自blog.csdn.net/weixin_39810091/article/details/105960250