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.

OPC-UA client session is disconnecting, why?

More
17 Jun 2016 17:18 #4164 by support
Hello,
I received the code. Thank you.

I do not see any problem with your code as such, but I have realized something that could be related:

It might be dangerous to call operations on EasyUAClient from inside an event handler or callback. It seems that we somehow forgot to warn our users about it in our documentation. In a future version, we will either make sure it is safe, or make it clear in the documentation. A can foresee a possible deadlock, which would explain the inability to recover. I cannot be sure if we are dealing with it, but is my nexct recommendation, to remove such calls.

I suggest that you store the incoming events into a queue, and then process the queue from a different thread. I understand there is work associated with that, but at the moment it seems to be as the thing to do.

I have also figured out why some initial LogEntry data is missing. This is just a minir issue, but it is unfortunate because it has prevented me from checking the QuickOPC version and some other parameters of your system. What happens there is that the EasyUAClient.LogEntry is a static event, and is being raised already when the first "new EasyUAClient" is called. In your code, however, you have "new EasyUAClient" as part of the field initialization, while the adding of the event handler for LogEntry comes afterwards. If you can, replace the initialization of the field by assigning "new EasyUAClient" to the member fields *after* you add an event handler to the LogEntry static event.

And, more or less out of desperation, we may consider obtain a lower-level trace (the messages from the OPC UA stack) - but preferrably only after the above change is made (with event queuing) is made. Please see the attached document with details about that.


File Attachment:

File Name: QuickOPC-U...cing.pdf
File Size:250 KB


Thank you
Attachments:
The following user(s) said Thank You: openventure

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

More
17 Jun 2016 07:45 #4162 by support
I apologize, the email address should have been support09 (at) opclabs.com .

Thank you for the log files. Do I assume correctly that the current issue we are discussing occurs at 6/15/2016 1:17:58 AM ?

No, I do not think we need to look hours back for the cause - it is unlikely.

Regarding the reasons to disconnect like this, in fact reasons like those you have listed shouldn't be causing it. It is surprising me as well. The legit reasons are:

- when you unsubscribe from all monitored items, or
- the EasyUAClient is disposed of or finalized.

It is also somewhat surprising that apparently, the component *does* attempt to reconnect after 1 minute (6/15/2016 1:18:59 AM), but that fails with a timeout. However I think we should focus on finding an explanation for the thing that happens first, and not on this.

Are you putting all LogEntry data into the logs you have sent? I am surprised not to see some that I would expect. For example, assuming that you do a service restart (and that creates a new process) around 6/15/2016 1:26:48 AM, I would expect to see many more messages from the LogEntry event, showing parameters of the system etc. Or, it wasn't a restart like that after all?

Regards

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

More
17 Jun 2016 06:28 - 17 Jun 2016 06:43 #4160 by openventure
I'm ready to email you, please send me the exact address,
thanks

the email return with message: "the address support wasn't found at opclabs.com"
Last edit: 17 Jun 2016 06:43 by openventure. Reason: more info

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

More
17 Jun 2016 04:27 #4158 by support
More to this:

Can you please send my way the relevant pieces of code you have? I am mainly interested in

1) The part(s) that instantiates the EasyUAClient object, subscribes, and unsubscribes.
2) The event handler.

If this cannot be done, for confidentiality reasons, over the forums, use email to support (at) opclabs.com.

Thank you

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

More
16 Jun 2016 08:42 - 16 Jun 2016 12:39 #4156 by openventure
Dear supplier, in every MonitoredItemChanged we check the error object in EasyUAMonitoredItemChangedEventArgs and at this time we don't have any error.

Our application make 3 log file from the same EasyUAClient, that you can look in attachment.

Is it possible that an error of some hours before make this behaviour?

If I can ask, Is there any macchanism that make EasyUAClient disconnect from the OPC without receive an error, like license check, or messages queue limit reached, or buffer full?

Thank in advance for your time,

paolo.
Attachments:
Last edit: 16 Jun 2016 12:39 by openventure.

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

More
15 Jun 2016 15:49 #4153 by support
The information contained in the LogEntry events is only meant to provide an additional insight into problems. However, with subscriptions, the delivery channel for errors is the subscription (event handler) itself. That is, if there is a problem, we raise a MonitoredItemChanged event, in which the EventArgs contain a non-null object in the Exception property, and it is *there* where the problem is primarily described.

I have it for almost guaranteed that you must be receiving such event notifications, approximately at the same time as the LogEntry events. I need to know the information contained in that Exception property (and, if it has an InnerException, then this inner exception as well - and so forth).

Thank you

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

More
15 Jun 2016 14:55 #4152 by openventure
I have hundreds of subscriprions, the plant is in production.
After this message the production stop, until we restart the service at 1:26.

Do you have some hint about it?

Here people become crazy because this problem cause stop of the production!!

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

More
15 Jun 2016 14:17 #4151 by support
Are you saying that you get these disconnection message while your code is subscribed to some monitored items? Because, if you were not subscribed to anything (or have unsubscribed from all items), *or* if you were doing just one-time operations like Read-s and Write-s, there would be nothing wrong with a disconnection like this.

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

More
15 Jun 2016 12:03 - 15 Jun 2016 12:05 #4148 by openventure
Hello, Dear supplier,
I want keep your attention on the latest events of application stop.
In the last fifty days, we have the same errors with a cadence in average of 6 days,
we have used QuickOPC 5.35 build 1126.2 until 11 june, from this time we have installed the build 1173.1 as you suggested.
we have a new stop today of the same type like before, below there are the messages logged

6/15/2016 1:17:58 AM: OPC Event Information-2024 [6/14/2016 11:17:58 PM 0: OPCLabs-UAEngine message:The OPC-UA client session with connect sequence number 1 is disconnecting from endpoint URL "opc.tcp://10.74.137.71:49320".
6/15/2016 1:17:59 AM: OPC Event Information-2025 [6/14/2016 11:17:59 PM 0: OPCLabs-UAEngine message:The OPC-UA client session with connect sequence number 1 has disconnected from endpoint URL "opc.tcp://10.74.137.71:49320".
6/15/2016 1:17:59 AM: OPC Event Information-2026 [6/14/2016 11:17:59 PM 0: OPCLabs-UAEngine message:The OPC-UA client session on endpoint URL "opc.tcp://10.74.137.71:49320" failed at tick 562352341 and will retry in 10000 milliseconds.

Before these messages, I don't observe anything wrong.
From the plant I have a log of lifebit communication troubles at 1:17:29
This is the meaning of the message from the source code:
void EUAClient_LogEventHandler(object sender, LogEntryEventArgs eArgs)
{
myLogger.Log(string.Format("OPC Event {3}-{4} [{5} {0}: {1} message:{2}", eArgs.Category, eArgs.Source, eArgs.Message, eArgs.EntryType, eArgs.EventId, eArgs.Timestamp));
}

I would ask you, what should be the reason of the disconnection?
How I can investigate on it?


p.s. the opc server is kepware 5.14 and it's running on the same machine of the service.
Last edit: 15 Jun 2016 12:05 by openventure.

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

More
13 Jun 2016 09:43 #4125 by support
That is still the same message, therefore my previous answer applies. Please observe the behavior with build 5.35.1173.1.

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

Moderators: support
Time to create page: 0.065 seconds