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

AF SDK Reference

PI SDK Equivalents

  • Last UpdatedNov 18, 2025
  • 10 minute read
PI SDK Equivalents

This section can be used by developers who are familiar with the PI SDK and are looking for comparable classes, methods, and properties in the AF SDK.

This topic contains the following sections:

Class mapping

The majority of PI SDK equivalent classes are found in the AF SDK's OSIsoft.AF.Data and OSIsoft.AF.PI namespaces. The time equivalent functions of the PI Time Server library of PI SDK is found in the OSIsoft.AF.Time namespace.

PI SDK

AF SDK

Comment

CollectiveMember

OSIsoft.AF.PIPICollectiveMember

CollectiveMembers

OSIsoft.AF.PIPICollectiveMembers

DigitalState

AFEnumerationValueValue

Conversion in AF SDK will depend on the type specified for the AF Attribute. If no type is specified, or, if the value returned is a system digital state, the value will become an enumeration value associated with one of the StateSets on the PIServer.

IClockSource

OSIsoft.AF.TimeIAFTimeSource

IAFTimeSource is implemented on PIServer, PISystem, and AFAttribute.

IPICalculation

OSIsoft.AF.DataAFCalculation

IPICalculation is available as secondary interface on PI SDK's Server class, whereas the AFCalculation is a static class whose target can be specified in the individual methods.

IPICollective

OSIsoft.AF.PIPICollective

PI SDK IPICollective is secondary interface on its Server while the AF SDK is a member variable of PIServer.

IPIPersist

OSIsoft.AFIPIPersist

The interface is defined the same (including the interface IID), however, for AF SDK, it is preferable to restore using OSIsoft.AFAFGlobalRestorer.

EventPipe

OSIsoft.AF.PIPIDataPipe, OSIsoft.AF.DataAFDataPipe, PIServerFindChangedPIPoints

PI SDK polls for data pipe updates in background. AF SDK users must poll themselves. The FindChangedPIPoints method is used for tracking point changes.

ListData

OSIsoft.AF.DataAFListData

PI SDK's ListData methods are accessed from PointList. AF SDK's AFListData methods are accessed from AFAttributeListData. List methods are also directly available from the OSIsoft.AF.PIPIPointList class.

PIAnnotation

OSIsoft.AF.DataAFAnnotation

Annotations are retrieved and set in AF via AFValue.GetAnnotation and AFValue.SetAnnotation.

PIAnnotations

OSIsoft.AF.DataAFAnnotations

Annotations are retrieved and set in AF via AFValue.GetAnnotation and AFValue.SetAnnotation.

PIData

OSIsoft.AF.DataAFData

PI SDK's PIData is accessed from PIPoint.Data. AF SDK's AFData is accessed from AFAttributeData. Data methods are also directly available from the OSIsoft.AF.PIPIPoint class.

PIError(s)

OSIsoft.AFAFErrorsTKey

AF uses the generic classes AFListResultsTKey, TResult and AFKeyedResultsTKey, TResult to provide general mechanism for returning multiple results and errors to a single method. The AFErrorsTKey is a base class for these two result lists.

PIPoint

OSIsoft.AF.PIPIPoint

PIPoints

N/A

AF SDK only returns points as an enumerable result of a search. Methods for adding and removing points are found on the PIServer object. Methods for finding PI Points are defined as statics on the PIPoint object.

PIValue

OSIsoft.AF.AssetAFValue

PIValues

OSIsoft.AF.AssetAFValues

PointAttribute(s)

IDictionary

Point Attributes in AF are generally returned and created through an IDictionary or individually by name lookup.

PointClass

OSIsoft.AF.PIPIPointClass

AF SDK PIPointClass is read-only

PointClasses

OSIsoft.AF.PIPIPointClasses

AF SDK Does not yet allow point classes to be added or removed.

PointValues(s)

OSIsoft.AFAFListResultsTKey, TResult or OSIsoft.AFAFKeyedResultsTKey, TResult.

AF uses the generic classes AFListResultsTKey, TResult and AFKeyedResultsTKey, TResult to provide general mechanism for returning multiple results and errors to a single method. In addition, an AFValue contains the properties AFValueAttribute and AFValuePIPoint to point back to the originating AFAttribute or PIPoint.

PITime, PITimeFormat, DynamicTime, TimeInterval

OSIsoft.AF.TimeAFTime, OSIsoft.AF.TimeAFTimeSpan, OSIsoft.AF.TimeAFTimeIntervalDefinition

Classes do not map one-to-one, but most functionality provided in the PI SDK Time Library is available via AF SDK.

PITimeZoneInfo

OSIsoft.AF.TimeAFTimeZone

The class OSIsoft.AF.TimeAFTimeZoneFormatProvider also provides additional mechanisms for translating time strings in any culture and language.

Server

OSIsoft.AF.PIPIServer

Servers

OSIsoft.AF.PIPIServers

ServerManager

N/A

AF SDK automatically implements the equivalent implementation of PI SDK's ServerManager. When creating a top level PIServers collection, the AF SDK will automatically create an independent PI hierarchy and server connections based on the user identity.

StateSet

OSIsoft.AF.AssetAFEnumerationSet

A list of State States defined on a PI Data Archive is available on the StateSets property of the PIServer. The state set for a digital PI Point can be also retrieved using PIPointGetStateSet.

PIData, AFData, and AF's PIPoint

The PI SDK's PIData class, which is available from the PIPoint.Data property, has an equivalent class, OSIsoft.AF.DataAFData, which is available from the AFAttributeData property. The AF SDK's OSIsoft.AF.PIPIPoint class also provides these methods directly for non-attribute based data access.

PISDK.PIData

OSIsoft.AF.Data.AFData

OSIsoft.AF.PI.PIPoint

Comment

ArcValue

RecordedValue, InterpolatedValue, RecordedValueAsync, InterpolatedValueAsync

RecordedValue, InterpolatedValue, RecordedValueAsync, InterpolatedValueAsync

AFAttributeGetValue(AFTime) provides similar functionality as well. The name RecordedValue and InterpolatedValue used by AF SDK provide similar mappings as to the plural names.

ArchiveEventPipe

N/A

see OSIsoft.AF.PIPIDataPipe

The OSIsoft.AF.PIPIDataPipe class provides this functionality for PI Points. The equivalent property is not available on individual PI Points and AFAttributes as the data pipe should be shared amongst many points and attributes.

EventPipe

see OSIsoft.AF.DataAFDataPipe

see OSIsoft.AF.PIPIDataPipe

The OSIsoft.AF.PIPIDataPipe class provides this functionality for PI Points. The equivalent property is not available on individual PI Points and AFAttributes as the data pipe should be shared amongst many points and attributes.

FilteredSummaries

FilteredSummaries, FilteredSummariesAsync

FilteredSummaries, FilteredSummariesAsync

PercentGood is returned as a summary type, and not through the named values collection. Only a single time stamp per summary is returned, however the caller can specify how that time stamp is calculated via OSIsoft.AF.DataAFTimestampCalculation.

InterpolatedValues

AFAttributeGetValues

InterpolatedValuesByCount, InterpolatedValuesByCountAsync

A PI SDK InterpolatedValues equivalent method (range and count define time span) is only provided through the GetValues call at the AFAttribute level. It is not provided directly on AFData as it is preferable to use the InterpolatedValues2 mechanism (time span and range define count with a partial interval possible).

InterpolatedValues2

InterpolatedValues, InterpolatedValuesAsync

InterpolatedValues, InterpolatedValuesAsync

The more common use case (time span and range define count with a partial interval possible) is defined as InterpolatedValues in AF SDK

PlotValues

PlotValues, PlotValuesAsync

PlotValues, PlotValuesAsync

No difference

RecordedValues

RecordedValues, RecordedValuesAsync

RecordedValues, RecordedValuesAsync

The AF SDK also allows a maximum number of events to be specified.

RecordedValuesByCount

RecordedValuesByCount, RecordedValuesByCountAsync

RecordedValuesByCount, RecordedValuesByCountAsync

No difference

RemoveValues

UpdateValue, UpdateValues, UpdateValuesAsync

UpdateValue, UpdateValues, UpdateValuesAsync

The AF SDK does not explicitly expose this method, but rather, uses the AFUpdateOptionRemove option with the UpdateValue and UpdateValues methods to remove existing events.

ReplaceValue

ReplaceValues, ReplaceValuesAsync

ReplaceValues, ReplaceValuesAsync

PI SDK ReplaceValue method is used to replace a single event when multiple events exist at the same timestamp in PI Data Archive. The caller specifies a pair of events i.e. OldValue (existing event in PI Data Archive) and NewValue (replacement event) with matching timestamp. If existing event has Annotation then the Annotation will remain (only value is replaced).

For the case of AF SDK ReplaceValues, the caller specifies OSIsoft.AF.TimeAFTimeRange and OSIsoft.AF.AssetAFValues, where all existing events within the input time range will be deleted and replaced with the input events. Hence, to replace a single event when multiple events exist at the same timestamp in PI Data Archive with AF SDK ReplaceValues (to mimic PI SDK ReplaceValue functionality), the caller has to include existing events (with Annotation, if exists) to keep, in addition to the replacement event (with Annotation, if exists and want to keep it), in the input values list, and specify input time range where starttime/endtime are equivalent (correspond to the event timestamp).

It should be noted that there are some functional differences (related to replacing or deleting events) between AF SDK UpdateValues method and ReplaceValues method. When replacing events through UpdateValues method (with Replace mode), the replacement is done based on event timestamp. So if there are existing events with the same timestamp in PI Data Archive then only one will be replaced. On the other hand, ReplaceValues method (with specified input events) will delete all existing events within input time range and write the new replacement values. Hence, all existing archived events with the same timestamp will be deleted/replaced. When deleting events through UpdateValues method (with Remove mode), one needs to first get the existing archived events to be deleted from PI Data Archive, then make the UpdateValues call with those events. So it’s a two-step process. On the other hand, ReplaceValues method (with empty list as input values) will delete all values within the input timeRange, in one call to PI Data Archive. Hence, one does not need to pre-get the existing archived events to be deleted.

RetrievalAttributes

N/A

N/A

This property is no longer necessary. Status bits (Questionable, Substituted, and Annotated) are always retrieved. Annotations are retrieved via AFValueGetAnnotation

Snapshot

AFAttributeGetValue, EndOfStream, EndOfStreamAsync

CurrentValue, EndOfStream, EndOfStreamAsync

Snapshot is available through AF Attribute via GetValue in the AFAttribute class or via EndOfStream in the AFData class. Through PI Point, it is mapped to CurrentValue and EndOfStream. While PI SDK exposes snapshot as a property, in AF SDK it is always a method to indicate it has a cost of an RPC to the PI Data Archive.

Summaries

N/A

Summaries

The PI SDK Summaries method is not provided on AFData. The Summaries2 mechanism is preferred.

Summaries2

Summaries, SummariesAsync

Summaries, SummariesAsync

PercentGood is returned as a summary type, and not through the named values collection. Only a single time stamp per summary is returned, however the caller can specify how that time stamp is calculated via OSIsoft.AF.DataAFTimestampCalculation.

Summary

Summary, SummaryAsync

Summary, SummaryAsync

All summaries can be returned in a single call in AF SDK.

TimedValues

InterpolatedValuesAtTimes, InterpolatedValuesAtTimesAsync

InterpolatedValuesAtTimes, InterpolatedValuesAtTimesAsync

Renamed for clarity.

UpdateValue

UpdateValue

UpdateValue

To set an annotation in AF SDK, use AFValueSetAnnotation followed by a call to UpdateValue.

UpdateValues

UpdateValues, UpdateValuesAsync

UpdateValues, UpdateValuesAsync

To set multiple annotations in the AF SDK, use AFValueSetAnnotation calls followed by a call to UpdateValues. Note that there are additional methods in AF SDK which allow for setting multiple values at multiple timestamps of multiple attributes and points: AFListDataUpdateValues and PIServerUpdateValues.

Also note that the supported modes defined in PI SDK MergeType are equivalent to AF SDK i.e. OSIsoft.AF.DataAFUpdateOption, with the exception of PI SDK dmReplaceOnlyDuplicates and dmErrorDuplicates (not supported by AF SDK). They require an additional call to the PI Data Archive to verify the presence or absence of events at the passed time.

ListData, AFListData, and AF's PIPointList

The PI SDK's ListData class is used to make bulk calls to multiple PI Points, and is available from the PointList.Data property. The AF SDK equivalent class is OSIsoft.AF.DataAFListData, which is available from the AFAttributeListData property. The AF SDK's OSIsoft.AF.PIPIPointList class also provides these methods directly for non-attribute based data access to PI Points.

In addition to the methods listed below, the OSIsoft.AF.PIPIPointList has methods for resolving PI Point paths in bulk, as well as loading, retrieving, saving, and unloading PI Point Attributes in bulk.

PISDK.ListData

OSIsoft.AF.Data.AFListData

OSIsoft.AF.PI.PIPointList

Comment

ArcValue

RecordedValue, InterpolatedValue, RecordedValueAsync, InterpolatedValueAsync

RecordedValue, InterpolatedValue, RecordedValueAsync, InterpolatedValueAsync

AFAttributeListGetValue(AFTime) provides similar functionality as well.

ArchiveEventPipe

see OSIsoft.AF.DataAFDataPipe

see OSIsoft.AF.PIPIDataPipe

The OSIsoft.AF.DataAFDataPipe class provides this functionality for AF Attributes. The OSIsoft.AF.PIPIDataPipe class provides this functionality for PI Points. The equivalent properties are not available on individual PI Points and AFAttributes as the data pipe should be shared amongst many points and attributes. Instead, construct a data pipe and pass the list to the data pipe.

EventPipe

see OSIsoft.AF.DataAFDataPipe

see OSIsoft.AF.PIPIDataPipe

The OSIsoft.AF.DataAFDataPipe class provides this functionality for AF Attributes. The OSIsoft.AF.PIPIDataPipe class provides this functionality for PI Points. The equivalent properties are not available on individual PI Points and AFAttributes as the data pipe should be shared amongst many points and attributes. Instead, construct a data pipe and pass the list to the data pipe.

RetrievalAttributes

N/A

N/A

This property is no longer necessary. Status bits (Questionable, Substituted, and Annotated) are always retrieved. Annotations are retrieved via AFValueGetAnnotation

Snapshot

AFAttributeListGetValue, EndOfStreamAsync

CurrentValue, EndOfStream, EndOfStreamAsync

Snapshot is available via GetValue or via EndOfStream in the AFAttributeList class. Through PIPointList, it is mapped to CurrentValue and EndOfStream. While PI SDK exposes snapshot as a property, in AF SDK it is always a method to indicate it has a cost of an RPC to the PI Data Archive.

N/A

UpdateValues

PIServerUpdateValues

PI SDK does not support writing multiple values to multiple PI Points.

N/A

FilteredSummaries

FilteredSummaries

PI SDK does not support bulk data access methods.

N/A

InterpolatedValues

InterpolatedValues

PI SDK does not support bulk data access methods.

N/A

InterpolatedValuesAtTimes

InterpolatedValuesAtTimes

PI SDK does not support bulk data access methods.

N/A

PlotValues

PlotValues

PI SDK does not support bulk data access methods.

N/A

RecordedValues

RecordedValues

PI SDK does not support bulk data access methods.

N/A

RecordedValuesByCount

RecordedValuesByCount

PI SDK does not support bulk data access methods.

N/A

Summaries

Summaries

PI SDK does not support bulk data access methods.

N/A

Summary

Summary

PI SDK does not support bulk data access methods.

IPICalculation, and AFCalculation

The PISDK provides an interface on a Server, IPICalculation, for evaluating Performance Equation (PE) calculations. AF provides a static class, OSIsoft.AF.DataAFCalculation, for performing the same operations. However, in AF, the target of calculation does not have to be a server, but rather, can be an AF Element or Database, making the same calculation over many different elements.

Note that asynchronous calls are not yet available from the AF SDK. However, it is possible to make multi-threaded calls via the AF SDK via the same objects using the same connection to the PI Data Archive server.

PISDK.IPICalculation

OSIsoft.AF.Data.AFCalculation

Comment

Calculate

CalculateAtIntervals, CalculateAtRecordedValues

The AF SDK uses two different methods as the original PI SDK method had non-overlapping parameters for each purpose.

ExpressionSummaries

CalculateSummaries

Improved name.

PercentTrue

PercentTrue

TimedCalculate

CalculateAtTimes

Improved name.

N/A

ConvertExpressionTarget, ConvertFilterTarget

Converts expressions from one target to another.

In This Topic
Related Links
TitleResults for “How to create a CRG?”Also Available in