Calling ServerManager.Stop() from a different application

Questions regarding the use of the .NET SDK 2.0 for Server or Client development or integration into customer products ...

Moderator: uasdknet

Post Reply
vpharshal
Jr. Member
Jr. Member
Posts: 3
Joined: 13 Dec 2023, 21:31

Calling ServerManager.Stop() from a different application

Post by vpharshal »

Hello,
Is there a way to stop the OPC UA Server (under development using .Net SDK) from another application (eg. from a c# console/windows service)?
As per my understanding I should call ServerManager.Stop(uint secondTillShutDown, LocalizedText shutdownReason, bool restart) this method or the same method with no parameter. Please advise.

User avatar
Support Team
Hero Member
Hero Member
Posts: 3078
Joined: 18 Mar 2011, 15:09

Re: Calling ServerManager.Stop() from a different application

Post by Support Team »

Hi,

You can stop the server either by calling
1) ServerManager.Stop
2) or by calling the OPC UA Method Server > RequestServerStateChange with any OPC UA client.

For calling the OPC UA Method the client (of course) need a secure connection and have the role SecurityAdmin or ConfigureAdmin assigned.
Best regards
Unified Automation Support Team

Post Reply