AFDataReference.CreateConfig Method
- Last UpdatedJan 12, 2026
- 2 minute read
- PI System
- AF SDK 3.2.0
- Developer
This method is invoked by the user to update the attribute configuration relative to a foreign system.
Namespace: OSIsoft.AF.Asset
Assembly: OSIsoft.AFSDK (in OSIsoft.AFSDK.dll) Version: 3.2.0.7
Syntax
public virtual void CreateConfig()
Public Overridable Sub CreateConfig Dim instance As AFDataReference instance.CreateConfig()
public: virtual void CreateConfig()
abstract CreateConfig : unit -> unit override CreateConfig : unit -> unit
Remarks
This method is invoked by the user to allow the
external data reference a mechanism to perform configuration operations and save that information
into the foreign system, or back into the data reference arguments for the attribute.
For example, it might store a recordID of a created database record to store data for this attribute.
Examples
// This example demonstrates how to create the DataReference configuration // for all attributes with a PIPoint DataReference. // Get the Database PISystems myPISystems = new PISystems(); PISystem myPISystem = myPISystems.DefaultPISystem; AFDatabase myDB = myPISystem.Databases.DefaultDatabase; // Create an Element with an Attribute AFElement myElement = myDB.Elements.Add("MyElement*"); AFAttribute myAttribute = myElement.Attributes.Add("MyAttribute"); myAttribute.DefaultUOM = myPISystem.UOMDatabase.UOMs["kelvin"]; myAttribute.DataReferencePlugIn = AFDataReference.GetPIPointDataReference(myPISystem); // An example of a valid configuration string: // "\\%Server%\sinusoid;ptclassname=classic;pointtype=Float32;pointsource=R;descriptor=""12 Hour Sine Wave"";location2=2;location4=1" myAttribute.ConfigString = myConfigString; // Create DataReference Configuration foreach (AFAttribute CurAttribute in myElement.Attributes) { CurAttribute.DataReference.CreateConfig(); }