摘要: 一、Nuget上添加OpcUaHelper库,要使用最新的版本2.2.1,旧版本亲测无法连接,比如版本2.1.3经过测试无法连接 二、代码 class Program { static async Task Main(string[] args) { OpcUaClient opcUaClient 阅读全文
posted @ 2025-07-08 15:47 daviyoung 阅读(453) 评论(0) 推荐(0)
摘要: 一、需要确认opc服务器的节点类型是数字型还是字符串型。 例如:数字型:i=2 字符串型:s=Temperature 假如命名空间索引是2,那么ns=2 采集数字型: node_address = "ns=2;i=2" 采集字符串型: node_address = "ns=2;s=Temperatu 阅读全文
posted @ 2025-07-08 10:24 daviyoung 阅读(210) 评论(0) 推荐(0)
摘要: 一、安装库opcua pip install opcua 二、新建文件opcua_server.py # -*- coding: utf-8 -*- from opcua import Client import time # 配置客户端 server_url = "opc.tcp://localh 阅读全文
posted @ 2025-07-08 10:21 daviyoung 阅读(193) 评论(0) 推荐(0)