Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
Jérôme
@jeromevalentin
Hi @erossignon , I'm using the last version 2.28.3 of node-opcua, and I've got the following log (CANCELING TIMEOUT PUBLISH REQUEST) that appears sometime in the console. What does it mean exactly? Is that normal? Or did I miss to declare a listener somewhere to catch those kinds of logs? Thanks in advance for your help, and by the way thanks for this amazing library ;)
Andreas Heine
@AndreasHeine
@bitflower is the problem really solved? or sceduled to the future (longrun)!
Matthias Max
@bitflower
@AndreasHeine I appreciate the humor :-D As fundamental as this blocked me I see as resolved for now. My solution needs a bit more robustness though - that's for sure. But I learned a lot and would know much better how to act next time ;-) Havin' you guys is really worth so much. Thank you
Etienne
@erossignon

@jeromevalentin There could be several causes here:

  • server not being responsive
  • subscription with no monitored item
    I would need more information about your usage, : what is the server ? How many subscriptions ? How many subscriptions.

Usually this warning can be ignored, but it show some behavior that may hide a wider problem so it is good to understand what is causing it.

Jérôme
@jeromevalentin
@erossignon I'm using node-opcua as server, and UA Expert as client most of the time to test my server implementation, on the field the server may be accessed by all other OPC UA client. This log appears more frequently when other clients are connected. I was testing Matrikon Flex client from my phone, when I got this log on server side. Concerning subscription, I was only monitoring three or four items.
Etienne
@erossignon
@jeromevalentin One other case that could cause this message is when clients that connect to the server are interrupted abruptly and do not close session properly. (CTRL+C + or crash)
Matthias Max
@bitflower
Hey guys, happy new year every one :-)
image.png
I'm wondering how you solved the issue of re-connecting to an OPC server. For example right now my script exists if the given server is not available.
4 replies
Matthias Max
@bitflower
Just came across async module which seems to be used in node-opcua anyway. Also backoff seems to be used.
Etienne
@erossignon
@bitflower you can pass connectionStrategy parameter to your client constructor, this will control the number of time and how often node-opcua will retry to connect , by default it will try indefinitely , unless the connection.url is malformed , in which case the connect method will raise an expection
Matthias Max
@bitflower
image.png

@erossignon hi, thanks for getting back. With "indefinitely" you mean that it is not an exact timeout value?

I did some research and found that it does error every few minutes and pm2 grabs up to restart (see above)

1 reply
Etienne
@erossignon
Look at the log ... to understand why your client is crashing
Matthias Max
@bitflower
I know why it is crashing. I all makes complete sense (the machine I'm connecting to is switched of around 17:00 when the workers go home....)
Thanks so much for clarifying though!
Matthias Max
@bitflower
I have another question regarding ClientMonitoredItem: Will this send an initial event with the latest value upon setup of the item? Or just when actual changes to the value occur? I have the impression that I get the most recent value once no matter when that changed in the past.
4 replies
image.png
Matthias Max
@bitflower
I think I found the issue why I was getting an initial changed event. My code immediately registered the .on() after creating the monitoredItem. It now looks like this and doesn't emit an inital event anymore:
image.png
Is this the right way to do it? Or should the monitored item not emit initially when there wasn't a change? We are talking about a bale press here. Like a change every 10-30 minutes.
Matthias Max
@bitflower
I have created a small demo server this morning to simulate my client's setup. Went smooth. Thanks for this great library.
Mariusz
@mpostol

Hi All, sorry for interrupting you.

I try to find common rules related to the syntax and semantics of the Browse name as a contribution to further development of the MIT licensed open source Address Space Prototyping Tool (asp.exe). Hopefully I will be able to implement semantic diff, validation, and conversion of UANodeSet and ModelDesign files - any other formats? The specification doesn't help therefore I try to define common rules applied by independent vendors. I am concluding my research in the document OPC UA Object Model Working Notes.

So my first question is:

  • Do you know if someone has defined already regex for NodeId, QualifiedName, etc?

Still, I am bothering with the BrowseName namespaceIndex default value. So my second question is

  • Are you removing 0 in your code from the BrowseName by default - there must be a parser in your code?

Thanks,

Mariusz

Andreas Heine
@AndreasHeine
Are you removing 0 in your code from the BrowseName by default --> (https://reference.opcfoundation.org/v104/Core/docs/Part3/5.2.4/) Subclause 8.3 defines the structure of the BrowseName. It contains a namespace and a string. The namespace is provided to make the BrowseName unique in some cases in the context of a Node (e.g. Properties of a Node) although not unique in the context of the Server. If different organizations define BrowseNames for Properties, the namespace of the BrowseName provided by the organization makes the BrowseName unique, although different organizations may use the same string having a slightly different meaning.
Mariusz
@mpostol

@AndreasHeine Thanks for the feedback and advice. I always start reading the specification at the very beginning. More is in the document I have pointed out in my post. BTW It contains a namespace and a string should be `This structure contains a namespaceIndex and name fields" - but ok it could be recognized as a typo.

For example, consider "Name" BrowseName - how to discover the correct namespace? In many UANodeSet files, I am analyzing, assuming that "Name" == "0:Name" (are equal) a lot of errors are a result if "Name" comes from the inheritance chain, i.e. are a member of a type defined in namespace 1, 2, .....

For example, look at the snippet that comes from a generated UANodeSet file I am using for testing purpose:

https://github.com/mpostol/OPC-UA-OOI/issues/538#issuecomment-785031783

I have got it from one of the contributors to my project. The question is if it compliant with the specification or not? If yes it means that "Name" in a derived instance is defined by OPC UA standard (is in the default namespace), if no thousands of errors like this will be reported.

Andreas Heine
@AndreasHeine
the nodeset files will recv they true ns-index after importing them to the server! it depends on the server which is the next free slot in ns-array
if you instantiat a node from a nodeset the new node will recv the nsidx from the namespace its got added to
Andreas Heine
@AndreasHeine
the simple reason why they use the idx instead of the ns-name (http://mynamespace/UA) because it could be a long string and would be inefficient to use
Mariusz
@mpostol

@AndreasHeine my goal is to make sure that the nodeset files will recv they true ns-index after importing them to the server! for all the servers is really true. How to prove that the behavior of servers will be similar or the same. To promote the reusability of the models we must be sure how to deal with that.

@AndreasHeine What x must be in x:Name in a derived instance say defined in the namespace of index 2? I expect ` ,0,1,2`.

Andreas Heine
@AndreasHeine
... you cant ensure that the same model has always the same ns-idx on every server only (on identical servers)! if one server has lets say another nodeset imported as well or in a different order the idx then can be different. in thos cases you need to read the servers namespace array and get your idx dynamically for the setting up the browsename
if i have a nodeset importet (the first in the server) it has idx 1 -> then i make a new ns for my modelling/data (idx 2) -> if i instantiate from idx 1 a defined objecttype to my idx 2 namespace it will have 2:Name
Andreas Heine
@AndreasHeine
opc.tcp://opcua.machinetool.app:4840 this is the uri to a online machine tool opc ua server check with UaExpert the NS-Array under the Server object an then look at some tools wich have a none standard TypeDefinition like /Objects/Machines/BasicMachineTool
Mariusz
@mpostol
  1. My BrowseName Parse methods (after the OPCF stack) removes 0 always by default, so adding 0 to XML doesn't make any changes.
  2. In my example assuming "1:Name" ( I agree it is not compliant) causes fewer errors in models I am testing
  3. I will be back with a more completed (including reference to EngineeringUnits) example that I will add to my Unit Tests
  4. I assume that our common goal is to improve "Naming Conventions for Nodes" rules to promote design-time interoperability.
I know you are very busy but hopefully, see you soon.
Andreas Heine
@AndreasHeine
0 is reserved for the opc foundation standard nodes so you should avoid using 0
typically these kind of standardisations and conventions come from "opc foundation joint working groups and companion specifications"
to get a real convention within opc ua its needed to get accepted by the opc foundation
Mariusz
@mpostol
@AndreasHeine Today paper-driven standards must compete with community-driven standards. I am consulting with 3 vendors to conclude in a few weeks, not in a few years. But thanks for the advice.
Andreas Heine
@AndreasHeine
its already part of the spec. https://reference.opcfoundation.org/v104/Core/docs/Part3/5.2.4/ so it takes 0 time 😉 but do what you want do to, opc ua has all capabilities to deal with changing nsidx in model instances (i know it as member of three JWGs)
David Lane
@davidlane-iteratec
Hi all: we are experiencing problems with the connectivity in real-world operation connected to a S7. If the machine including Plc is turned off the normal lifeycle events (connection_lost, start_reconnection are not triggered) but instead timeouts start to happen:
ClientSessionKeepAliveManager#ping_server Transaction has timed out ( timeout = 60000 ms)
Strangely enough the timed_out_request event also does not fire.
On restart the node program never seems to recover adequately and then we are getting things like
ClientSessionKeepAliveManager#ping_server Invalid Channel BadConnectionClosed
Error: Invalid Channel BadConnectionClosed
And eventually just responds with
Error: Cannot recreate session
recreate_session_and_reperform_transaction -> Already in Progress
quangvo1302
@quangvo1302
Hi all, I created OPC UA server and it worked but It only alive in 10mins. So my question is " How i can keep server alive or restart it after sercurity token had expired with full old configuration". thank you so much.
mrtnzagustin
@mrtnzagustin
Hello there to everyone. I hava a basic question, sorry for mi basic knowledge. Which protocol are the communications between node opc-ua client an node opc-ua server using? is TCP-UA or is SOAP?
Andreas Heine
@AndreasHeine
mostly tcp binary
mrtnzagustin
@mrtnzagustin
great, why mostly? what do u mean o where i can read about it?
Andreas Heine
@AndreasHeine
in spec. there is a soap version but actually i dont know any product using the soap version... opcua is more of a heavy protocol (overhead) so anyone uses the most efficient binary version https://reference.opcfoundation.org/v104/ opc ua has a layered architecture so the transport is only the base layer and can be switched or expanded in the future but for now binary is the most present version on the market
mrtnzagustin
@mrtnzagustin
Thank you @AndreasHeine
Simon Bowen
@simonbowen

I am hoping someone can help me, I've donated and bought the book so fully invested in node-opcua thus far.

I have a PLC that I am connected to and can browse, I am trying to read a specific node but I get this message back, could anyone help me and point me in the right direction?

DataValue {
  value: Variant { dataType: 0, arrayType: 0, value: null, dimensions: null },
  statusCode: ConstantStatusCode {
    _value: 2151481344,
    _description: 'The requested operation is not supported.',
    _name: 'BadNotSupported'
  },
  sourceTimestamp: 2021-04-08T15:45:31.842Z {
    high_low: [ 30878862, 890726848 ],
    picoseconds: 400000000
  },
  sourcePicoseconds: 400000000,
  serverTimestamp: 2021-04-08T15:45:31.823Z {
    high_low: [ 30878862, 890534848 ],
    picoseconds: 200000000
  },
  serverPicoseconds: 200000000
}

Here is my code https://gist.github.com/simonbowen/033e600832a27664cdb8d6225ef5ef5b

A screenshot of UAExpert and the node I am trying to read.

Etienne
@erossignon

Hi Simon, thank you for your support and appreciation of node-opcua.
I have commented the gist to improve it slightly ( by closing the session and disconnecting after the read is done, so we free up some server resources at the end).
You can also use the .toString() to output the node-opcua DataValue object in a prettier way.

This being said, it looks like both node-opcua nd UAExpert agreed to say that the PLC variable doesn't contain a valid value here.
THere must be something on the PLC side that prevent the varaible to be properly initiliazed.

Does this happen with other variables too ? or just this one ?

Simon Bowen
@simonbowen
Hi @erossignon, I can read and write to other values without a problem, these seem to be standard dataTypes though. I updated the code as suggested and this is what the output now looks like.
```