AFAttributeValueQuery Structure
- Last UpdatedNov 18, 2025
- 5 minute read
- PI System
- AF SDK 2024 R2
- Developer
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
| Name | Description | |
|---|---|---|
| AFAttributeValueQuery(AFAttributeTemplate, AFSearchOperator, Object) |
Creates a new instance of the AFAttributeValueQuery structure without
specifying a UOM for the value.
| |
| AFAttributeValueQuery(AFAttributeTemplate, AFSearchOperator, Object, UOM) |
Creates a new instance of the AFAttributeValueQuery structure with a
UOM specified for the value.
|
Properties
| Name | Description | |
|---|---|---|
| AttributeTemplate |
The AFAttributeTemplate used to determine the attribute's value
to be compared.
| |
| AttributeUOM |
The UOM of the for the specified AttributeValue.
| |
| AttributeValue |
The value to be compared to the attribute's value.
| |
| Operator |
The operator used when comparing the attribute's value.
|
Methods
| Name | Description | |
|---|---|---|
| Equals(Object) |
Determines whether the specified Object is equal to the current object.
(Overrides ValueTypeEquals(Object).) | |
| Equals(AFAttributeValueQuery) |
Indicates whether the current object is equal to another object of the same type.
| |
| 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.) | |
| GetType | Gets the Type of the current instance. (Inherited from Object.) | |
| ToString |
Returns a String that represents the current object.
(Overrides ValueTypeToString.) |
Operators
| Name | Description | |
|---|---|---|
| Equality |
The equality operator (==) compares its operands to determine if they are equal.
| |
| 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:
| Type | Equal | NotEqual | LessThan | GreaterThan | LessThanOrEqual | GreaterThanOrEqual | In |
|---|---|---|---|---|---|---|---|
| Boolean | Yes | Yes | No | No | No | No | Yes |
| UInt64 | Yes | Yes | No | No | No | No | Yes |
| String | Yes | Yes | No | No | No | No | Yes |
| Guid | Yes | Yes | No | No | No | No | Yes |
| Single | Yes | Yes | Yes | Yes | Yes | Yes | No |
| Double | Yes | Yes | Yes | Yes | Yes | Yes | No |
| All Others | Yes | Yes | Yes | Yes | Yes | Yes | Yes |
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: