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.

any examples of filters or patterns?

More
15 Jan 2013 07:33 #1177 by support


On the EasyDAClient object, there are overloads of browsing methods accept a parameter of type DANodeFilter, which can be filled in with various pieces that limit the amounf of nodes returned:

- ElementNameFilter: A wildcard string to filter the returned element names (empty string for no filtering).
- VendorFilter: A server specific filter string (empty string for no filtering).
- DataTypeFilter: Specifies to only return nodes of certain data type. Use Empty for no filtering.
- AccessRightsFilter: Specifies to only return nodes with certain access rights. Use None for no filtering.


Some OPC servers have large address space, with hundreds or thousand nodes (branches or leaves) under a parent node. If this is to be displayed to the user, it might be too many nodes for the human to reasonably work with - or also, internally too much data to transfer. The OPC Specification therefore allows the sub-nodes be filtered (limited) according to various criteria.
To make it even easier, there are also overloads of browsing methods that simply take parts of the complete filter (such as ElementNameFilter and/or VendorFilter), so you do not need to bother with the DANodeFilter object at all, usually.
I think that your question was mainly about the ElementNameFilter and VendorFilter, so I will describe them here.
The ElementNameFilter has a syntax that is dictated by the OPC specification, is the same for all servers, and behaves like Visual Basic LIKE operator. Here is the most important part of the spec for it:

The pattern-matching features allow you to use wildcard characters, character lists, or character ranges, in any combination, to match strings. The following table shows the characters allowed in pattern and what they match:





Characters in pattern


Matches in string




?


Any single character.




*


Zero or more characters.




#


Any single digit (0-9).




[charlist]


Any single character in charlist.




[!charlist]


Any single character not in charlist.





A group of one or more characters (charlist) enclosed in brackets ([ ]) can be used to match any single character in string and can include almost any charcter code, including digits.
For example, "A*" means any node that starts with letter 'A'.
The VendorFilter is completely different - the meaning of it is defined by the OPC server itself. Consult the server's documentation for information about how your OPC server iterprets the vendor filtr. Many server will simply ignore it, or imterpret it the same as ElementNameFilter - in which case it won't bring you any extra value.
With this in hand, if you need a concrete code example, lwr me know what precisely your are after, and we can work on it.
Best regards,
Zbynek Zahradnik



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

More
14 Jan 2013 21:31 #1176 by bjh
i have not been able to find any examples of 'branch/leaf/vendor filter' or 'name pattern' usage when browsing an opc server. when and how would these be used, and are there some examples in the documentation {i didn't see any but maybe i missed them}? i did see an example of node filtering, but it defaulted to no filtering.
thank you.

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

Moderators: support
Time to create page: 0.044 seconds