无法在节点opc ua服务器中导入自定义节点集

问题描述 投票:0回答:1

我是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的标准模型,但似乎可行。

您知道如何解决吗?

node.js xml opc-ua node-opcua
1个回答
0
投票
  1. 您能分享您的custom.NodeSet2.xml吗?

  2. 您使用哪个工具创建了这个custom.NodeSet2.xml?您是否使用过UA-ModelCompiler

  3. 我检查了load_nodeset2.js文件,并且第764行为空。自定义xml文件可能存在一些解析问题。

© www.soinside.com 2019 - 2024. All rights reserved.