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.

The OPC-UA subscription publishing has stopped

More
23 Feb 2015 20:01 #2842 by support
The suggestion to increase the sampling interval was also meant to address the "...publishing has stopped" problem. If this is not an issue any more, ignore this suggestion for now.

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

More
23 Feb 2015 07:24 #2839 by adid@contel.co.il
hello,

thank you for your answer.

about "...publishing has stopped" - i test it again now and without breakpoints at all i don't see this error again, so it's ok. it's not quite accurate what you wrote - at the begining i was using breakpoint but didn't mention it ( in the first post ), and than you write ask if i was using breakpoints, so i test this again withput breakpoints and i didn't write about this problem again, i write about exception oi get in the output window.
so "...publishing has stopped" is not the problem anymore, and the problem now is delayed or missing updates.

i am testing the service tommorow and the day after, and i will notify if there is problem with delayed or missing updates, also i will try to remove the task as you mention.

about the sampling interval i am not quite sure i have the proper value. i didn't have any requiments for my service. the boolean tags are defined with scan rate 100 in Kepware, so what value i need to set to sampling interval in order to read DataChange correctly ?

thank you,
Adi Damty

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

More
22 Feb 2015 19:52 #2837 by support
Hello,
thanks for more details.

I am somewhat confused as to your use of breakpoints. In your earlier post, you said that you were not using them. But in the latest post you say that you have seen "...publishing has stopped" with breakpoints. Does that mean that the original answer was not quite correct; and, that we now should not concern about the "...publishing has stopped" error, but rather about the (suspectedly) delayed or missing updates?

BTW: you wrote "...only when i have breakpoints inside the m_EasyUAClientCoils_MonitoredItemChanged function.". In fact, NO breakpoints (even those outside the event handler) can be used with the OPC UA keep-alive mechanism, if the server modifies the keep-alive interval to a value that is in order of seconds or tens of seconds (which is what Kepware server does). There is a short discussion of this in the Concepts document.

The first error (the lines up to "...Could not load configuration file") are perfectly normal. It just means that no external UA configuration has been provided - which is the usual case. The file-based UA configuration can be used if you need to change low-level parameters such as transport quotas. There is a discussion of this in the Concepts document as well.

The other errors are missing details, and may or may not be a problem. We can focus on them later.

I have briefly reviewed your code and do not see any clear problem with it (some minor stuff, unrelated to the problem at hand, is mentioned further below). My only concern is with the use of .NET Tasks - not because there is anything incorrect about using them, but because they end up using a commonly shared ThreadPool, and I have recently seen issues where the consumption of threads from the pool (made by the application) had an unexpected negative influence on the OPC UA stack (because at some places, it uses the same ThreadPool). It would be interesting to know whether the problem persists if the tasks are commented out, or replaced by ordinary managed threads.

You have a sampling interval of 200 milliseconds. I understand that it is probably something that comes from the requirements to your app. If you, however, just for the testing purposes, change it to something considerably slower - say 2000 milliseconds - will you get the same problem?

A minor note to your code: It is not necessary to test whether EasyUAMonitoredItemChangedEventArgs.Arguments is null: It is never null.
The following user(s) said Thank You: adid@contel.co.il

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

More
22 Feb 2015 12:09 #2834 by adid@contel.co.il
hello,

thank you for your answer.
about the error "...publishing has stopped" - i see it happened only when i have breakpoints inside the m_EasyUAClientCoils_MonitoredItemChanged function. when i don't have breakpoint i don't see this error anymore.

about the sql exceptions i know this is "my exceptions" and they are not relevant to the case.

i don't feel the dataChange is working well. sometimes i am waiting about 3 minutes and not getting at all the dataChange event in my code after changing tag in Kepware. i will mention that the Kepware and the client service are running at the same computer. i attached part of my code which demonstrate listen to dataChange event of 3 boolean tags ( define in simulator in Kepware ) - how is it possible the client is missing data change events ?

Something i don't understand is why i am not getting every dataChange immediately when both the service client and the Kepware server are running at the same computer.

i am still see errors of OPC in the output window ( attached below ) - what is this errors ?

A first chance exception of type 'Opc.Ua.ServiceResultException' occurred in Opc.Ua.Configuration.dll
CI_ExtrlineService.vshost.exe Warning: 0 : * Transformed from: An exception of type 'Opc.Ua.ServiceResultException' from source 'Opc.Ua.Configuration' has occurred in OPC-UA SDK action 'ApplicationInstance.LoadApplicationConfiguration'. The exception descend follows.
(1) {Opc.Ua.ServiceResultException} Opc.Ua.Configuration(LoadApplicationConfiguration) -> Could not load configuration file.
A first chance exception of type 'Opc.Ua.ServiceResultException' occurred in Opc.Ua.Core.dll
A first chance exception of type 'Opc.Ua.ServiceResultException' occurred in Opc.Ua.Core.dll
A first chance exception of type 'Opc.Ua.ServiceResultException' occurred in Opc.Ua.Core.dll
A first chance exception of type 'Opc.Ua.ServiceResultException' occurred in Opc.Ua.Core.dll
A first chance exception of type 'Opc.Ua.ServiceResultException' occurred in Opc.Ua.Core.dll
A first chance exception of type 'Opc.Ua.ServiceResultException' occurred in OpcLabs.EasyOpcUAInternal.dll
A first chance exception of type 'Opc.Ua.ServiceResultException' occurred in Opc.Ua.Core.dll
A first chance exception of type 'Opc.Ua.ServiceResultException' occurred in Opc.Ua.Core.dll
A first chance exception of type 'Opc.Ua.ServiceResultException' occurred in Opc.Ua.Core.dll
A first chance exception of type 'Opc.Ua.ServiceResultException' occurred in Opc.Ua.Core.dll



thank you,
Adi Damty
Attachments:

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

More
22 Feb 2015 10:51 #2831 by support
Do I understand it correctly that issue has persisted after increasing the KeepAliveInterval?

When the "...publishing has stopped" error occurs (though it should not...), the component should re-connect (and start receiving updates) after a delay. Does this work?

The exceptions listed below do not *necessarily* be a problem, we will have to investigate deeper.

Just to be sure, are you aware that some of them (the SqlException-s) cannot be coming from our part - they must be somehow "yours" - are they OK as well?

Would you mind posting the MonitoredItemChanged event handler code (or send it by email if it should stay confidential)?

Best regards
The following user(s) said Thank You: adid@contel.co.il

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

More
22 Feb 2015 07:18 #2830 by adid@contel.co.il
hello,

i set the KeepAliveInterval as you mention.
i am debugging the code but without breakpoint ( i am running service as winform and want to see that the dataChange mechanisam is stable ).
and also i don't doing any time consuming process inside the function : m_EasyUAClientCoils_MonitoredItemChanged - i operate task in this function.

i am getting a lot of errors inside the OPC dll's - i see this in the output window :

A first chance exception of type 'Opc.Ua.ServiceResultException' occurred in Opc.Ua.Core.dll
A first chance exception of type 'Opc.Ua.ServiceResultException' occurred in Opc.Ua.Core.dll
A first chance exception of type 'System.Data.SqlClient.SqlException' occurred in System.Data.dll
A first chance exception of type 'System.Data.SqlClient.SqlException' occurred in System.Data.dll
A first chance exception of type 'System.Data.SqlClient.SqlException' occurred in System.Data.dll
A first chance exception of type 'System.Data.SqlClient.SqlException' occurred in Microsoft.ApplicationBlocks.Data.dll
A first chance exception of type 'System.Data.SqlClient.SqlException' occurred in Microsoft.ApplicationBlocks.Data.dll
A first chance exception of type 'Opc.Ua.ServiceResultException' occurred in Opc.Ua.Core.dll
A first chance exception of type 'Opc.Ua.ServiceResultException' occurred in Opc.Ua.Core.dll
A first chance exception of type 'Opc.Ua.ServiceResultException' occurred in Opc.Ua.Core.dll
A first chance exception of type 'Opc.Ua.ServiceResultException' occurred in OpcLabs.EasyOpcUAInternal.dll
A first chance exception of type 'System.Net.Sockets.SocketException' occurred in System.dll
A first chance exception of type 'Opc.Ua.ServiceResultException' occurred in Opc.Ua.Core.dll
A first chance exception of type 'Opc.Ua.ServiceResultException' occurred in Opc.Ua.Core.dll
* Transformed from: An exception of type 'Opc.Ua.ServiceResultException' from source 'Opc.Ua.Core' has occurred in OPC-UA SDK action 'DiscoveryClient.GetEndpoints'. The exception descend follows.
(1) {Opc.Ua.ServiceResultException} Opc.Ua.Core(End) -> Error establishing a connection.

A first chance exception of type 'Opc.Ua.ServiceResultException' occurred in Opc.Ua.Core.dll
A first chance exception of type 'Opc.Ua.ServiceResultException' occurred in Opc.Ua.Core.dll
A first chance exception of type 'Opc.Ua.ServiceResultException' occurred in Opc.Ua.Core.dll
A first chance exception of type 'Opc.Ua.ServiceResultException' occurred in OpcLabs.EasyOpcUAInternal.dll
A first chance exception of type 'Opc.Ua.ServiceResultException' occurred in Opc.Ua.Core.dll
A first chance exception of type 'Opc.Ua.ServiceResultException' occurred in Opc.Ua.Core.dll
A first chance exception of type 'Opc.Ua.ServiceResultException' occurred in Opc.Ua.Core.dll
A first chance exception of type 'Opc.Ua.ServiceResultException' occurred in OpcLabs.EasyOpcUAInternal.dll
A first chance exception of type 'Opc.Ua.ServiceResultException' occurred in Opc.Ua.Core.dll
A first chance exception of type 'Opc.Ua.ServiceResultException' occurred in Opc.Ua.Core.dll
A first chance exception of type 'Opc.Ua.ServiceResultException' occurred in Opc.Ua.Core.dll
A first chance exception of type 'Opc.Ua.ServiceResultException' occurred in OpcLabs.EasyOpcUAInternal.dll
A first chance exception of type 'Opc.Ua.ServiceResultException' occurred in Opc.Ua.Core.dll
A first chance exception of type 'Opc.Ua.ServiceResultException' occurred in Opc.Ua.Core.dll
A first chance exception of type 'Opc.Ua.ServiceResultException' occurred in Opc.Ua.Core.dll
A first chance exception of type 'Opc.Ua.ServiceResultException' occurred in OpcLabs.EasyOpcUAInternal.dll
A first chance exception of type 'Opc.Ua.ServiceResultException' occurred in Opc.Ua.Core.dll
A first chance exception of type 'Opc.Ua.ServiceResultException' occurred in Opc.Ua.Core.dll
A first chance exception of type 'Opc.Ua.ServiceResultException' occurred in Opc.Ua.Core.dll
A first chance exception of type 'Opc.Ua.ServiceResultException' occurred in Opc.Ua.Client.dll
* Transformed from: An exception of type 'Opc.Ua.ServiceResultException' from source 'Opc.Ua.Client' has occurred in OPC-UA SDK action 'Session.RemoveSubscription'. The exception descend follows.
(1) {Opc.Ua.ServiceResultException} Opc.Ua.Client(Delete) -> BadSessionIdInvalid
(2) {Opc.Ua.ServiceResultException} Opc.Ua.Core(ValidateResponse) -> BadSessionIdInvalid

A first chance exception of type 'Opc.Ua.ServiceResultException' occurred in Opc.Ua.Core.dll
A first chance exception of type 'Opc.Ua.ServiceResultException' occurred in Opc.Ua.Core.dll
A first chance exception of type 'Opc.Ua.ServiceResultException' occurred in Opc.Ua.Client.dll
* Transformed from: An exception of type 'Opc.Ua.ServiceResultException' from source 'Opc.Ua.Client' has occurred in OPC-UA SDK action 'Session.RemoveSubscription'. The exception descend follows.
(1) {Opc.Ua.ServiceResultException} Opc.Ua.Client(Delete) -> BadSessionIdInvalid
(2) {Opc.Ua.ServiceResultException} Opc.Ua.Core(ValidateResponse) -> BadSessionIdInvalid

A first chance exception of type 'Opc.Ua.ServiceResultException' occurred in Opc.Ua.Core.dll
A first chance exception of type 'Opc.Ua.ServiceResultException' occurred in OpcLabs.EasyOpcUAInternal.dll
A first chance exception of type 'System.Exception' occurred in CI_ExtrlineService.exe
A first chance exception of type 'Opc.Ua.ServiceResultException' occurred in Opc.Ua.Core.dll
A first chance exception of type 'Opc.Ua.ServiceResultException' occurred in Opc.Ua.Core.dll
A first chance exception of type 'Opc.Ua.ServiceResultException' occurred in Opc.Ua.Core.dll
A first chance exception of type 'Opc.Ua.ServiceResultException' occurred in OpcLabs.EasyOpcUAInternal.dll
A first chance exception of type 'Opc.Ua.ServiceResultException' occurred in Opc.Ua.Core.dll
A first chance exception of type 'Opc.Ua.ServiceResultException' occurred in Opc.Ua.Core.dll
A first chance exception of type 'Opc.Ua.ServiceResultException' occurred in Opc.Ua.Core.dll
A first chance exception of type 'Opc.Ua.ServiceResultException' occurred in OpcLabs.EasyOpcUAInternal.dll
A first chance exception of type 'Opc.Ua.ServiceResultException' occurred in Opc.Ua.Core.dll
A first chance exception of type 'Opc.Ua.ServiceResultException' occurred in Opc.Ua.Core.dll
A first chance exception of type 'Opc.Ua.ServiceResultException' occurred in Opc.Ua.Core.dll
A first chance exception of type 'Opc.Ua.ServiceResultException' occurred in Opc.Ua.Core.dll
A first chance exception of type 'Opc.Ua.ServiceResultException' occurred in OpcLabs.EasyOpcUAInternal.dll
A first chance exception of type 'Opc.Ua.ServiceResultException' occurred in Opc.Ua.Core.dll
A first chance exception of type 'Opc.Ua.ServiceResultException' occurred in Opc.Ua.Core.dll
A first chance exception of type 'Opc.Ua.ServiceResultException' occurred in Opc.Ua.Core.dll
A first chance exception of type 'Opc.Ua.ServiceResultException' occurred in Opc.Ua.Client.dll
* Transformed from: An exception of type 'Opc.Ua.ServiceResultException' from source 'Opc.Ua.Client' has occurred in OPC-UA SDK action 'Session.RemoveSubscription'. The exception descend follows.
(1) {Opc.Ua.ServiceResultException} Opc.Ua.Client(Delete) -> BadSessionIdInvalid
(2) {Opc.Ua.ServiceResultException} Opc.Ua.Core(ValidateResponse) -> BadSessionIdInvalid

A first chance exception of type 'Opc.Ua.ServiceResultException' occurred in Opc.Ua.Core.dll
A first chance exception of type 'Opc.Ua.ServiceResultException' occurred in Opc.Ua.Core.dll
A first chance exception of type 'Opc.Ua.ServiceResultException' occurred in Opc.Ua.Client.dll
* Transformed from: An exception of type 'Opc.Ua.ServiceResultException' from source 'Opc.Ua.Client' has occurred in OPC-UA SDK action 'Session.RemoveSubscription'. The exception descend follows.
(1) {Opc.Ua.ServiceResultException} Opc.Ua.Client(Delete) -> BadSessionIdInvalid
(2) {Opc.Ua.ServiceResultException} Opc.Ua.Core(ValidateResponse) -> BadSessionIdInvalid

A first chance exception of type 'Opc.Ua.ServiceResultException' occurred in Opc.Ua.Core.dll
A first chance exception of type 'Opc.Ua.ServiceResultException' occurred in OpcLabs.EasyOpcUAInternal.dll
A first chance exception of type 'System.Exception' occurred in CI_ExtrlineService.exe

thank you,
Adi Damty

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

More
20 Feb 2015 07:13 #2823 by support
This is a failure indicates by a "keep mechanism: mechanism in OPC UA. Either server or the client are not communicating periodically soon enough to verify that the connection is still operational.

Try increasing the keep alive interval. Unless you are setting the EasyUAClient instance property to Isolated = true, do it like this, at the beginning of the program (before opening any connection):
EasyUAClient.AdaptableParameters.Session.KeepAliveInterval = 60*1000;

Also, make sure that you do not do any time-consuming processing inside the MonitoredItemChanged event handler.

And, I suppose you are not debugging your code using breakpoints, when this happens? I am asking this because breakpoints can disturb the keep-alive mechanism quite heavily.

If we do not find a solution by other means, we will have to deploy some communication analysis in order to figure out what is happening "on the wire".

Best regards
The following user(s) said Thank You: adid@contel.co.il

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

More
19 Feb 2015 13:42 #2815 by adid@contel.co.il
hello,

i am getting exception "The OPC-UA subscription publishing has stopped." 4 times in about 30 seconds.
the Kepware and the service are in the same computer, and the CPU Usage is 1-10% and 4GB Memory avilable.
this happened in function :

private void m_EasyUAClientCoils_MonitoredItemChanged(object sender, EasyUAMonitoredItemChangedEventArgs e)

does it mean the client wont get dataChanges in tags anymore ? and if so how can i resolve this ?

thank you,
Adi Damty

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

Moderators: support
Time to create page: 0.072 seconds