Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
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.
```
{ /* DataValue */
   value: Variant(Scalar<Null>, value: <null>)
   statusCode:      BadNotSupported (0x803d0000)
   serverTimestamp: 2021-04-09T09:45:01.808Z $ 800.000.000
   sourceTimestamp: 2021-04-09T09:45:01.827Z $ 200.000.000
}
Heres a video from UAExpert with me tranversing this particular node, this might give some more information on what the issue is? It appears that you can updated arrays from within UAExpert and it doesn't work either. https://imgur.com/3l8MNW8
Simon Bowen
@simonbowen
Just realised that screen recording link doesn't work, here's a GDrive link. https://drive.google.com/file/d/17ROXyxkM_766x2t1cLeOR7vvf6YTLq0D/view?usp=sharing
Etienne
@erossignon
@simonbowen the video is a little bit blur
image.png
Etienne
@erossignon
it's getting sharper now.
The variable contains a array of 15000 extension objects (structures). This is wierd, I would expect the PLC to expose which type of ExtensionObject is contained in the dataValue.
CAn you set the environnement variable NODEOPCUADEBUG to "CLIENT{TRACE-RESPONSE-REQUEST}" and rerun the small client script ? It will generate a large output in the console. Can you send it to me privately for investigation ?
Are you controlling the PLC as well ? can you program it ?
Mohamed Dhaker Abdeljawed
@Mdhaker
Hello, we have a client using a PLC which cannot resolve the hostname, is it possible to have an endpoint with only ipaddress,Sorry If the question is duplicated or already answered in github, could you please send me the answer
Andreas Heine
@AndreasHeine
grafik.png
Mohamed Dhaker Abdeljawed
@Mdhaker
I will test this, thank you
Simon Bowen
@simonbowen
image.png

@erossignon Sorry for the delay in getting back. Some progress has been made and I can now read from the Array as discussed last week. I had to change something on the PLC to do this (I am not a PLC developer so a lot of trial and error).

I can write to Array indexes individually using their NodeID (ns=6;s=::CuttingLab:DataExchange.Cfg.Cutting.Pitch[0].Speed) for example, is it possible to write to this array in one go? There are 15000 indexes I need to populate.

Andreas Heine
@AndreasHeine
plc's use structures (extensionobjects) to represent there userdefined datatypes (UDT's) so you actually need to write the right value structure with the right typedefiniton in oder to set it all in one call -> its well described in etienne's book ;) or check the doc's: https://node-opcua.github.io/api_doc/2.32.0/interfaces/node_opcua.clientsession.html#constructextensionobject
it's pretty straightforward (thanks Etienne!)
Simon Bowen
@simonbowen
@AndreasHeine Thanks for replying, I have actually bought the book but I am still struggling, I am very new to OPCUA and still getting my head around the concepts. I'll take a look at the extension object section in the book, I suspect I need to read up more on OPCUA extension objects in general though.
"it's pretty straightforward (thanks Etienne!)" It's pretty straight forward when you know how!
Simon Bowen
@simonbowen
@erossignon @AndreasHeine After referring to the book, it says that I should be able to read the value "Your node-opcua client will be able to seamlessly operate with extension ob- jects that are defined on the server-side." However I still get a BadNotSupported error, can someone confirm that this is the PLC preventing me from doing this? https://gist.github.com/simonbowen/c8a5f141a68c184df35223313873a205
Andreas Heine
@AndreasHeine
could you provide the plc model? and check with UaExpert -> Types/DataTypes/Structure/... if there is the datatype/UDT-Name that the variable you want to write is present in that folder? or make screenshot and post them! like:
1.PNG
2.PNG
if it is not present the plc does not expose the custom types... that would be awfull! then you need to make like a craller which browses/explores the custom type node and make a structured list of node obejcets (NodeId, Typedefinition, Value) to write them in one ua call!
Simon Bowen
@simonbowen
image.png
Hi @AndreasHeine I can definitely browse them in UAExpert.
image.png
Andreas Heine
@AndreasHeine
so you can finde your custom plc datatypes in the Strucutres folder?
3.PNG
Andreas Heine
@AndreasHeine
i actually tested a little and indeed there must be an issue!
Andreas Heine
@AndreasHeine
@erossignon from opc ua v1.03 to v1.04 was a change in protocol! it might explain too, some of the stuff i wrote you via mail!?
Simon Bowen
@simonbowen
Hi @AndreasHeine, are you suggesting that there is an issue with OPC itself between the versions?
Andreas Heine
@AndreasHeine
@simonbowen still under investigation!
Simon Bowen
@simonbowen
@AndreasHeine Thank you. I spoke to the PLC developer today and they made some changes and I can now navigate the PLC DataTypes, which allows me to read/write to the Node as required. Definitely not a node-opcua issue.
Ludovic HENIN
@ludohenin
Hi there,
I'm using this project for a short while and I can't figure out out how to set the range of a monitored item where the subscription has a Deadband filter
Does anyone knows how to do that ?
It seems to be working but I can't understand why as a percent deadband doesn't make sense to me without a min/max range
Ludovic HENIN
@ludohenin
nevermind :point_up:
my question doesn't make sense
I figured out
Ricardo Valero de la Rosa
@RicardoValero95
Hi Im getting this warning:
[NODE-OPCUA-W22] Warning : your opcua client is sending multiple requests simultaneously to the server ReadRequest please fix your application code
Can someone guide me in the right direction?
Etienne
@erossignon
@RicardoValero95 , your client application is probably sending requests (read, write etc ...) to the server without waiting for completion. NodeOPCUA has a queue mechanism in place to avoid the server being bombarded by requests. After some points the request queue is full and node-opcua emits this message. This could be resolved by a code-review of your code. if you can't share it, please contact us privately
Ricardo Valero de la Rosa
@RicardoValero95
@erossignon Thanks, I found my issue. I can't share the code. But probably I'll do a demo repo. I'm working on a graphql server with opcua, don't know if its a good idea, let me know. Basically the issue was my graphql resolver was reading individual nodes, and fixed it sending an array of nodes to read.
I stopped receiving the warning but... whats the limitation on reading nodes? I was sending requests for about 10 nodes, but now that im thinking about it my server has 5k items, will my client scale?
Max Ivanov
@maximivanov

Hello, I want to implement a basic failover mechanism on top of node-opcua client.

The app makes browse, read and write requests (no subscriptions). I was thinking something as simple as wrapping opcua calls with try-catch and retrying with a backup server in case operation failed.

Does it make sense? If it does, what's the error type/code that would help identify read/write failure? I have a copy of the nodeopcua book but there's nothing related to redundancy/failover. Thanks!

Etienne
@erossignon
@maximivanov node-opcua takes care of the reconnection in case of disconnection... on your side you can simply check (session.isReconnecting) and avoid doing read/browse/write during reconnection. You can also enclose your request with a try/catch block .. as described in the book,
@RicardoValero95 , you client will scale, we have clients that operate on server with several million variables . For efficiency you have to group your reads in a array of ReadValue, as you described. However remember that servers have operational limits and you will have to make sure that you do not send too many reads at once, otherwise the server might reject the request with a BadTooManyOperation error.
Max Ivanov
@maximivanov

Hi @erossignon . I apologize - I realize I may not have been clear with my request. I want to support a failover scenario with a secondary (backup) OPC UA server in case primary server fails.

Read1 from primary -> OK
Write1 to primary -> OK
Read2 from primary -> OK
...
ReadN from primary -> timeout or unexpected error -> not OK -> create a client and session at secondary server -> ReadN from secondary -> OK

My question is how to detect that "not OK" scenario in the node-opcua client at runtime?