3.3.2 time-limited evaluation version sdk .net

Questions regarding the use of the .NET SDK 2.0 for Server or Client development or integration into customer products ...

Moderator: uasdknet

Post Reply
Ercole63
Jr. Member
Jr. Member
Posts: 1
Joined: 21 Sep 2023, 10:29

3.3.2 time-limited evaluation version sdk .net

Post by Ercole63 »

Hello,

I am using 3.3.2 time-limited evaluation version sdk .net, i can read variables on my opc ua server, however i have a problem with subscription.
On the opc ua server more than 200 nodes are published, but in the subscription I can add/read at most 100 nodes.

I would like to ask if with the time-limited evaluation version of SDKs it is not possible to monitor more than 100 nodes in the subscription ?

User avatar
Support Team
Hero Member
Hero Member
Posts: 3072
Joined: 18 Mar 2011, 15:09

Re: 3.3.2 time-limited evaluation version sdk .net

Post by Support Team »

Hi,

the "time-limited" evaluation mode of the SDK is just time limeted, but has no other limitations whatsoever.

Have you checked out the UA server with UaExpert? Some Servers may have limitations "MaxMonitoredItemsPerSubscription" or "MaxNotificationsPerPublish", which in your case may be the limiting factor. Good servers are showing their limitations (OperationalLimits) and other capabilities in their server-object, you can browse with UaExpert and have a look.
Best regards
Unified Automation Support Team

Goran86
Jr. Member
Jr. Member
Posts: 3
Joined: 22 Sep 2023, 10:44

Re: 3.3.2 time-limited evaluation version sdk .net

Post by Goran86 »

Hello,

I've exactly the same problem. I'm using the same version of the SDK [time-limited evaluation version].

I tried to create a subscription and add some items to monitor, based on the documentation and examples provided with sdk.

So far, I've been doing this:

Code: Select all

Subscription RSubscription = null;
BrowseContext RBrowseContext = null;
List<ReferenceDescription> RRefs;
IList<MonitoredItem> RMonitoredItems = new List<MonitoredItem>();
NodeId RNodeId;

// Subscription
RSubscription = new Subscription(RSession)
{
    PublishingEnabled = true,
    PublishingInterval = 200,
    MaxNotificationsPerPublish = 0,

};

//RSubscription.MaxKeepAliveTime = 10000;                        
RSubscription.DataChanged += RSubscription_DataChanged;
RSubscription.Create();

// Browse Context
RBrowseContext = new BrowseContext()
{
    BrowseDirection = BrowseDirection.Forward,
    ReferenceTypeId = ReferenceTypeIds.HierarchicalReferences,
    IncludeSubtypes = true,
    NodeClassMask = 0,
    ResultMask = (uint)BrowseResultMask.None,
    MaxReferencesToReturn = 0
};

// Create the NodeId
RNodeId = new NodeId("MYNODEID", 3);

// Browse
RRefs = RSession.Browse(RNodeId,RBrowseContext,new RequestSettings() { OperationTimeout = 10000 },out _);

At this point all NodeId items inside the NodeId "MYNODEID" should have been added, but after I check them, I got only 100 nodes.

Code: Select all

for (int i = 0; i < RRefs.Count; i++)
{
    Console.WriteLine($"{i}: {RRefs[i].NodeId}");
}
I've tried using UaExport, and with it I can see all nodes inside MYNODEID.

What am I missing ... ?

User avatar
Support Team
Hero Member
Hero Member
Posts: 3072
Joined: 18 Mar 2011, 15:09

Re: 3.3.2 time-limited evaluation version sdk .net

Post by Support Team »

Hello,

Obviously the server only returns 100 ReferenceDescription in the Browse call. So you need to check the returned continuation point. If not null, you need to call BrowseNext.

Please see our example: https://documentation.unified-automation.com/uasdknet/3.3.2/html/L2ClientTutConsoleClient.html#L2ClientTutConsoleClient_Session_Browse
Best regards
Unified Automation Support Team

Goran86
Jr. Member
Jr. Member
Posts: 3
Joined: 22 Sep 2023, 10:44

Re: 3.3.2 time-limited evaluation version sdk .net

Post by Goran86 »

Hello,

Thank you for your help.

I tried the following:

Code: Select all

RBrowseContext = new BrowseContext()
{
    BrowseDirection = BrowseDirection.Forward,
    ReferenceTypeId = ReferenceTypeIds.References,
    IncludeSubtypes = true,
    NodeClassMask = 0,
    ResultMask = (uint)BrowseResultMask.None,
    MaxReferencesToReturn = 5000
    //MaxReferencesToReturn = 0
};
> MaxReferencesToReturn = 20. It read only 20 nodes indeed.
> MaxReferencesToReturn = 50. It read only 50 nodes indeed.
> MaxReferencesToReturn = 0. It read only 100 nodes.

The value 0 indicates that the Client is imposing no limitation, but it reads everytime only 100 nodes.

So I did the following like you said :

Code: Select all

List<ReferenceDescription> RRefs;
List<ReferenceDescription> RRefs2;

RRefs = RSession.Browse(
    RNodeId,
    RBrowseContext,
    null,
    out byte[] continuationPoint);


RRefs2 = RSession.BrowseNext(ref continuationPoint);

RRefs.AddRange(RRefs2);

In this way I can read more than 100 nodes.
There is probably a better way to do to, but I have to do some more tests to be sure.

User avatar
Support Team
Hero Member
Hero Member
Posts: 3072
Joined: 18 Mar 2011, 15:09

Re: 3.3.2 time-limited evaluation version sdk .net

Post by Support Team »

Hi,

please be carefull not to mix up things. In OPC UA there are "protection" mechanizm for (mostly embedded) servers, that allowes to limit operations in size and call-again to continue and get the rest. Such limits are "negothiated", in the sense of "smallest wins".
There are also parameters that can "protect" clientside.

There are limits for:
1) Browse (MaxElementsToReturn), continuation point for browse next
> this is typically used by clients to not freeze their GUI when browsing into huge folder and fill a tree control
2) Subscription may have number of MonitoredItems that can be added at once, but also a total limit for the overall sum.
> this is typically used by servers to limit their resource consumption, mainly memory (each item may have queue or values)
3) Publish may have max notifications within one response, will send the rest in next
> this is typically used to not overrun the message size and optimize network traffic, but may be good to avoid blocking when processing the data on clientside

In your case, when clientside browse with for "0" (unlimited) ReferencesToReturn, but you still get 100 only, most probably the serverside has limited the number of references, and you must browse again using the continuation point.

The .NET Client SDK has a function for such, called "BrowseList", which is doing all the magic for you.
Best regards
Unified Automation Support Team

Post Reply