How to delete monitored Items?

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

Moderator: uasdknet

Post Reply
gisTRON
Full Member
Full Member
Posts: 5
Joined: 11 Feb 2013, 13:35

How to delete monitored Items?

Post by gisTRON »

I have created a subscription and added some items to a monitoring list

Code: Select all

 // create monitored items.
    List<StatusCode> results = m_subscription.CreateMonitoredItems(
        monitoredItems,
        new RequestSettings() { OperationTimeout = 10000 });
Everything worked fine. After few minutes i deleted the subscription but did not delete the monitored items. Since the item is only simulated on the serverside the item/counter is still counting up. It is something like: if you query the value => value +=1;

1) How can i stop monitoring a specific item, after i have deleted the subscription and connection? Did not delete the monitoring items.
2) Is deleting the subscription

Code: Select all

subscription.Delete();
going to delete the monitored items too and free up the server? Release resources?
3) Is there any way to see, with my own client, who is monitoring specific items?

btw, here is the standard way how to delete monitored items: http://doc.unifiedautomation.com/uasdkd ... ple23.html

Randy
Jr. Member
Jr. Member
Posts: 4
Joined: 27 Mar 2013, 23:57

Re: How to delete monitored Items?

Post by Randy »

The MonitoredItems are deleted when the Subscription is deleted.

If you want to delete the MonitoredItems explicitly you can call Subscription.DeleteMonitoredItems before Subscription.Delete.

However, if that causes the Server to behave differently then you are seeing a bug in the Server.

User avatar
Support Team
Hero Member
Hero Member
Posts: 3068
Joined: 18 Mar 2011, 15:09

Re: How to delete monitored Items?

Post by Support Team »

Hi,

OPC UA defines already that a deletion of a subscription does automatically delete all monitored items created in the context of a subscription. Therefore the server is responsible to delete the monitored items if a subscription is deleted. The client side is only responsible for cleaning up it's own resources. This is automatically done by the .NET SDK when deleting the subscription.

Through OPC UA diagnostic nodes you can only see the number of monitored items created by all clients not which client created an individual monitored item. But it would be possible to expose such information in a custom OPC UA server.

Best Regards,
Unified Automation Support Team

Post Reply