Please ensure Javascript is enabled for purposes of website accessibility
Powered by Zoomin Software. For more details please contactZoomin

AF SDK Reference

AFAttributeValueQuery Structure

  • Last UpdatedNov 18, 2025
  • 5 minute read
AFAttributeValueQuery Structure
Attribute value search query structure.

Namespace:  OSIsoft.AF.Asset
Assembly:  OSIsoft.AFSDK (in OSIsoft.AFSDK.dll) Version: 3.1.1.1182

Syntax

[SerializableAttribute]
public struct AFAttributeValueQuery : IEquatable<AFAttributeValueQuery>
<SerializableAttribute>
Public Structure AFAttributeValueQuery
	Implements IEquatable(Of AFAttributeValueQuery)

Dim instance As AFAttributeValueQuery
[SerializableAttribute]
public value class AFAttributeValueQuery : IEquatable<AFAttributeValueQuery>
[<SealedAttribute>]
[<SerializableAttribute>]
type AFAttributeValueQuery =  
    struct
        interface IEquatable<AFAttributeValueQuery>
    end

The AFAttributeValueQuery type exposes the following members.

Constructors

  NameDescription
Public method
AFAttributeValueQuery(AFAttributeTemplate, AFSearchOperator, Object)
Creates a new instance of the AFAttributeValueQuery structure without specifying a UOM for the value.
Public method
AFAttributeValueQuery(AFAttributeTemplate, AFSearchOperator, Object, UOM)
Creates a new instance of the AFAttributeValueQuery structure with a UOM specified for the value.

Properties

  NameDescription
Public property
AttributeTemplate
The AFAttributeTemplate used to determine the attribute's value to be compared.
Public property
AttributeUOM
The UOM of the for the specified AttributeValue.
Public property
AttributeValue
The value to be compared to the attribute's value.
Public property
Operator
The operator used when comparing the attribute's value.

Methods

  NameDescription
Public method
Equals(Object)
Determines whether the specified Object is equal to the current object.
(Overrides ValueTypeEquals(Object).)
Public method
Equals(AFAttributeValueQuery)
Indicates whether the current object is equal to another object of the same type.
Public method
GetHashCode
Gets the hash code for this instance of the object which is suitable for use in hashing algorithms and data structures like a hash table.
(Overrides ValueTypeGetHashCode.)
Public method
GetType
Gets the Type of the current instance.
(Inherited from Object.)
Public method
ToString
Returns a String that represents the current object.
(Overrides ValueTypeToString.)

Operators

  NameDescription
Public operatorStatic member
Equality
The equality operator (==) compares its operands to determine if they are equal.
Public operatorStatic member
Inequality
The inequality operator (!=) compares its operands to determine if they are not equal.

Remarks

This structure describes the query used for finding AFElements using the AFElement.FindElementsByAttribute method or finding AFEventFrames using one of the AFEventFrame.FindEventFramesByAttribute Overload methods. The value of the AFAttribute which corresponds to the AttributeTemplate in the query is compared to the query's AttributeValue using the search Operator.

The Type property of the attribute template determines the type of value to be queried, therefore the type must be defined and not set to a type of Object. Any AFAttributeTemplate with a DefaultUOM specified must be of type Single or Double. If a DefaultUOM is not specified in the template for one of these types, then the search will be performed using the specified attribute value as being in the canonical units-of-measure which could cause unexpected results to be returned. The following table shows which AFSearchOperator is supported for each type of value being queried:

TypeEqualNotEqualLessThanGreaterThanLessThanOrEqualGreaterThanOrEqualIn
BooleanYesYesNoNoNoNoYes
UInt64YesYesNoNoNoNoYes
StringYesYesNoNoNoNoYes
GuidYesYesNoNoNoNoYes
SingleYesYesYesYesYesYesNo
DoubleYesYesYesYesYesYesNo
All OthersYesYesYesYesYesYesYes

When the Type property of the AFAttributeTemplate is String, search performance can be improved by marking the AFAttributeTemplate as being indexed by setting the IsIndexed property. Also, the following restrictions are placed on the string length of the attribute value used in the query:

IsIndexedOperatorLength Limit
Equal or NotEqual40 characters
In40 characters
Equal or NotEqualNo limit
In4096 characters when using PI AF Server 2.6 or greater; otherwise 40 characters

Version Information

AFSDK


See Also

TitleResults for “How to create a CRG?”Also Available in