在我的节点操作服务器中,我正在加载一个带有定义的节点和引用的XML文件。当我运行节点操作服务器并连接到它(使用统一的OPC客户端)时,我只能看到顶级节点。但是当我在客户端中浏览节点时,看到以下错误:
const server_options = {
//certificateFile: server_certificate_file,
//privateKeyFile: server_certificate_privatekey_file,
port: port,
nodeset_filename: [
path.join(rootFolder,"modeling/DDHubOPCUA.NodeSet2.xml"),
standard_nodeset_file
]
};
const server = new OPCUAServer(server_options);
const endpointUrl = server.endpoints[0].endpointDescriptions()
[0].endpointUrl;
const hostname = require("os").hostname();
console.log(" server PID :".yellow, process.pid);
server.on("post_initialize", function () {
const addressSpace = server.engine.addressSpace;
const rootFolder = addressSpace.findNode("RootFolder");
});
server.start(function (err) {
if (err) {
console.log(" Server failed to start ... exiting");
process.exit(-3);
}
console.log(" server on port :".yellow,
server.endpoints[0].port.toString().cyan);
console.log(" endpointUrl :".yellow, endpointUrl.cyan);
console.log("\n server now waiting for connections. CTRL+C to
stop".yellow);
});