Professional OPC
Development Tools

logos

Browsing for Item Attributes [OPC Properties]

More
22 Dec 2011 07:42 #729 by support

Zbynek,

Yes, I believe this is what I needed. Thanks!

R.

From: Zbynek Zahradnik
Sent: Wednesday, December 21, 2011 3:40 PM
To: R.
Subject: RE: Browsing for Item Attributes

R.,
I think that what you are referring to are OPC properties.

I wrote the text between <<<>>> below before reading your question again – and then I realized it was about the –COM component. I am keeping the text so that you can use it later.

Here is an answer that applies to COM:

1. Non-visual browsing: Use EasyDAClient.BrowseProperties method (see www.opclabs.com/onlinedocs/QuickOpcClassic/5.12/Reference/Qu...c35c4a758ca3d2e838e08016b5023b , and “Browsing for OPC Properties” in the Concepts document.

2. Visual browsing (UI): there is currently no such thing.

3. Getting property values: Use EAsyDAClient.GetPropertyValue and GetMultiplePropertyValues methods (see e.g. www.opclabs.com/onlinedocs/QuickOpcClassic/5.12/Reference/Qu...2f62977493314c278be1910205ebb1 , including an example, and “Getting OPC Property Values” in the Concepts document

<<<<<<<<<<<<<<<<< HERE IS THE TEXT THAT APPLIES TO .NET ::::

There are following ways we can work with them:

1. Non-visual browsing: Use EasyDAClient.BrowseProperties method (see www.opclabs.com/onlinedocs/QuickOpcClassic/5.12/Reference/Qu...6af-de04-86ae-35756959690c.htm , and “Browsing for OPC Properties” in the Concepts document.

2. Visual browsing (UI): Use OpcDAPropertyDialog class (see www.opclabs.com/onlinedocs/QuickOpcClassic/5.12/Reference/Qu...95b-ceda-0913-5631a7ca637b.htm , and “OPC-DA Property Dialog” in the Concepts document.

3. Getting property values: Use EAsyDAClient.GetPropertyValue and GetMultiplePropertyValues methods (see e.g. www.opclabs.com/onlinedocs/QuickOpcClassic/5.12/Reference/Qu...bde-41b3-cfc9-1641a748a4fd.htm , including examples, and “Getting OPC Property Values” in the Concepts document.

4. Starting with Version 5.12: There is plenty of new stuff related to OPC properties in the “extensions” assembly – I copy the part of the Concepts doc below:

Type-safe Access
With EasyOPC.NET Extensions, you can use type-safe methods that allow obtaining a value of an OPC property value already converted to the specified type, with methods such as EasyDAClient.GetPropertyValueInt32. There is such a method for each primitive type, named GetPropertyValueXXXX, where XXXX is the name of the type. Using these methods allows your code be free of unnecessary conversions.
A corresponding set of methods also exists for one-dimensional arrays of primitive types. Such methods are named GetPropertyValueArrayOfXXXX, where XXXX is the name of the element type. For example, EasyDAClient.GetPropertyValueArrayOfString will obtain a value of a property as an array of strings.

Well-known Properties
A common scenario is to work with well-known OPC properties. With EasyOPC.Net Extensions, you can quickly obtain a value of any well-known OPC property of a given OPC item, with methods such as EasyDAClient.GetDataTypePropertyValue. All these methods are named GetXXXXPropertyValue, where XXXX is the name of the property. The methods also check the value type and convert it to the type that corresponds to the property. For example, GetDataTypePropertyValue method returns a VarType, GetScanRatePropertyValue method returns a float, and GetDescriptionPropertyValue method returns a string.

Alternate Access Methods
The GetPropertyValueDictionary method allows you to obtain a dictionary of property values for a given OPC item, where a key to the dictionary is the property Id. You can pass in a set of property Ids that you are interested in, or have the method obtain all well-known OPC properties. You can then easily extract the value of any property by looking it up in a dictionary (as opposed to having to numerically index into an array, as with the base GetMultiplePropertyValues method).
The GetItemPropertyRecord method allows you to obtain a structure filled in with property values for a given OPC item. It can retrieve all well-known properties at once, or you can pass in a set of property Ids that you are interested in. You can then simply use the properties in the resulting DAItemPropertyRecord structure, without further looking up the values in any way.
The static DAPropertyIDSet class gives you an easy way to provide pre-defined sets of properties to the above methods. There are well-known sets such as the Basic property set, Extension set, or Alarms and Events property set. It also allows you to combine the property sets together (a union operation), with the Add method or the ‘+’ operator.


So, e.g. item deadband can be directly obtained using: www.opclabs.com/onlinedocs/QuickOpcClassic/5.12/Reference/Qu...e73-3469-58cc-065691a3d0d1.htm .
Or, the customer can get the whole “bag” of properties at once, using www.opclabs.com/onlinedocs/QuickOpcClassic/5.12/Reference/Qu...f16-5863-2861-b909c4607748.htm - there is a nice example there.
>>>>>>>>>>>>>>>>>>>>>>>>>


Best regards,
Zbynek Zahradnik

From: R.
Sent: Wednesday, December 21, 2011 8:54 PM
To: Zbynek Zahradnik
Subject: Browsing for Item Attributes

Hello Zbynek,

I have a potential customer who downloaded [...] I am not clear on whether the [QuickOPC-COM] can accomplish what he needs.

What he wants to do is write a client that can connect to Pi’s OPC interface to browse its address space for all available tags and their sub-attributes. Obviously the tag browsing is possible, but I don’t see from your documentation that it would be possible to return any of the other item attributes, such as the deadband, engineering units, etc. The SLIK-DAC does have this capability.

Is there a way to browse for more info beyond the ItemId and Name properties with you libraries?

Thanks in advance for your input.

R.

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

Moderators: support
Time to create page: 0.159 seconds

      

 Recommend this on Google