StartDataMonitoring to change sampling rate
Posted: 27 Sep 2019, 14:28
I want to change the sampling rate in the example http://documentation.unified-automation ... ess03.html. Hence i am implementing a StartDataMonitoring() block. When i subscribe a node with UaExpert, this method is called but the for loop is not executed as the object OperationHandle is empty. Why does this happen ? also is this the right way to add a sampling rate of 2 ms to the server ?
Code: Select all
protected override void StartDataMonitoring(
RequestContext context,
TransactionHandle transaction,
IList<NodeAttributeOperationHandle> operationHandles,
IList<uint> monitoredItemIds,
IList<MonitoredItemCreateRequest> settings,
IList<DataChangeEventHandler> callback)
{
for (int ii = 0; ii < operationHandles.Count; ii++)
{
if (settings[ii].RequestedParameters.SamplingInterval < 2)
{
settings[ii].RequestedParameters.SamplingInterval = 2;
}
}
}