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

AF SDK Reference

What's New in PI AF 2012

  • Last UpdatedNov 18, 2025
  • 5 minute read
What's New in PI AF 2012

The PI AF 2012 (2.5.0.5039, 2.5.1.5159, 2.5.2.5396) SDK now ships with both a .NET 3.5 version, as well as .NET 4 based version. The .NET 4 version of the AF SDK release contains support for new enhanced data access calls for all attributes. Data access to PI data from this version of AF no longer uses PI SDK to access the PI Data Archive. Note that any .NET 4 executable will automatically utilize the newer .NET 4 AF SDK regardless of which version was linked against.

This topic contains the following sections:

OSIsoft.AF Namespace

OSIsoft.AF.Asset Namespace

The property AFAttributeData provides access to the extended data calls for a single attribute. Likewise, the property AFAttributeListData provides access to the extended data calls for a list of attributes. Use of AFAttributeList for retrieving data from multiple attributes is critical for obtaining the best performance. An attribute exposes a new property AFAttributeSupportedDataMethods to determine what methods are supported for the attribute in its current configuration.

Access to the new built-in PIPoint class for .NET 4 applications is achieved through: AFAttributePIPoint. The property AFAttributeRawPIPoint will continue to retrieve the PISDK PIPoint object. The new property also allows for configuration of the PI Point Data Reference through a set accessor. Similarly, the AFAttributeListGetPIPoint is available for .NET 4 applications.

The method AFAttributeResetToTemplate provides the ability to reset an attributes data reference configuration and value back to its template default values. A new overload on the method AFAttributeFindAttributesByPath provides a more robust mechanism for retrieving multiple attributes and associating the results with the passed paths.

The property AFAttributeIsDynamic provides a mechanism to determine if an attribute is persisted in an AF Database. The property AFAttributeServerTimeSource provides access to the time source interface. Attributes from the same time source will have the same Id.

A new interface IAFAttribute is provided so that an application can use the same code to interface with both AFAttribute and AFAttributeTemplate classes. Data Reference developers should be aware that this interface will not be available in previous AF clients and thus should only be used with a Data Reference if all clients will be version 2.5 or later.

The AFDataReference class has many new members to support the new Rich Data Access (RDA) features. New methods and properties include: FilteredSummaries, GetAnnotation, InterpolatedValuesAtTimes, InterpolatedValuesByCount, SupportedDataMethods, PlotValues, RecordedValue, RecordedValues, RecordedValuesByCount, ServerTimeSource, Summaries, Summary, SupportedDataMethods, UpdateValue and UpdateValues. In addition, a new static method, GetPIPointDataReference provides for simple access to the standard PI Point Data Reference PlugIn.

The methods AFValuesSummary and AFValuesSummaries provide the ability to calculate summaries on values previously retrieved.

AFValue has been enhanced with several new features. AFValueAdditionalInfo is used to pass information back to a data reference for use in update value. It is not persisted. The property AFValuePIPoint provides access to the source PI Point for a retrieved value. The methods AFValueGetAnnotation and AFValueSetAnnotation provide access to PI structured and unstructured annotations.

A new overload on the method AFElementFindElementsByPath provides a more robust mechanism for retrieving multiple elements and associating the results with the passed paths.

OSIsoft.AF.Data Namespace

The OSIsoft.AF.Data namespace provides enhanced data access and calculation capabilities for attributes.

The class AFData provides extended access to historical data for a single attribute. Likewise, the class AFListData provides extended access to historical data for a list of attributes.

The class AFCalculation provides mechanisms to evaluate expressions on attributes.

The classes AFAnnotations and AFAnnotation are used to read and create pi structured annotations associated with PI Point event data.

The classes PIDataPipe and AFDataPipeEvent provides access to pi point data changes.

The following enumerations are used to control the behavior of the data access, calculation methods, and data pipes. AFBoundaryType, AFCalculationBasis, AFDataPipeAction, AFDataPipeType, AFRetrievalMode, AFSampleType, AFSummaryTypes, AFTimestampCalculation and AFUpdateOption.

OSIsoft.AF.EventFrame Namepace

A new overload for retrieving event frames by attribute value was added: AFEventFrameFindEventFramesByAttribute. A new overload on the method AFEventFrameFindEventFramesByPath provides a more robust mechanism for retrieving multiple elements and associating the results with the passed paths.

The property AFEventFramesKeepInMemory allows child event frames to be loaded and prevented from being Garbage Collected as long as the parent event frame remains in memory.

OSIsoft.AF.Notification Namepace

A new interface IAFNotificationContact is provided so that an application can use the same code to interface with both AFNotificationContact and AFNotificationContactTemplate classes.

OSIsoft.AF.PI Namepace

The OSIsoft.AF.PI namespace provides access to PI Data Archive specific classes and functions.

The classes PIServers, PIServer, PICollective, PICollectiveMembers, PICollectiveMember, PIConnectionInfo and PIAuthenticationOption are used to make connections to PI Data Archive servers and collectives.

PI Points can be accessed and configured with the classes PIPoint, PIPointClasses, PIPointClass, PICommonPointAttributes, PIPointType and PIPointQuery

Event Pipes for retrieving PI Data changes can be accomplished with the PIDataPipe class.

Various exceptions are used to return errors from a PI Data Archive. These include: PIConfigurationException, PIConnectionException, PIException, PIPointInvalidException, PISerializationException and PITimeoutException

OSIsoft.AF.Time Namepace

The interface IAFTimeSource is used retrieve the time and timezone from an PISystem, PIServer or AFAttribute.

The class AFTimeZoneFormatProvider provides a string formatter that can be used to read and write AFTime and AFTimeSpan as strings using the specified time zone.

The methods AFTimeConvertString, AFTimeGetAbbreviatedName and AFTimeGetName were added to facilitate time zone text conversions. The method AFTimeToPIPrecision returns an AFTime rounded to PI Data Archive precision (1/65536th of a second, or roughly 15.2 microseconds).

The methods AFTimeZoneLoadSystemTimeZones and AFTimeZoneSaveSystemTimeZones were added to facilitate moving time zone information between machines.

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