node-opcua

userName/password Identity on OPC UA Server?

浪尽此生 提交于 2021-01-29 12:52:52
问题 In Client: let userIdentity = { userName: "user1", password: "user1" }; session = await client.createSession(userIdentity); In Server var userManager = { isValidUser: function (userName, password) { if (userName === "user1" && password === "password1") { return true; } if (userName === "user2" && password === "password2") { return true; } return false;}}; When Clients create session with OPCUA Server, it will send userName/password Identity to activeSession on Server. How to I can know that

node-opcua, nodejs, express: Add Variable nodes dynamically after run the OPCUAserver

南楼画角 提交于 2020-05-15 19:55:49
问题 Reading the documentation and examples of the OPC-UA foundation, the variables nodes are always added before the statement to start run the server. Is it possible to add them after the server has been started? If I change the order of the statements that doesn't work. Think with me the following situation: I need to do some HTTP requests as soon we start running the application/software (not the server) asynchronously. Then the server starts, after my HTTP request is done, I added variable

node opc-ua - how do i discover a variable in a server?

前提是你 提交于 2020-01-03 18:39:40
问题 I am learning node opc-ua and have followed the example provided in the GitHub page for the sample_server.js and simple_client.js. In the sample_server I add a variable when constructing the address space of the server such as: //this code is in the server addressSpace.addVariable({ componentOf: device, nodeId: "ns=1;s=variable_1", browseName: "MyVariable1", dataType: "Double", value: { get: function () { return new opcua.Variant({ dataType: opcua.DataType.Double, value: variable1 }); } } });

How can I generate a server AddressSpace from a XML nodeset file?

自古美人都是妖i 提交于 2019-11-28 06:34:04
问题 I am getting familiar with the node-opc-ua project and I want to generate a servers address space from a given nodeset (xml file) automatically. Is there a possibility? 回答1: You can specify more than one nodeset2.xml files to load to enrich the address space. Here is a simplified example. var opcua = require("node-opcua"); var nodeset_filename1 ="CustomAddressSpaceNodeset2.xml"; var nodeset_filename2 ="OtherCustomAddressSpaceNodeset2.xml"; var server_options = { /* [...] */ nodeset_filename: