I am developing OPC UA server, having around 10000 variables. I don't want to maintain any cache so I want to use Internal Handle Type and only update those variable values which client has monitor/subscribed for.
I read http://documentation.unified-automation ... deMan.html but couldn't understand how to accomplish the same.
How do I provide initial value to the variables ?
Which method/event should I use to get the variable ids for which client has subscribed(monitor) and unsubscribed ? (As server consists of 10000 variables and client may subscribe/monitor only few variables.)
In Server how to know which variables client has subscribed
Moderator: uasdknet
-
- Jr. Member
- Posts: 1
- Joined: 09 Feb 2018, 05:10
-
- Hero Member
- Posts: 21
- Joined: 03 Mar 2017, 16:08
Re: In Server how to know which variables client has subscri
Hi,
Question no 1. What about writing to the nodes just after creating them?:
Question no 2. What about overwriting the Start/Stop DataMonitoring method in your NodeManager class?
Question no 1. What about writing to the nodes just after creating them?:
Code: Select all
this.nodeManager.Server.InternalClient.WriteValue(this.nodeManager.Server.DefaultRequestContext, nodeId,qualifiedName, value);
Code: Select all
protected override DataMonitoringResult StartDataMonitoring(
RequestContext context,
MonitoredItemHandle itemHandle,
MonitoredItemCreateRequest settings,
DataChangeEventHandler callback)
{
this.monitoredItems.Add(settings.ItemToMonitor); // Here to add to the list. In the StopDataMonitoring to remove from the list.
return base.StartDataMonitoring(context, itemHandle, settings, callback);
}
protected override void StartDataMonitoring(
RequestContext context,
TransactionHandle transaction,
IList<NodeAttributeOperationHandle> operationHandles,
IList<uint> monitoredItemIds,
IList<MonitoredItemCreateRequest> settings,
IList<DataChangeEventHandler> callback)
{
// Maybe also here.
base.StartDataMonitoring(context, transaction, operationHandles, monitoredItemIds, settings, callback);
}