Good afternoon. We recently acquired Quick OPC and have been attempting to use the SDK to link up a simple UI.
While working with the software, we were using the UAMonitoredItemChangedObservable to monitor for changes. We used the collection of multiple arguments to subscribe to multiple items. However, the subscription does not appear to respect the sample rate passed to it. We can compare this to the MonitoredItemChanged event approach and that seems to work fine.
We declare the arguments as follows:
UAMonitoredItemArgumentsCollection analogCollection = new UAMonitoredItemArgumentsCollection
{
new UAMonitoredItemArguments(null, endpoint, "ns=6;s=::AsGlobalPV:b_wlcFbk.WT_2612", new UAMonitoringParameters(10)),
new UAMonitoredItemArguments(null, endpoint, "ns=6;s=::AsGlobalPV:b_wlcFbk.WT_2613", 100)
};
We then create the subscription as follows:
var observable = UAMonitoredItemChangedObservable.Create<T>( analogCollection );
Finally we have a collection of objects using the observable that has been passed into their constructor and create a subscription to that observable.
private IObservable<UAAttributeData<T>> GetFilteredObservable(string nodeId, UAMonitoredItemChangedObservable<T> itemChangedObservable)
{
return itemChangedObservable
.Where(e => e.Exception == null)
.Where(i => i.TypedAttributeData != null)
.Where(i => i.Arguments.NodeDescriptor.NodeId == nodeId)
.Select(i => i.TypedAttributeData);
}
private void StartSubscription()
{
if (CanMonitor) _subscription = _itemChangedObservable.Repeat().Subscribe(OnNext);
}
What happens is the behavior seems to work, except the sampling rate is much lower. It seems fixed at 1000ms instead of the desired 100ms that is requested.
How might we correct this issue?
Thanks!