I just created a small test application which is creating a connection and a subscription to read a simple boolean variable. After stopping the OPC UA server and restarting the server, the connection is reconnected and the subscription is (re)created. However after everything looks fine. Variable changes are not reported by the application anymore. To create the output shown below I am just monitoring the ConnectionStatusUpdate Event of the session and the DataChanged and StatusChanged Event of the subscription. I would expect to have some more Data Changed Events comming up after the last line of the log file as some more times the state of the variable was changed.
Output of the log file please see below
Session created.
Session >>> Old Status: Disconnected -- New Status: Connecting -- Error: Good
Session >>> Old Status: Connecting -- New Status: Connected -- Error: Good
Reconnect: True
ReconnectDelay: 5000
Subscription >>> Old Status: Deleted -- New Status: Created -- Error: Good
001 -- Subscription Variable changed to NewVal: True
002 -- Subscription Variable changed to NewVal: False
003 -- Subscription Variable changed to NewVal: True
004 -- Subscription Variable changed to NewVal: False
005 -- Subscription Variable changed to NewVal: True
006 -- Subscription Variable changed to NewVal: False
007 -- Subscription Variable changed to NewVal: True
008 -- Subscription Variable changed to NewVal: False
009 -- Subscription Variable changed to NewVal: True
010 -- Subscription Variable changed to NewVal: False
Subscription >>> Old Status: Created -- New Status: WarningKeepAliveLate -- Error: BadCommunicationError
Session >>> Old Status: Connected -- New Status: ConnectionWarningWatchdogTimeout -- Error: UncertainSubNormal
Session >>> Old Status: ConnectionWarningWatchdogTimeout -- New Status: ConnectionWarningWatchdogTimeout -- Error: UncertainSubNormal
Session >>> Old Status: ConnectionWarningWatchdogTimeout -- New Status: ConnectionErrorClientReconnect -- Error: BadCommunicationError
Session >>> Old Status: Connected -- New Status: SessionAutomaticallyRecreated -- Error: Good
Session >>> Old Status: ConnectionErrorClientReconnect -- New Status: Connected -- Error: Good
Subscription >>> Old Status: WarningKeepAliveLate -- New Status: Deleted -- Error: Good
Subscription >>> Old Status: Deleted -- New Status: Created -- Error: Good
---------------------------------------------------------------------
Everything is looking good here Session is connected again, Subscription is (re)created, without my interaction, however no variable changes are being reported.
Subscription is not working after Reconnecting a Connection
Moderator: uasdknet
-
- Full Member
- Posts: 5
- Joined: 13 Feb 2017, 14:26
- Support Team
- Hero Member
- Posts: 3072
- Joined: 18 Mar 2011, 15:09
Re: Subscription is not working after Reconnecting a Connect
Please create a support ticket at https://webdav.unifiedautomation.com/su ... _form.html.
Create and attach a trace file with trace level ProgramFlow. We can use this file for analysing what is happening.
Create and attach a trace file with trace level ProgramFlow. We can use this file for analysing what is happening.
Best regards
Unified Automation Support Team
Unified Automation Support Team
- Support Team
- Hero Member
- Posts: 3072
- Joined: 18 Mar 2011, 15:09
Re: Subscription is not working after Reconnecting a Connect
After a reconnect the client recreates the subscriptions tries to create all MonitoredItems in one service call. However the MayMessageSize configured at the server is very small, so the CreateMonitoredItems call fails. You can increase the MaxMessageSize on server side or create the MonitoredItems in chunks. Please see ClientSettings.MaxOperationsPerRequest
Best regards
Unified Automation Support Team
Unified Automation Support Team
-
- Jr. Member
- Posts: 1
- Joined: 05 Jul 2018, 14:11
Re: Subscription is not working after Reconnecting a Connect
Hi,
I've been searching about the following connection status change on reconnect (Shuting down the Server and Starting it) and this post is the only one I found online.
Session >>> Old Status: ServerShutdown-- New Status: ConnectionErrorClientReconnect-- Error: UncertainSubNormal
Session >>> Old Status: Connected -- New Status: SessionAutomaticallyRecreated -- Error: Good
Session >>> Old Status: ConnectionErrorClientReconnect -- New Status: Connected -- Error: Good
I always get those two logs in this exact order. Is this a normal behaviour ?
It feels like there is a missing connection status change to go from SessionAutomaticallyRecreated to ConnectionErrorClientReconnect.
I'm currently raising an event in my system when Status goes from connected to anything else and an event when it goes from anything else to Connected.
Is SessionAutomaticallyRecreated only some kind of log information ?
Can I simply ignore the SessionAutomaticallyRecreated and assume that there will never be any connection status change going from SessionAutomaticallyRecreated to anything else ?
Thank you very much !
I've been searching about the following connection status change on reconnect (Shuting down the Server and Starting it) and this post is the only one I found online.
Session >>> Old Status: ServerShutdown-- New Status: ConnectionErrorClientReconnect-- Error: UncertainSubNormal
Session >>> Old Status: Connected -- New Status: SessionAutomaticallyRecreated -- Error: Good
Session >>> Old Status: ConnectionErrorClientReconnect -- New Status: Connected -- Error: Good
I always get those two logs in this exact order. Is this a normal behaviour ?
It feels like there is a missing connection status change to go from SessionAutomaticallyRecreated to ConnectionErrorClientReconnect.
I'm currently raising an event in my system when Status goes from connected to anything else and an event when it goes from anything else to Connected.
Is SessionAutomaticallyRecreated only some kind of log information ?
Can I simply ignore the SessionAutomaticallyRecreated and assume that there will never be any connection status change going from SessionAutomaticallyRecreated to anything else ?
Thank you very much !