02/04/2016
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.
05/30/2017
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.
02/04/2016
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 ?"
05/30/2017
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.
1 Guest(s)