Accessing ServerStatusDataType

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

Moderator: uasdkcpp

Post Reply
MAJS
Jr. Member
Jr. Member
Posts: 3
Joined: 27 Jul 2021, 16:41

Accessing ServerStatusDataType

Post by MAJS »

I am working on an OPC UA Client, and I want to display the OPC UA Server's ServerStatusDataType information to the user.

I have read the forum thread below:

https://forum.unified-automation.com/viewtopic.php?f=18&t=2539&p=5505&hilit=serverstatus#p5505

It mentions that the "the client SDK does a cyclic read on the ServerStatus". Does the SDK make available the information obtained during this read? Or do I need to set up a MonitoredItem to get the ServerStatusDataType?

Yours,
Mark Short

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

Re: Accessing ServerStatusDataType

Post by Support Team »

The SDK only does a cyclic read on the "State", "SecondsTillShutdown" and "ShutdownReason" members of the ServerStatus, those are available via getters:

Code: Select all

https://documentation.unified-automation.com/uasdkcpp/1.8.1/html/classUaClientSdk_1_1UaSession.html#a202a565abf1b33bb6b507fce4129fdde
https://documentation.unified-automation.com/uasdkcpp/1.8.1/html/classUaClientSdk_1_1UaSession.html#a4d55431ae82519278df90a970ff9d6ea
https://documentation.unified-automation.com/uasdkcpp/1.8.1/html/classUaClientSdk_1_1UaSession.html#a121da434f846a03dcf725d82fbcea524
If you need the complete ServerStatus Variable you have to set up your own monitoredItem/read.
Best regards
Unified Automation Support Team

Post Reply