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.

How to use handles when using SubscribeMultipleMonitoredItems()

More
27 Aug 2021 14:04 #10158 by Restrepo

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

More
27 Aug 2021 13:41 #10157 by support
Hello,

the customer should pass his "tag" object as the State argument to the SubscribeXXXX call. The event notifications will then contain this State, and he will just typecast the State to the type of tag object, and he is done. No lookup is needed, based on integers or strings, so it is as fast as it can get. The handles should only be used for UnsubscribeXXXX (and ChangeXXXX) calls, and nothing else.

More information:

- opclabs.doc-that.com/files/onlinedocs/QuickOpc/Latest/User%2...0by%20an%20object%20state.html

- opclabs.doc-that.com/files/onlinedocs/QuickOpc/Latest/User%2...y%20subscribed%20entities.html

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

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

More
27 Aug 2021 13:01 #10156 by Restrepo
Hello Z,

I am currently working with a customer that is trying to update its local tag data structure whenever a value changes in the OPC UA Server. He used to do it with another toolkit by utilizing the handle return by the call as such:

mTags[handle].Value = e.Attribute.Value;

My question to you is, does the toolkit exposes the handles as System.Int32[]? The customer would like to use the integer for the indexing rather than using the NodeID.identifier String.

Could it be that we can use " e.Arguments.NodeDescriptor.NodeId.Identifier" as a way of identifying the tag that changed? Something like:

static void easyUAClient_DataChangeNotification(object sender, EasyUADataChangeNotificationEventArgs e)
{
mMyOPCTags[e.Arguments.NodeDescriptor.NodeId.Identifier].value = e.AttributeData.Value;
}

I just think that a string based index would not be as efficient though.


I tried to look in the documentation, but unfortunately, I failed to find any clues if this is possible with the toolkit so any guidance will be appreciated. Thank you.

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

Moderators: support
Time to create page: 0.048 seconds