Getting Variable Value Data Change Event

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

Moderator: uasdkcpp

Post Reply
alccetinkaya
Jr. Member
Jr. Member
Posts: 4
Joined: 13 Sep 2023, 10:06

Getting Variable Value Data Change Event

Post by alccetinkaya »

Hi,

I have a OPCUA Server, it contains an object and the object contains a changeable variable by OPC Clients. I want to know when the client changes this variable's value. How can I implement this feature to my server code?
Note: I am using the UaModeler to create this object and other things

Thanks!

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

Re: Getting Variable Value Data Change Event

Post by Support Team »

Hello alccetinkaya,

there are 3 ways to get there:

1) change the value handling of the variables and override the method writeValues in the NodeManager.
example: https://documentation.unified-automation.com/uasdkcpp/1.8.1/html/L3GettingStartedLesson03.html

2) override the method afterSetAttributeValue in the NodeManager
example in the demoserver (project server_cpp_demo) - search for "NodeManagerDemo::afterSetAttributeValue"

3) create in internal subscription in the server to monitor variables for value changes
see: https://documentation.unified-automation.com/uasdkcpp/1.8.1/html/classServerManager.html#a5abbca078144f65976ec2db25b71d2a0
This feature is also used in the demoserver (project server_cpp_demo) in HistoryManagerCache::startLogging
Best regards
Unified Automation Support Team

alccetinkaya
Jr. Member
Jr. Member
Posts: 4
Joined: 13 Sep 2023, 10:06

Re: Getting Variable Value Data Change Event

Post by alccetinkaya »

Thanks for the answer.

I decided to use option 2 and I can access the modified variable with the parameter "UaNode *pNode". I want to ask if it is possible to access other variables and change their values?

Post Reply