Mirroring a change from the client

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

Moderator: uasdkcpp

Post Reply
Utkrist
Hero Member
Hero Member
Posts: 22
Joined: 15 May 2023, 09:50

Mirroring a change from the client

Post by Utkrist »

Hi, I have two boolean variables name Read and Valid. Valid is a read only variable with AcessLevel CurrentRead, whereas Read is a read and write variable with AcessLevel CurrentRead and CurrentWrite. I want to reflect the change made on the Read variable by a client (for example UaExpert) by essentailly mirroring it in the Valid variable. Is there a way to do so?

For more details, at server startup both the variables are set to false, and after a measurement process, Valid is set to true and Read remains False. Then, when the client sets Read to true, Valid should change to false.

Best Regards,
Utkrist

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

Re: Mirroring a change from the client

Post by Support Team »

Hi,

no, you can not use the UaExpert for what you are trying to do.

The UaExpert is a generic reference client (for read, write, browse, monitor, call triggered by user interaction), and because of that has no user specific logic, nor any application specific logic inside. If you need an application that is "doing something" special (not generic), you need to implement yourself. In order to do so we offer software libraries (SDK/Toolkit) in different programming languages, that help you implementing the OPC UA-side of the application and you can concentrate on the application logic side of the storry.

Regarding your approach of creating a ping-pong protocol with 2 boolean flags over the variable based OPC UA mechanizm: If is a good idea, or not, is a different topic, where you may want to look into the OPC UA technology platform and find better solutions for this task.
Best regards
Unified Automation Support Team

Utkrist
Hero Member
Hero Member
Posts: 22
Joined: 15 May 2023, 09:50

Re: Mirroring a change from the client

Post by Utkrist »

Thanks for the reply. Perhaps I was not clear in my explanation. Right now, I am developing the OpcUa server with uasdkcppbundle-src-linux-v1.8.2. The question was implementing the change in Valid in response to the change in Read, made by the client (not necessarily using UaExpert). This feature is requested by a customer and they seem to be adamant about it.

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

Re: Mirroring a change from the client

Post by Support Team »

Hi,

on the serverside you can implement nearly all kind of logic you want. The server is representing the source. If you detect a Write to the one variable, you can change the other internally. However you may consider that you have multiple clients looking for the valid but having just one Read for acknowlede would not be enough, you would need one (private) per each client that is registred for the valid, or you end up in a first come first serve scenario without control over the second client.

Not sure if your task is understood correctly, but you probably need to look into method calls and events to create UA style interface instead of messing around with variables.
Best regards
Unified Automation Support Team

Post Reply