python - 用 python 代码连接 Schneider-Aut.OFS.2
问题描述
我目前正在使用 OpenOPC 库连接 Schneider-Aut.OFS.2 OPC 服务器。
导入 OpenOPC
opc = OpenOPC.client()
opc.servers()
['Schneider-Aut.OFS.2', 'Matrikon.OPC.Simulation.1'] 它与 Matrikon.OPC.Simulation.1 连接,但当我尝试与 Schneider-Aut.OFS.2 opc 连接时出现以下错误。连接('Schneider-Aut.OFS.2') 错误信息
opc.connect('Schneider-Aut.OFS.2') Traceback(最近一次调用最后):文件“C:\Users\alraza\AppData\Local\Programs\Python\Python39-32\lib\site-packages\OpenOPC .py”,第 223 行,在连接 self._opc.Connect(s, opc_host) 文件“C:\Users\alraza\AppData\Local\Programs\Python\Python39-32\lib\site-packages\win32com\gen_py\ F8582D24-88FB-11D0-B850-00C0F0104305x0x1x0.py",第 207 行,在 Connect 中返回 self。oleobj .InvokeTypes(1610743826, LCID, 1, (24, 0), ((8, 1), (12, 17)),ProgID pywintypes.com_error: (-2147352567, '发生异常。', (0, None, '类未注册\r\n', 无, 0, -2147221164), 无)
在处理上述异常的过程中,又出现了一个异常:
回溯(最后一次调用):文件“”,第 1 行,在文件“C:\Users\alraza\AppData\Local\Programs\Python\Python39-32\lib\site-packages\OpenOPC.py”中,第 227 行, 在连接中引发 OPCError(error_msg) OpenOPC.OPCError: Connect: -2147221164
我什至尝试添加 Schneider-Aut.OFS.2 OpenOPC.py 库但没有成功
提前致谢
解决方案
推荐阅读
- javascript - 如果用户已经访问了相同的页面链接,如何将用户重定向到另一个页面。(这不是登录页面。)
- java - 当试图获取下个月的最后一个日期时,在java中获取明年下个月的最后一个日期
- java - 升级java后Swing看起来放大了
- angular - 防止元素自动处于 :focus 状态
- java - NoClassDefFoundError: org/slf4j/LoggerFactory on Jenkins with gradle
- react-native - 在项目中找不到 child_process - 反应原生
- react-native - 无法在 ios 上读取 pdf 文件(反应原生)
- node.js - 护照 req.login 不会创建 req.user
- datatables - 按需数据表服务器端ajax
- ios - 使用动画更新 UITableView 的多线程问题