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.

Most Efficient Way To Manage A Large Number Of OPC Items

More
15 Jul 2021 09:47 #9992 by support
Hello.
This is very good question.

You can use SubscribeMultipleItems and SubscribeItem calls interchangeably. And, functionally, the end result (how the subscriptions work once they are established) will be equivalent, no matter which combination you use to establish the subscriptions. Same applies to unsubscribing.

But, there will be performance differences with regard to the time needed to perform the "subscribe" or "unsubscribe". When you make more method calls (on the QuickOPC API level), you end up with more function calls on OPC COM/DCOM level. And each such call has its own latency/processing time. But the OPC functions are designed in such a way that multiple subscriptions/unsubscriptions can be performed using one call. So, making 100 calls with 1 item each is going to take longer than 1 call with 100 items in it. For this reason, if the items you want to subscribe to (unsubscribe from) are available to you at once (and do not come in, time-wise, one by one), it is recommended that you use SubscribeMultipleItems, with large/larger number of items in it, and not individual SubscribeItem calls.

Note: SubscribeItem is just a short wrapper around SubscribeMultipleItems which passes in an array of one element, for ease of use. What matters is the number of items in the call, not the method name.

Best regards
The following user(s) said Thank You: Bishop

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

More
15 Jul 2021 09:11 #9991 by Bishop
My team and I are in the process of optimizing the way in which our application subscribes to OPC items. We store metadata for N tags and read that data into our application on startup. We then subscribe to the equivalent OPC items on the server and begin listening to the EasyDAItemChangedEventArgs indefinitely. If any new tags are added to our local store, we would like to subscribe to the equivalent OPC Items on the server and if any of our locally stored tag values are removed we would like to unsubscribe from the equivalent OPC Items on the server.

Is there any advantage to batching our subscriptions, such as is done in the Subscribe to large number of items example, on startup? Or can the SubscribeMultipleItems and SubscribeItem calls be used interchangeably? Is there any effective difference to how these subscriptions are handled on the OPC Server side?

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

Moderators: support
Time to create page: 0.041 seconds