我已经使用了代码https://github.com/node-opcua/node-opcua/blob/master/documentation/creating_a_client.md创建opcclient
从正在sample_server阅读。这很好。现在我想连接到一个Matrikon OPC模拟服务器。所以在节点sample_client,我改变了在使用的NodeJS如何opcua.OPCUAClient连接到Matrikon的OPC模拟服务器
var endpointUrl = "opc.tcp://" + require("os").hostname() + ":8080/Matrikon.OPC.Simulation.1";
在MatrikonOPC的资源管理器,左侧选项卡上我看到
Localhost '\\compname'
Matrikon.OPC.Simulation.1
Group0
上点击Group0
在右窗格中,我有一个标签Random.Int1
和值正在不断变化。在服务器信息窗格中,它表示服务器凝视正在运行。
当我运行的节点sample_client
,它没有给output..it甚至不给
“无法连接到端点”
错误。它似乎是卡在折线
client.connect(endpointUrl,function (err) {
有人会知道为什么和我如何构建端点网址。
因此,您是说我运行的Matrikon.OPC.simulation.1服务器是旧的经典服务器(OPC DA),但客户端代码尝试使用OPC UA连接....非常感谢您的回应 – Aparna