我是OpcUa的新手,并且正在使用节点opcua堆栈。
我使用SIOME创建了信息模型。
我现在正在尝试将其导入服务器中。
这里是代码:
const opcua = require("node-opcua");
var nodeset_filename1 ="Opc.Ua.Di.NodeSet2.xml";
var nodeset_filename2 ="custom.NodeSet2.xml" //this one is getting me error
var server_options = {
nodeset_filename : [opcua.nodesets.standard_nodeset_file ,nodeset_filename1 , nodeset_filename2],
port : xxxx,
resourcePath:"/UA/Server"
}
const server = new opcua.OPCUAServer(server_options);
function post_initialize() {
console.log("initialized");
server.start(function() {
console.log("Server is now listening ... ( press CTRL+C to stop)");
console.log("port ", server.endpoints[0].port);
});
}
server.initialize(post_initialize);
这里是我得到的错误:
C:\path\node_modules\node-opcua-address-space\dist\source\loader\load_nodeset2.js:764
this.bodyXML = this._cloneFragment.value;
我尝试使用OpcUa的标准模型,但似乎可行。
您知道如何解决吗?
您能分享您的custom.NodeSet2.xml吗?
您使用哪个工具创建了这个custom.NodeSet2.xml?您是否使用过UA-ModelCompiler
我检查了load_nodeset2.js文件,并且第764行为空。自定义xml文件可能存在一些解析问题。