Giter Club home page Giter Club logo

Comments (10)

Magniveo avatar Magniveo commented on July 28, 2024

Hello, you can see the implementation in the TestClient project, and the implementation of the subscription for the server in the TestServer project.

from libua.

nauful avatar nauful commented on July 28, 2024

Hello,

Can you capture subscribing via uaexpert in Wireshark with no security and share that here? I would guess it subscribed to something besides (nodeid, value).

from libua.

Christ0ph89 avatar Christ0ph89 commented on July 28, 2024

Hi Nauful,

sure, I've capture the traffic from UAExpert and the LibUA client for the mentioned node, which is now ns=4;i=2801; after an structure update on the OPC server. The according dump is named after that at the end (..._libua / ..._uaexpert).

What I've seen so far, the requests are nearly the same for the specific node, but in the LibUA client, the "NotifyDataChangeNotifications" method is not fired on an publish response for that node. Maybe there is some filter or switch case missing in LibUA?

opc_nodeid_subscribe_libua.zip
opc_nodeid_subscribe_uaexpert.zip

from libua.

nauful avatar nauful commented on July 28, 2024

Hmm, it looks like that should have worked. Please check this line and step through to see if it reaches the call to NotifyDataChangeNotifications:

DataValue[] notifications = new DataValue[numDv];

If decoding succeeds, it should call NotifyDataChangeNotifications. You override that in your client, for example:

public override void NotifyDataChangeNotifications(uint subscrId, uint[] clientHandles, DataValue[] notifications)

from libua.

Christ0ph89 avatar Christ0ph89 commented on July 28, 2024

Thanks for the hint. I've stepped through the code and found the failing part in the Client.cs on line 4299, where the call succeeded &= recvHandler.RecvBuf.Decode(out notifications[j]); returns 'false'.
Digging deeper in the stack, it tries to decode the notification as variant in MemoryBufferExtensions.cs on line 1194. Finally in the VariantDecode function in MemoryBuffer.cs line 635, it fails on line 644, where if ((mask & 0x80) != 0) is always 0.

Maybe the ExtensionObject has a different mask and need to be handle separately in the MemoryBufferExtensions.cs?

from libua.

nauful avatar nauful commented on July 28, 2024

Thanks, that gives me a hint. Let me investigate. I don't think I've seen an extension object in a variant before so this is a new case.

from libua.

nauful avatar nauful commented on July 28, 2024

Fixed, let me know if the latest version works.

from libua.

Christ0ph89 avatar Christ0ph89 commented on July 28, 2024

Looks good, great work 👍 . The only thing that seems to be missing is the source timestamp, the server timestamp is correct in the notification. Maybe another bug?

from libua.

nauful avatar nauful commented on July 28, 2024

There's no source timestamp in the data:
image

uaexpert requested both timestamps:
image

In your CreateMonitoredItemsRequest, request both source and server timestamps:
image

from libua.

Christ0ph89 avatar Christ0ph89 commented on July 28, 2024

Okay that was my fault, sorry for that 👍 .

Thanks again for the fast response and quick fix, everything is working now like expected :-)

from libua.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.