AFTransfer Class
- Last UpdatedNov 18, 2025
- 18 minute read
- PI System
- AF SDK 2024 R2
- Developer

Inheritance Hierarchy
OSIsoft.AFAFObject
OSIsoft.AF.AssetAFBaseElement
OSIsoft.AF.EventFrameAFEventFrame
OSIsoft.AF.EventFrameAFTransfer
Namespace: OSIsoft.AF.EventFrame
Assembly: OSIsoft.AFSDK (in OSIsoft.AFSDK.dll) Version: 3.1.1.1182
Syntax
[SerializableAttribute] public sealed class AFTransfer : AFEventFrame, IComparable<AFTransfer>
<SerializableAttribute> Public NotInheritable Class AFTransfer Inherits AFEventFrame Implements IComparable(Of AFTransfer) Dim instance As AFTransfer
[SerializableAttribute] public ref class AFTransfer sealed : public AFEventFrame, IComparable<AFTransfer^>
[<SealedAttribute>] [<SerializableAttribute>] type AFTransfer = class inherit AFEventFrame interface IComparable<AFTransfer> end
The AFTransfer type exposes the following members.
Constructors
| Name | Description | |
|---|---|---|
| AFTransfer(AFDatabase) |
Initializes a new instance of the class with default values.
| |
| AFTransfer(AFDatabase, String) |
Initializes a new instance of the class with the specified name.
| |
| AFTransfer(AFDatabase, String, AFElementTemplate) |
Initializes a new instance of the class with the specified name.
| |
| AFTransfer(AFDatabase, String, AFElementTemplate, AFAnalysis, Boolean) |
Initializes a new instance of the class with the specified name.
|
Properties
| Name | Description | |
|---|---|---|
| AcknowledgedBy |
This property indicates by whom the AFEventFrame was acknowledged.
(Inherited from AFEventFrame.) | |
| AcknowledgedDate |
This property indicates when the AFEventFrame was acknowledged.
(Inherited from AFEventFrame.) | |
| Analysis |
The AFAnalysis which created this object.
(Inherited from AFEventFrame.) | |
| AreValuesCaptured |
This property indicates whether the AFEventFrame has captured its
AFAttribute values.
(Inherited from AFEventFrame.) | |
| Attributes |
This is a collection of attributes that are owned by this element.
(Inherited from AFBaseElement.) | |
| CanBeAcknowledged |
This property indicates whether the AFEventFrame can be acknowledged.
(Inherited from AFEventFrame.) | |
| Categories |
This is a user-defined collection of categories for the object that can be used for
querying and/or reporting purposes.
(Inherited from AFBaseElement.) | |
| CategoriesString |
This read-only property returns the list of categories in a string separated by semicolons.
(Inherited from AFBaseElement.) | |
| CheckOutInfo |
This read-only property returns the checked out status information for the object.
| |
| Database |
This read-only property returns the AFDatabase where this object is defined.
(Inherited from AFBaseElement.) | |
| DefaultAttribute |
The default AFAttribute for the AFBaseElement.
(Inherited from AFBaseElement.) | |
| DefaultInputPort |
The default input AFPort for the AFBaseElement.
(Inherited from AFBaseElement.) | |
| DefaultOutputPort |
The default output AFPort for the AFBaseElement.
(Inherited from AFBaseElement.) | |
| DefaultUndirectedPort |
The default undirected AFPort for the AFBaseElement.
(Inherited from AFBaseElement.) | |
| Description |
Read/write property that provides a more detailed description of the object.
(Inherited from AFBaseElement.) | |
| Destination |
This read-only property returns the element that is the destination of the transfer.
| |
| DestinationPort |
This read-only property returns the port that is the destination of the transfer.
| |
| Duration |
This is a read-only property which returns the period's StartTime and
EndTime values as a time range.
(Inherited from AFEventFrame.) | |
| EndTime |
This read-only property represents the end time of the period.
(Inherited from AFEventFrame.) | |
| EventFrames |
This is a collection of child event frames that have been added to this event frame.
(Inherited from AFEventFrame.) | |
| ExtendedProperties |
A dictionary of extended properties that can be used to store application specific information.
(Inherited from AFBaseElement.) | |
| HasChildElements |
This read-only property returns if the event frame has child elements.
(Inherited from AFEventFrame.) | |
| HasChildEventFrames |
This read-only property returns if the event frame has child event frames.
(Inherited from AFEventFrame.) | |
| ID |
Read-only property that provides a unique identifier for the object to be used for
quick access that is not dependent upon the index.
(Inherited from AFObject.) | |
| Identity |
This read-only property contains identity of the object.
(Inherited from AFObject.) | |
| IsAcknowledged |
This property indicates whether the AFEventFrame has been acknowledged.
(Inherited from AFEventFrame.) | |
| IsAnnotated |
This property indicates whether this element has any annotations.
(Inherited from AFBaseElement.) | |
| IsDeleted |
This read-only property indicates whether the object has been deleted.
(Inherited from AFObject.) | |
| IsDirty |
This read-only property indicates whether the object has been modified since the
last save to the PI AF Server.
| |
| IsLocked |
This property indicates whether the AFEventFrame has been locked.
(Inherited from AFEventFrame.) | |
| IsNew |
This read-only property indicates whether the object is new and has never been saved
to the PI AF Server.
| |
| IsRoot |
This property indicates if the AFEventFrame is a root object owned by
the AFDatabase.
(Inherited from AFEventFrame.) | |
| IsTemporary |
This property indicates whether the AFEventFrame is temporary.
A temporary AFEventFrame cannot be saved to the server.
(Inherited from AFEventFrame.) | |
| Name |
Read/write property that identifies the name of the object.
(Inherited from AFBaseElement.) | |
| Parent |
This read-only property is returns the parent AFEventFrame that owns the event frame if it
is referenced by another event frame.
(Inherited from AFEventFrame.) | |
| Parents |
This is a collection of all AFEventFrame objects that reference this event frame.
(Inherited from AFEventFrame.) | |
| PISystem |
This read-only property allows access to the PISystem associated with this
object.
(Inherited from AFObject.) | |
| Ports |
This is a collection of AFPort objects representing the possible connection ports
for this element.
Ports are used in a AFModel to define an AFConnection
between AFBaseElement object.
(Inherited from AFBaseElement.) | |
| PrimaryReferencedElement |
The primary referenced AFElement associated with the event frame.
(Inherited from AFEventFrame.) | |
| ReferencedElements |
This is a collection of elements that are referenced by this event frame.
(Inherited from AFEventFrame.) | |
| Security |
This read-only property returns the AFSecurity information for the object.
| |
| Severity |
This is the severity level associated with the event.
(Inherited from AFEventFrame.) | |
| Source |
This read-only property returns the element that is the source of the transfer.
| |
| SourcePort |
This read-only property returns the port that is the source of the transfer.
| |
| StartTime |
This read-only property represents the start time of the period.
(Inherited from AFEventFrame.) | |
| Template |
The AFElementTemplate that was used to define this object.
(Inherited from AFBaseElement.) | |
| TimeRange |
This is a read-only property which returns the period's StartTime and
EndTime values as a time range.
(Inherited from AFEventFrame.) | |
| Type |
This read-only property specifies the base type of the element.
(Inherited from AFBaseElement.) | |
| UniqueID |
Read-only property that provides the object's ID as a String.
(Inherited from AFObject.) |
Methods
| Name | Description | |
|---|---|---|
| Acknowledge(String, NullableAFTime) |
Acknowledges a single AFEventFrame.
(Inherited from AFEventFrame.) | |
| ApplyChanges |
This method applies the changes to the object and makes
those changes available to other objects for the current user.
| |
| CaptureValues |
Capture and cache the AFAttribute values with a AFDataReference
using the default non-cached data provider.
(Inherited from AFEventFrame.) | |
| CaptureValues(IAFDataProvider) |
Capture and cache the AFAttribute values with a AFDataReference
using the specified IAFDataProvider.
(Inherited from AFEventFrame.) | |
| ChangeReferenceType |
Change the existing AFReferenceType between a child event frame.
(Inherited from AFEventFrame.) | |
| CheckIn |
This method checks in (commits) all the changes to the object by saving
the information to persistent storage.
| |
| CheckOut |
This method locks the object so that its configuration can be modified.
| |
| CheckOutTransfers |
Check out the objects with the specified unique identifiers at the specified query date.
| |
| CompareTo(Object) |
Compares this instance with a specified Object.
(Inherited from AFEventFrame.) | |
| CompareTo(AFEventFrame) |
Compares this instance with a specified AFEventFrame.
(Inherited from AFEventFrame.) | |
| CompareTo(AFObject) |
Compares this instance with a specified AFObject.
(Inherited from AFObject.) | |
| CreateElementTemplate |
Create an AFElementTemplate based upon the element.
(Inherited from AFBaseElement.) | |
| Delete |
Deletes this event frame from the AFDatabase.
(Inherited from AFEventFrame.) | |
| DeleteTransfers |
Delete the objects with the specified unique identifiers.
| |
| Equals(Object) |
Determines whether the specified Object is equal to the current object.
(Inherited from AFEventFrame.) | |
| Equals(AFEventFrame) |
Indicates whether the current object is equal to another object of the same type.
(Inherited from AFEventFrame.) | |
| Equals(AFObject) |
Indicates whether the current object is equal to another object of the same type.
(Inherited from AFObject.) | |
| FindTransfer(PISystem, Guid) |
Retrieves the AFTransfer object with the specified unique identifier
at the AFTime.MaxValue query date.
| |
| FindTransfer(PISystem, Guid, Object) |
Retrieves the AFTransfer object with the specified unique identifier at
the specified query date.
| |
| FindTransfers(PISystem, Guid, Object) |
Performs a search within the PISystem to retrieve a collection
of AFTransfer objects with the specified list of unique identifiers.
| |
| FindTransfers(AFDatabase, String, AFSearchField, AFSortField, AFSortOrder, Int32) |
Performs a text search within the AFDatabase to retrieve a collection
of AFTransfer objects that match the specified query string.
| |
| FindTransfers(AFDatabase, Object, Int32, AFEventFrameSearchMode, String, AFBaseElement, AFBaseElement, AFCategory, AFElementTemplate) | Obsolete.
Retrieves a list of AFTransfer objects limited to the specified
count beginning at the requested start time in the specified direction.
| |
| FindTransfers(AFDatabase, Object, Int32, Boolean, String, AFBaseElement, AFBaseElement, AFCategory, AFElementTemplate) | Obsolete.
Retrieves a list of AFTransfer objects limited to the specified
count beginning at the requested start time in the specified direction.
| |
| FindTransfers(AFDatabase, AFSearchMode, Object, Object, String, AFBaseElement, AFBaseElement, AFCategory, AFElementTemplate, AFSortField, AFSortOrder, Int32) | Obsolete.
Retrieves a list of AFTransfer objects that match the
specified filtering conditions.
| |
| GetAnnotations |
Retrieves a collection of existing AFAnnotation objects belonging to this
AFBaseElement.
(Inherited from AFBaseElement.) | |
| GetAttributeByTrait |
Retrieves the child AFAttribute with the specified AFAttributeTrait.
(Inherited from AFBaseElement.) | |
| GetAttributesByTrait |
Retrieves a list of child AFAttribute objects identified by the specified list of attribute traits.
(Inherited from AFBaseElement.) | |
| 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.
(Inherited from AFEventFrame.) | |
| GetParents(AFCategory) |
Retrieves a collection of AFEventFrame objects that reference this event frame
using the specified AFCategory.
(Inherited from AFEventFrame.) | |
| GetParents(AFReferenceType) |
Retrieves a collection of AFEventFrame objects that reference this event frame
using the specified AFReferenceType.
(Inherited from AFEventFrame.) | |
| GetPath |
Returns the full path to the object, using just the names.
(Inherited from AFObject.) | |
| GetPath(AFObject) |
Returns the path to the object relative from another object.
(Inherited from AFObject.) | |
| GetPath(AFEncodeType, AFObject) |
Returns the path to the object relative from another object,
using the name and/or id as specified
by encodeType.
(Inherited from AFObject.) | |
| GetPaths |
Get all the relative paths to this AFEventFrame.
(Inherited from AFEventFrame.) | |
| GetReferenceTypes |
Retrieves a collection of all AFReferenceType objects that represent types
of references from this event frame to its child event frames.
(Inherited from AFEventFrame.) | |
| GetReferenceTypes(AFEventFrame) |
Retrieves a collection of AFReferenceType objects that represent types
of references between this event frame and the specified related event frame.
(Inherited from AFEventFrame.) | |
| GetSecurity |
Gets the AFSecurity information of the specified security item
associated with the object.
| |
| GetType | Gets the Type of the current instance. (Inherited from Object.) | |
| IsTypeOf |
Checks if the current AFBaseElement is derived from the
specified AFElementTemplate.
(Inherited from AFBaseElement.) | |
| IsValidDestination(AFPort, String) |
This method checks if the specified port is valid as the destination of this transfer.
| |
| IsValidDestination(AFElement, AFPort, String) | Obsolete.
This method checks if the specified port is valid as the destination of this transfer.
| |
| IsValidSource(AFPort, String) |
This method checks if the specified port is valid as the source of this transfer.
| |
| IsValidSource(AFElement, AFPort, String) | Obsolete.
This method checks if the specified port is valid as the source of this transfer.
| |
| LoadTransfers(IListAFTransfer) |
Loads the specified list AFTransfer objects.
| |
| LoadTransfers(PISystem, Guid, Object) |
Loads the AFTransfer objects with the specified unique identifiers at
the specified query date.
| |
| Lock |
Locks this event frame so that no further changes can be made.
(Inherited from AFEventFrame.) | |
| Persist |
This method returns the persistence string for the object.
(Inherited from AFObject.) | |
| Refresh |
Refreshes the client with any changes that have been made to the object since loaded.
| |
| SetDestination(AFPort) |
Set the element and port that are the destination of the transfer.
| |
| SetDestination(AFElement, AFPort) | Obsolete.
Set the element and port that are the destination of the transfer.
| |
| SetEndTime |
Set the time that represents the time that the period ended.
(Inherited from AFEventFrame.) | |
| SetSource(AFPort) |
Set the element and port that are the source of the transfer.
| |
| SetSource(AFElement, AFPort) | Obsolete.
Set the element and port that are the source of the transfer.
| |
| SetStartTime |
Set the time that represents the time that the period started.
(Inherited from AFEventFrame.) | |
| ToString |
Returns a String that represents the current object.
(Inherited from AFObject.) | |
| UndoCheckOut |
This method discards all the changes to the object and all sub-objects since the
last call to CheckOut. Any changes since the check out will be lost.
| |
| Unlock |
Unlocks a locked event frame so that further changes can be made.
(Inherited from AFEventFrame.) |
Events
| Name | Description | |
|---|---|---|
| Changed |
Event is raised when the object or one of its sub-objects is changed.
|
Remarks
You create a transfer by calling one of the AFDatabase.AddTransfer Overload methods. A transfer can be created from a template, or without a template. When based on a template, the transfer will derive its initial definition of Categories, Attributes, and Ports from the template. Later modifications to the template will be propagated to all elements created from it. If the template allows it, or if the transfer was not created from a template, then the transfer's categories, ports, and attributes can be augmented with additional members. The AFTransferSearch class can be used for finding transfers.
An AFTransfer can be used to record the genealogy of a batch or unit batch, or the transfer of materials between elements. To track externally supplied materials, assign them to a batch. A batch or material may be transferred into multiple destinations.
Use the PISystem.Supports method to check if the PISystem supports the Transfer feature.
Examples
// This example will create a transfer (source to destination) and then display its information. // Get the Database PISystems myPISystems = new PISystems(); AFDatabase myDB = myPISystems.DefaultPISystem.Databases.DefaultDatabase; // Create an Element Template with Ports AFElementTemplate myElemTempl = myDB.ElementTemplates.Add("MyTemplate"); myElemTempl.Ports.Add("OutPort", "An output port", AFPortType.Output, isDefault: true); myElemTempl.Ports.Add("InPort", "An input port", AFPortType.Input, isDefault: true); // Create source and destination Elements AFElement srcElement = myDB.Elements.Add("srcElement", myElemTempl); AFElement destElement = myDB.Elements.Add("destElement", myElemTempl); // Create a Transfer Element Template AFElementTemplate myTransTempl = myDB.ElementTemplates.Add("MyTransferTemplate"); myTransTempl.InstanceType = typeof(AFTransfer); // Create a Transfer. AFTransfer myTransfer = myDB.AddTransfer("MyTransfer", myTransTempl); myTransfer.Description = "This is my transfer."; myTransfer.SetSource(srcElement.DefaultOutputPort); myTransfer.SetDestination(destElement.DefaultInputPort); myTransfer.SetStartTime(System.DateTime.UtcNow.AddDays(-0.95)); myTransfer.SetEndTime(System.DateTime.UtcNow.AddDays(-0.90)); myDB.CheckIn(); // Get the Transfers Collection AFNamedCollectionList<AFTransfer> Transfers = AFTransfer.FindTransfers(myDB, AFSearchMode.Overlapped, System.DateTime.UtcNow.AddDays(-1.05), System.DateTime.UtcNow, "", null, null, null, null, AFSortField.Name, AFSortOrder.Ascending, int.MaxValue); // Display Information on each Transfer. Console.WriteLine("Number of Transfers = {0}", Transfers.Count); foreach (AFTransfer CurTransfer in Transfers) { Console.WriteLine("Transfer Name = {0}", CurTransfer.Name); Console.WriteLine("Description = {0}", CurTransfer.Description); Console.WriteLine("Source element = {0}", CurTransfer.Source.Name); Console.WriteLine("Source port = {0}", CurTransfer.SourcePort.Name); Console.WriteLine("Destination element = {0}", CurTransfer.Destination.Name); Console.WriteLine("Destination port = {0}", CurTransfer.DestinationPort.Name); Console.WriteLine("Start Time = {0}", CurTransfer.StartTime.LocalTime); Console.WriteLine("End Time = {0}", CurTransfer.EndTime.LocalTime); }
' This example will create a transfer (source to destination) and then display its information. ' Get the Database Dim myPISystems As New PISystems Dim myDB As AFDatabase = myPISystems.DefaultPISystem.Databases.DefaultDatabase ' Create an Element Template with Ports Dim myElemTempl As AFElementTemplate = myDB.ElementTemplates.Add("MyTemplate") myElemTempl.Ports.Add("OutPort", "An output port", AFPortType.Output, isDefault:=True) myElemTempl.Ports.Add("InPort", "An input port", AFPortType.Input, isDefault:=True) ' Create source and destination Elements Dim srcElement As AFElement = myDB.Elements.Add("srcElement", myElemTempl) Dim destElement As AFElement = myDB.Elements.Add("destElement", myElemTempl) ' Create a Transfer Element Template Dim myTransTempl As AFElementTemplate = myDB.ElementTemplates.Add("MyTransferTemplate") myTransTempl.InstanceType = GetType(AFTransfer) ' Create a Transfer. Dim myTransfer As AFTransfer = myDB.AddTransfer("MyTransfer", myTransTempl) myTransfer.Description = "This is my transfer." myTransfer.SetSource(srcElement.DefaultOutputPort) myTransfer.SetDestination(destElement.DefaultInputPort) myTransfer.SetStartTime(System.DateTime.UtcNow.AddDays(-0.95)) myTransfer.SetEndTime(System.DateTime.UtcNow.AddDays(-0.9)) ' Get the Transfers Collection Dim Transfers As AFNamedCollectionList(Of AFTransfer) = AFTransfer.FindTransfers(myDB, AFSearchMode.Overlapped, System.DateTime.UtcNow.AddDays(-1.05), System.DateTime.UtcNow, "", Nothing, Nothing, Nothing, Nothing, AFSortField.Name, AFSortOrder.Descending, Int32.MaxValue) ' Display Information on each Transfer. Console.WriteLine("Number of Transfers = {0}", Transfers.Count) Dim CurTransfer As AFTransfer For Each CurTransfer In Transfers Console.WriteLine("Transfer Name = {0}", CurTransfer.Name) Console.WriteLine("Description = {0}", CurTransfer.Description) Console.WriteLine("Source element = {0}", CurTransfer.Source.Name) Console.WriteLine("Source port = {0}", CurTransfer.SourcePort.Name) Console.WriteLine("Destination element = {0}", CurTransfer.Destination.Name) Console.WriteLine("Destination port = {0}", CurTransfer.DestinationPort.Name) Console.WriteLine("Start Time = {0}", CurTransfer.StartTime.LocalTime) Console.WriteLine("End Time = {0}", CurTransfer.EndTime.LocalTime) Next CurTransfer
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.