Professional OPC
Development Tools

logos

Online Forums

Technical support is provided through Support Forums below. Anybody can view them; you need to Register/Login to our site (see links in upper right corner) in order to Post questions. You do not have to be a licensed user of our product.

Please read Rules for forum posts before reporting your issue or asking a question. OPC Labs team is actively monitoring the forums, and replies as soon as possible. Various technical information can also be found in our Knowledge Base. For your convenience, we have also assembled a Frequently Asked Questions page.

Do not use the Contact page for technical issues.

subscription handle value on bad connection

More
23 Jun 2020 05:53 #8621 by support
Hello.

There are no "bad" subscription handles, because subscriptions are long-term concept, and their state and the moment you call Subscribe is irrelevant. A subscription that is OK at that time can go into error later, and vice versa: a subscription that cannot be made at that time can become possible later. Error recovery is built into QuickOPC.

The state of all subscriptions is reported through the notification channel (events or callbacks) only.

- opclabs.doc-that.com/files/onlinedocs/QuickOpc/Latest/User%2...e.html#Failure%20Recovery.html

- opclabs.doc-that.com/files/onlinedocs/QuickOpc/Latest/User%2...rors%20in%20Subscriptions.html

- opclabs.doc-that.com/files/onlinedocs/QuickOpc/Latest/User%2...0OPC%20failure%20recovery.html

Best regards

Please Log in or Create an account to join the conversation.

More
23 Jun 2020 03:25 #8620 by cadomanis
It appears that if attempting to subscribe with the following code, and a connection is not made a subscription handle of value 12586002 is returned?
        public bool Subscribe()
        {
            try
            {
                this._client.DataChangeNotification += this.ParseData;
                this._subscriptionHandles = this._client.SubscribeMultipleMonitoredItems(new[]
                    {
                    new EasyUAMonitoredItemArguments(null, this._serverEndpoint, this._statusEndpoint, this.OpcUaUpdateRate)
                });
                this.ConnectedState = true;
                return true;
            }
            catch (Exception ex)
            {
                StaticLogger.Log(this.GetType(), LoggingLevel.Error, "Error", nameof(Subscribe), ex, true);
                return false;
            }
        }

Is that the expected value on a bad connection, such that that handle should be ignored? Or if after attempting the SubscribeMultipleMonitoredItems I immediately see the event handler return with a succeeded = false, should I be then throwing away the subscription handle that was received? Any pointers or extended examples on how to handle failed subscription attempts would be greatly appreciated.

Please Log in or Create an account to join the conversation.

Moderators: support
Time to create page: 0.040 seconds