Hi,
I would like to prevent the client from setting up too high sampling and publishing rates. Where in the framework should the server define the actual subscription settings / monitored item settings?
overwrite subscription / monitored item settings
Moderator: uasdknet
-
- Hero Member
- Posts: 21
- Joined: 03 Mar 2017, 16:08
- Support Team
- Hero Member
- Posts: 3068
- Joined: 18 Mar 2011, 15:09
Re: overwrite subscription / monitored item settings
Hello martenbyebye,
you can set the limits for the publishing interval in the server configuration.
see here:
http://documentation.unified-automation ... chema.html
The place where you can set the minimum SamplingInterval depends on which level of the SDK you add your implementation (SDK layer or Toolkit layer). See here for overview:
http://documentation.unified-automation ... ction.html
1) On Toolkit level (your NodeManager is a subclass of BaseNodeManager):
override StartDataMonitoring and set the SamplingInterval. e.g.
2) On SDK Level (your implementation inherits / implements IIOManager):
You call StartDataMonitoringCompleteEventHandler in your implementatio and set the RevidedSamplingInterval there.
you can set the limits for the publishing interval in the server configuration.
see here:
http://documentation.unified-automation ... chema.html
The place where you can set the minimum SamplingInterval depends on which level of the SDK you add your implementation (SDK layer or Toolkit layer). See here for overview:
http://documentation.unified-automation ... ction.html
1) On Toolkit level (your NodeManager is a subclass of BaseNodeManager):
override StartDataMonitoring and set the SamplingInterval. e.g.
Code: Select all
if (settings.RequestedParameters.SamplingInterval < 2000)
{
settings.RequestedParameters.SamplingInterval = 2000;
}
You call StartDataMonitoringCompleteEventHandler in your implementatio and set the RevidedSamplingInterval there.
Best regards
Unified Automation Support Team
Unified Automation Support Team
-
- Hero Member
- Posts: 21
- Joined: 03 Mar 2017, 16:08
Re: overwrite subscription / monitored item settings
Thank you Support Team,
I am now successfully changing the properties, i.e. using UaExpert I can see the revised settings . But my test code seems to be wrong.
Where is the revised SamplingInterval?
I am now successfully changing the properties, i.e. using UaExpert I can see the revised settings . But my test code seems to be wrong.
Where is the revised SamplingInterval?
Code: Select all
var monitoredItems = new List<MonitoredItem>
{
new DataMonitoredItem(nodeId) { SamplingInterval = desiredSamplingInterval }
};
var statusCodes = this.subscription.CreateMonitoredItems(
monitoredItems,
new RequestSettings { OperationTimeout = 10000, MaxOperationsPerRequest = ushort.MaxValue, });
foreach (var monitoredItem in this.subscription.MonitoredItems)
{
monitoredItem.SamplingInterval.ShouldBe(correctRevisedSamplingInterval); // This fails.
}
-
- Full Member
- Posts: 6
- Joined: 24 Sep 2019, 07:43
Re: overwrite subscription / monitored item settings
Can you please give an example for overriding StartDataMonitoring() method in example GettingStarted.Lesson3 ?