Page 1 of 1

Identify if OPC-UA server was rebooted

Posted: 14 Jun 2021, 23:55
by jramirez-jh
Hello,

I'm looking for a way to identify from my Client if the target (connected) OPC-UA server was rebooted. I'm pretty new to the SDK so I'm unsure if this is something possible or not, because I understand it can be a very tricky scenario, for example if the reboot was not planned like when the physical machine where the server is running on was rebooted or a power outage occured.

In a more common scenario I think I can listen to the UnifiedAutomation.UaClient.Session.ConnectionStatusUpdate event, but I want to be sure if there is another way to try to identify this, for example, the OPC-UA Server SDK saves the last start-up time? or the time elapsed since the last successful start-up? That info (if available) could help to do a rough estimate about when happened the last reboot.

Regards

Re: Identify if OPC-UA server was rebooted

Posted: 15 Jun 2021, 09:04
by Support Team
Hi,

every OPC UA Server has a Node "StartTime" in it's address space. You could read out directly after being connected and check after reconnect. If StarTime is "unchanged", it was (oviously) just a network interuption that caused the reconnect, but if StarTime is different this would indicate that the server was shutdown and completely restarted. Furthermore the Node "ServerStatus" can give you information about the shutdown reason.

Re: Identify if OPC-UA server was rebooted

Posted: 17 Jun 2021, 10:42
by jramirez-jh
Support Team wrote:
15 Jun 2021, 09:04
Hi,

every OPC UA Server has a Node "StartTime" in it's address space. You could read out directly after being connected and check after reconnect. If StarTime is "unchanged", it was (oviously) just a network interuption that caused the reconnect, but if StarTime is different this would indicate that the server was shutdown and completely restarted. Furthermore the Node "ServerStatus" can give you information about the shutdown reason.
Thanks for your reply.

Regarding this info contained inside the StartTime node, I'm wondering if the data is somehow persisted by the Server SDK or if is it needed to implement a custom logic to do it by our own?

For instance, let's say the Windows/Linux machine where the OPC-UA Server is running on was rebooted, then after reboot the OPC-UA server will be autostarted (by a Windows Service or a Linux Daemon) Does the data will be preserved?

Re: Identify if OPC-UA server was rebooted

Posted: 18 Jun 2021, 09:44
by Support Team
Hi,

no the server decides himself what data to persist, some servers may even create some "history" of certain data points and store them in a database, but again that is an individual implementation decision on the server side.

Typically, if the server shuts down (for whatever reason) and it will come back later and again initialize or restart his datasource, it will get fresch values from his subsystem and continue with providing live data. In a first place the UA Server is just an casulation (and interface) of some data source. However OPC UA (Historical Access) has the ability provide time series of stored data and events (see historizing attribute of a node).