Hello,
Having developed a server with .NET SDK, I would like to subscribe to node internally in this server (monitoring change to node value made by the client).
I can see a similar topics in the forum, but for the C++ SDK counterpart ("How do I read or subscribe for data internally in the server" + "Modify a Variable value when another one (or more) change it").
Could you indicate, in .NET C# context, which functions to use, or some sample code, to provide a point to start from, please ?
Thank you.
Yves
Subscribe to node internally in this server
Moderator: uasdknet
- Support Team
- Hero Member
- Posts: 3064
- Joined: 18 Mar 2011, 15:09
Re: Subscribe to node internally in this server
the c# counterpart is the ServerInternalClient.
The InternalClientFastDataMonitoredItem will deliver the changes immediately to the Callback, if need more options use the InternalClientFullDataMonitoredItem.
Code: Select all
ServerInternalClient client = new ServerInternalClient(Server);
InternalClientFastDataMonitoredItem item = new InternalClientFastDataMonitoredItem()
{
NodeId = ObjectIds.Server,
AttributeId = Attributes.Value,
Callback = YourCallback
};
var list = new List<InternalClientFastDataMonitoredItem>();
list.Add(item);
var results = client.CreateDataMonitoredItems(Server.DefaultRequestContext, list);
Best regards
Unified Automation Support Team
Unified Automation Support Team