Professional OPC
Development Tools

logos

Online Forums

Technical support is provided through Support Forums below. Anybody can view them; you need to Register/Login to our site (see links in upper right corner) in order to Post questions. You do not have to be a licensed user of our product.

Please read Rules for forum posts before reporting your issue or asking a question. OPC Labs team is actively monitoring the forums, and replies as soon as possible. Various technical information can also be found in our Knowledge Base. For your convenience, we have also assembled a Frequently Asked Questions page.

Do not use the Contact page for technical issues.

Unsubscribe Multiple Items in Web Page

More
04 Jan 2018 09:20 #5806 by support
Yes, it should work. But there are some traps:

1. Are you creating just one EasyDAClient object, or more? The UnsubscribeAllItems method only unsubscribes those that were subscribed on the same object. Are you calling the UnsubscribeAllItems on the same instance as SubscribeMultipleItems?

2. If there are more EasyDAClient objects around and are used to connect to the same target server(s), then, unless they have their Isolated property set to 'true', they share the same connections, and therefore a subscription on one EasyDAClient client instance keeps the connection open even when the other client does UnsubscribeAll.

3. QuickOPC has so-called "hold periods". They are configurable, but in the default state, a connection will stay open 30 seconds after any "one-shot" operation (e.g. Read, Write), or 10 seconds after all items have been unsubscribed. Have you waited long enough before making a conclusion?

Best regards

Please Log in or Create an account to join the conversation.

More
03 Jan 2018 20:15 - 03 Jan 2018 20:26 #5804 by jmolina
Hi, I'm using Quick OPC 2017.1 in a ASP.NET MVC Application with c#.

The reads are made it by a subscription group to an OPC Server Matrikon OPC Simulation, this is the code. When the subscription is completed the number of clients connected to the OPC server is increased by 1.
EasyDAClient tempSuscrp = new EasyDAClient();
tempSuscrp.ItemChanged += new OpcLabs.EasyOpc.DataAccess.EasyDAItemChangedEventHandler(tempSuscrp_ItemChanged);
            var tempArray = new DAItemGroupArguments[4];
 
            tempArray[0] = new DAItemGroupArguments("", "Matrikon.OPC.Simulation.1", "MW450", 1000, true);
            tempArray[1] = new DAItemGroupArguments("", "Matrikon.OPC.Simulation.1", "MW452", 1000, true);
            tempArray[2] = new DAItemGroupArguments("", "Matrikon.OPC.Simulation.1", "MW454", 1000, true);
            tempArray[3] = new DAItemGroupArguments("", "Matrikon.OPC.Simulation.1", "MW456", 1000, true);
            tempSuscrp.SubscribeMultipleItems(tempArray);

Everything works fine but my problem happens when the user close the web page, then I execute the command UnsubscribeAllItems() for close the subscription.
tempSuscrp.UnsubscribeAllItems();

The problem is that the clients connections (from this subscription) are not stopped (see attached picture), I would expect that the number of clients connected to the OPC server should be decreased by 1.
Is there any other way to stop the subscription or I'am doing something bad?

Thanks and regards
Attachments:
Last edit: 03 Jan 2018 20:26 by jmolina.

Please Log in or Create an account to join the conversation.

Moderators: support
Time to create page: 0.047 seconds