Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
Simon Bowen
@simonbowen
So that I can understand, are enums always Int32?
because the Enumeration DataType is a subtype of Int32
Simon Bowen
@simonbowen
Thank you so much.
Andreas Heine
@AndreasHeine
your welcome!
Simon Bowen
@simonbowen
@AndreasHeine Have you got a paypal or something, I'd like to buy you a beer by sending some money over.
Andreas Heine
@AndreasHeine
Simon Bowen
@simonbowen
Sponsored. Thanks once again.
Andreas Heine
@AndreasHeine
Thanks ;)
Simon Bowen
@simonbowen

Me again. I have a set of nodeset.xml files that I have exported from UAExpert. I am trying to set up my own server in node-opcua using the following code.

(async () => {
  const server = new OPCUAServer({
    port: Number(process.env.SERVER_PORT) || 4840,
    nodeset_filename: [
      './nodesets/nodeset_0.xml',
      './nodesets/nodeset_1.xml',
      './nodesets/nodeset_2.xml',
      './nodesets/nodeset_3.xml',
      './nodesets/nodeset_4.xml',
      './nodesets/nodeset_5.xml',
      './nodesets/nodeset_6.xml'
    ]
  });

  await server.initialize();

  const endpoint = server.endpoints[0].endpointDescriptions()[0].endpointUrl;
  console.log(`OpcUA Server: ${endpoint}`);
  await server.start();
})();

but I get this error...

TypeError: Cannot read properties of null (reading 'objects')
    at prepareServerDiagnostics (/home/simon/Projects/portal-api/node_modules/node-opcua-server/source/server_engine.ts:1180:47)
    at /home/simon/Projects/portal-api/node_modules/node-opcua-server/source/server_engine.ts:1242:13
    at __node_internal_ (node:util:281:10)
    at processTicksAndRejections (node:internal/process/task_queues:83:21)

How am I being stupid?

Simon Bowen
@simonbowen
I think it's because of this error that occurs before hand
14:53:03.306Z :generateAddressSpaceRaw       :32    generateAddressSpace:  Loading xml file  ./nodesets/nodeset_4.xml  failed with error  String cannot be coerced to a nodeId : BrAccessRightsDataType
Simon Bowen
@simonbowen
To give some context to the above, I want to set up a "mock" opcua server that has the same interface as the PLC we are using for testing purposes. Does anyone have any ideas on how I could approach this?
Andreas Heine
@AndreasHeine
can you share the nodeset4 via mail?
Simon Bowen
@simonbowen
@AndreasHeine I can do, do you want to me PM your email address?
Simon Bowen
@simonbowen
@AndreasHeine I've just seen that it's on your profile, I'll send the nodeset_4.xml across.
Etienne
@erossignon
@simonbowen how did you generate the xml file in the first place ? the order is important, all dependent NodeSet.xml must be loaded first.
Sterfive has a tool that interogates a PLC and suck out the nodeset.XML files , so you can regenerate mock server easily.
Please contact me by DM if you are interested.
@simonbowen , one trick is to use the toString() method to console.log or display dataValue, callResult or any other node-opcua datastructure. The formating will be nicer ...
Etienne
@erossignon
console.log(dataValue):
//
console.log(dataValue.toString());
 const endpoint = server.endpoints[0].endpointDescriptions()[0].endpointUrl;
you can now use this as a short cut
 const endpoint = server.getEndpointUrl();
Simon Bowen
@simonbowen
@erossignon I exported the node sets from UAExpert. There were 6 in total, named nodeset_0, nodeset_1 etc. I definitely loaded them in numerical order.
@erossignon I worked through the issue with @AndreasHeine in private chat, I am still not totally sure on what the issue is to be honest. But that is down to my lack of understanding on how OPCUA works.
@erossignon I would be interested in the Sterfive tool, but I am not sure how that would be any different to me exporting the nodesets from UAExpert and ultimately hitting the same issue.
Etienne
@erossignon
@simonbowen I would also be intereseted to get a private copy of the XML file that you have generated with UAExpert for investigation. THere mgith be a parsing issue in node-opcua we need to fix
mcdoim14
@mcdoim14
Can file nodes only be used for static files? I have a requirement to provide various files (mainly csv/png) that are generated at runtime. Is there a way to do this using file nodes, or would I have to send these in their raw format?
Etienne
@erossignon
No. file node can be dynamic. Image are supported.
Sebastian
@SebsSa

Hello guys :) tried to find the answer to this question online - but sadly i did not find it :(

I created a server with :

`            allowAnonymous: false,
        securityPolicies: [SecurityPolicy.Basic256Sha256],`

User/PW: abc/123

So i tried to connect : Via

None Anonymous - Like expected did not work
Basic256Sha256 Anonymous - Like expected did not work
Basic256Sha256 abc/123 - Like expected did work

But now i tried :

None abc/123 - And i got logged in - expected it to NOT work

What is happening here ?

kshenes6
@kshenes6
Hello, I am new to OPC and have been trying to get a few simple things working in a server using node_opcua. The first things first, is there a good site with coding examples, like how to create a folder that is NOT a child of the ObjectsFolder, instead in the DeviceSet Object? How browsePath arguments works, how to traverse the tree on the server side, etc.
Andreas Heine
@AndreasHeine
DeviceSet is from OPCUA for Devices spec. https://reference.opcfoundation.org/DI/v102/docs/5.9 so make sure you stick to the spec. rules for the DeviceSet Object!
just change the organizedBy value/node
or you can buy etiennes book if you need a quickstart 😉
kshenes6
@kshenes6
Thanks, I will go back and review the spec and simple server, I have the example up and running but was trying to explore the namespace and addressSpace objects. I was not having a lot of luck getting what I thought would work to actually work. Again ty for the info!