StartDataMonitoring to change sampling rate

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

Moderator: uasdknet

Post Reply
pkrawal
Full Member
Full Member
Posts: 6
Joined: 24 Sep 2019, 07:43

StartDataMonitoring to change sampling rate

Post by pkrawal »

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;
                }
            }
        }

Post Reply