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.

Getting data type in BrowseProperties vs GetPropertyValue

More
22 Sep 2014 11:48 #2326 by support
Thanks for more info.

Just to make it clear, the "Properties" window from Softing demo client (lower left corner of your picture) are *not* the OPC properties on the item. They are various pieces of info assembled together when the Softing client is reading or subscribing, and it's all available only *after* you "add" an item to the group (i.e. not really what you want to do).

If you wanted to see the true list of OPC properties on a given item using the Softing OPC demo client, you need to
  1. Switch to the "DA Browse" tab (at the bottom of the window)
  2. Navigate to an item and right-click on it
  3. Select Properties (F7).

You may then get something like this:





Best regards
Attachments:

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

More
22 Sep 2014 05:54 #2325 by johannduplessis
Hi,

Thanks for the answer! Yes part of the problem is that the OPC server is not working correctly as it's not connected to the plant network.

I'm attaching a screenshot displaying the problem:



At the top is the OPCLabs Demo Application showing the item that I'm trying to get the data type for. As you can see, when calling the normal GetPropertyValue method it returns null (in the green oval). However, when calling BrowseProperties it shows the correct data type (boolean in this case). This matches up to the data type returned by Softing's OPC client (shown at the bottom).

Fortunately, after running a test app through the night it seems that BrowseProperties is very efficient. I'm not sure why, but if I call it for every tag it returns the properties VERY quickly. I still have to test it with the whole dataset though.

If that doesn't work I'll try your sneaky idea, it sounds like it just may work.

Thanks!
Attachments:

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

More
22 Sep 2014 05:31 - 22 Sep 2014 05:33 #2323 by support
Normally, GetPropertyValue(or GetMultiplePropertyValues) with DAPropertyId.DataType should return the data type well. It looks like that it is the OPC server implementation which returns nothing in this case.

Can you verify this with some other OPC client? Or, as a last resort, we can employ the so-called OPC Analyzer to view the true communication between the client and the server.

If the server is not doing it well, and BrowseProperties is not an option either, I can hardly think of more workarounds. There is probably one, fairly sneaky, in terms of efficiency somewhere between BrowseProperties and GetPropertyValue/GetMultiplePropertyValues, and, again depending on the precise server behavior, it may or may not work: You can try calling BrowseLeaves repeatedly on each branch, passing it a filter that specifies certain data type, for all data types you are interested in. The idea is that if you have branches that have many items (leaves) in them, it is still far better to make one call (or a constant, small number of calls) to BrowseLeaves instead of BrowseProperties on every leaf.

Best regards
Last edit: 22 Sep 2014 05:33 by support.

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

More
21 Sep 2014 21:07 #2322 by johannduplessis
I'm in the process of writing an OPC client in C#2012 to download the entire namespace of an OPC server. However, in our test setup the OPC server is not connected to the actual plant, so the quality of all the tags are bad. It is possible to navigate through the structure using any OPC client and see the data type of the values (boo/string/etc). This is where my problem comes in:

- When using BrowseProperties I can retrieve this type (by looking at the DataType of the Value property).
- When using GetPropertyValue and specifying DAPropertyId.DataType (and GetMultiplePropertyValues, which is the function I actually want to use), I can't retrieve the type. The value returned is null and the DataType property in this case is null as well.

My question is, how can I retrieve the property type using GetMultiplePropertyValues in this case? BrowseProperties is much too slow as I need to retrieve the DataType of approximately 2.5million tags.

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

Moderators: support
Time to create page: 0.048 seconds