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.
- Forum
- Discussions
- QuickOPC-UA in .NET
- Connections, Reconnections, Certificates
- OPC-UA client session is disconnecting, why?
OPC-UA client session is disconnecting, why?
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.
Thank you
Please Log in or Create an account to join the conversation.
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.
- openventure
- Topic Author
- Offline
- Premium Member
- Posts: 13
- Thank you received: 0
thanks
the email return with message: "the address support wasn't found at opclabs.com"
Please Log in or Create an account to join the conversation.
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.
- openventure
- Topic Author
- Offline
- Premium Member
- Posts: 13
- Thank you received: 0
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.
Please Log in or Create an account to join the conversation.
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.
- openventure
- Topic Author
- Offline
- Premium Member
- Posts: 13
- Thank you received: 0
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.
Please Log in or Create an account to join the conversation.
- openventure
- Topic Author
- Offline
- Premium Member
- Posts: 13
- Thank you received: 0
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.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
- Forum
- Discussions
- QuickOPC-UA in .NET
- Connections, Reconnections, Certificates
- OPC-UA client session is disconnecting, why?