我已經使用了代碼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