About redundancy - Specification vs UA.Netstandard usage|OPC UA Standard|Forum|OPC Foundation

Avatar
Search
Forum Scope


Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
Lost password?
sp_Feed sp_PrintTopic sp_TopicIcon
About redundancy - Specification vs UA.Netstandard usage
Avatar
Julien BENNET
Member
Members
Forum Posts: 6
Member Since:
02/04/2016
sp_UserOfflineSmall Offline
1
11/04/2019 - 07:34
sp_Permalink sp_Print sp_EditHistory

Hi People, One question (1) and one recommendation (2), feel free to add a reply, even if it’s just a few words. Thank you.

We are currently using successfully the UA.Netstandard library as a client,
to read thousands of items, and we plan to add some support for redundancy.
(will submit pull requests if needed)

However, reading the specifications about Warm and Hot redundancy modes,
(e.g. OPC 10000-1: Services v1.04 – 6.6.2.4.5.3) I can see some steps labelled
ActivateSampling” and “ActivatePublishing“.

(1)- I wonder what commands are expected in both steps, when sampling seems to be
handled on each monitored items, and publishing depends on the session.
My attempt would be like the pseudo-code under. Is my pseudo-code ok ?

[pseudo code for subscribing w/o sampling and publishing]
var subscription = new Subscription(session.DefaultSubscription)
{
   PublishingInterval = my_normal_period,
   PublishingEnabled = false,
}
var items = my_10000s_references.Select( 
   myref => new MonitoredItem(clientHandle: myref.index)
   {
     DisplayName = myref.display,
     StartNodeId = myref.nodeid,
     MonitoringMode = MonitoringMode.Disabled,
   };
);
subscription.AddItems(items);
session.AddSubscription(subscription);
subscription.Create();
[/pseudo code]

[pseudo code for activate sampling]
    // Activate sampling on items
    subscription.SetMonitoringMode(MonitoringMode.Report, subscription.MonitoredItems);
[/pseudo code]

[pseudo code for activate publishing]
    // Activate publishing mode
    subscription.SetPublishingMode(true);
[/pseudo code]

 

(2)– The specification says that the ServerStatus can help to compare multiple redundant servers,
and select the most appropriate one. So, imagine my client decides to jump from serverA (ServerStatus=100)
to serverB (ServerStatus=255).

The specification is really clear about what a client selecting to a new redundant server
is supposed to do, on the new server. But not what to do on the previous server, when the
server is still connected and replying.

I think I could maybe kill the subscription(s).. or maybe kill the session completely, and retry connecting later ?
Is this enough or too much ? What would be the recommended safe options ?

[pseudo code for killing subscription]
   // Kill subscription
   session.RemoveSubscription(subscription);
[/pseudo code]

Thanks in advance for your help in making the specification a bit more clear, at least in my head. 

In fact, writing this post helped me understand the SetMonitoringMode call, that basically sends to the 
server all the monitored ids to modify. (So it is slightly different from creating new monitored items
from scratch).

Julien.

Avatar
Randy Armstrong
Admin
Forum Posts: 1579
Member Since:
05/30/2017
sp_UserOfflineSmall Offline
2
11/05/2019 - 07:32
sp_Permalink sp_Print

This section in Part 4 explains how redundancy works:

https://reference.opcfoundatio…..#6.6.2.4.2

I suggest you read the section on ServiceLevel (not ServerStatus).

It explains in detail what the different numeric ranges uses.

Figure 28 also has a flow chart for clients.

Avatar
Julien BENNET
Member
Members
Forum Posts: 6
Member Since:
02/04/2016
sp_UserOfflineSmall Offline
3
11/05/2019 - 08:30
sp_Permalink sp_Print

Sorry my bad, I wrote ServerStatus instead of ServiceLevel. My questions remains the same nevertheless. Fig.28 does not explain if Closing the previous session is the recommended option, or if just the subscriptions shall be undone.

If unspecified behaviour, maybe my question (2) shall be read as “Is there a good practice / guideline in that situation ?”

Avatar
Randy Armstrong
Admin
Forum Posts: 1579
Member Since:
05/30/2017
sp_UserOfflineSmall Offline
4
11/05/2019 - 11:40
sp_Permalink sp_Print

It really depends on the type of redundancy you want (see Table 111 – Redundancy Failover actions)

That table tells you what you should do with subscriptions on fail-over.

You can treat an initial connection that you want to abort because the the ServiceLevel as if it was a failover.

i.e. leave the server you don’t want to use in the state expected for your redundancy mode.

Forum Timezone: America/Phoenix
Most Users Ever Online: 510
Currently Online:
Guest(s) 45
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Forum Stats:
Groups: 2
Forums: 10
Topics: 1445
Posts: 4889