open62541 icon indicating copy to clipboard operation
open62541 copied to clipboard

Allow a single complete callback for all monitored items in one subscription

Open JulZimmermann opened this issue 1 year ago • 1 comments

Solution for #4318, #5701 and #5226

JulZimmermann avatar Apr 26 '24 09:04 JulZimmermann

This feature is a blocker for my project. I need a single callback for performance reasons and compatibility with the UA OPC Stack that provide a FastDataChangeCallback (https://github.com/OPCFoundation/UA-.NETStandard/blob/711160e84a96606931a6737a70518e1f7b6e666d/Libraries/Opc.Ua.Client/Subscription/Subscription.cs#L454) Can this pull request be merged into the main branch?

electro-logic avatar Oct 10 '24 11:10 electro-logic

About this PR:

The clientHandle of the UA_MonitoredItemNotification is an UInt32 and is less flexible than "void* monContext" available in the UA_Client_DataChangeNotificationCallback with the signature (UA_Client* client, UA_UInt32 subId, void* subContext, UA_UInt32 monId, void* monContext, UA_DataValue* value).

For example I was using monContext to assign a structure with the NodeId, DisplayName and SamplingInterval. Why the void* was changed to an UInt32?

UPDATE: Another improvement is to call UA_UNLOCK(&client->clientMutex); before calling dataChangeCallback() and LOCKING again after

electro-logic avatar Nov 06 '24 20:11 electro-logic