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

AF SDK Reference

PIServer.ImportCsv Method (PIImportMode, CultureInfo, String, EventHandler(AFProgressEventArgs))

PIServer.ImportCsv Method (PIImportMode, CultureInfo, String, EventHandler(AFProgressEventArgs))

  • Last UpdatedNov 18, 2025
  • 3 minute read
PIServer.ImportCsv Method (PIImportMode, CultureInfo, String, EventHandler(AFProgressEventArgs))
Imports the comma-separated value (CSV) representation of PI Points, PI DigitalStateSets, PI Identities, or PI IdentityMappings from a file.

Namespace:  OSIsoft.AF.PI
Assembly:  OSIsoft.AFSDK (in OSIsoft.AFSDK.dll) Version: 3.1.1.1182

Syntax

public int ImportCsv(
	PIImportMode importMode,
	CultureInfo culture,
	string csvData,
	EventHandler<AFProgressEventArgs> handler
)
Public Function ImportCsv ( 
	importMode As PIImportMode,
	culture As CultureInfo,
	csvData As String,
	handler As EventHandler(Of AFProgressEventArgs)
) As Integer

Dim instance As PIServer
Dim importMode As PIImportMode
Dim culture As CultureInfo
Dim csvData As String
Dim handler As EventHandler(Of AFProgressEventArgs)
Dim returnValue As Integer

returnValue = instance.ImportCsv(importMode, 
	culture, csvData, handler)
public:
int ImportCsv(
	PIImportMode importMode, 
	CultureInfo^ culture, 
	String^ csvData, 
	EventHandler<AFProgressEventArgs^>^ handler
)
member ImportCsv : 
        importMode : PIImportMode * 
        culture : CultureInfo * 
        csvData : string * 
        handler : EventHandler<AFProgressEventArgs> -> int 

Parameters

importMode
Type: OSIsoft.AFPIImportMode
One or more of the PIImportMode values which indicates how to import.
culture
Type: System.GlobalizationCultureInfo
The culture-specific settings to be used for conversion of times, dates, floating-point values, etc. If , the current culture will be assumed. If the invariant culture is specified, then DateTime's will be assumed to be in UTC time.
csvData
Type: SystemString
The fully-qualified pathname to a file containing the CSV data or the CSV data itself. If the CSV data is passed in a string to ImportCsv, each line should be terminated by a carriage return and newline.
handler
Type: SystemEventHandlerAFProgressEventArgs
Event handler method that will be called after each line of the CSV data is processed. If , import will occur silently.

Return Value

Type: Int32
Returns the number of items updated or created.

Remarks

The CSV representation of the PI Points, PI DigitalStateSets, PI Identities, or PI IdentityMappings. are imported into the PI Data Archive that is the target of the method call.

Version Information

AFSDK

Supported in: 3.1.1, 3.1.0, 3.0.2, 3.0.1, 3.0.0, 2.10.11, 2.10.5, 2.10.0, 2.10, 2.9.5, 2.9, 2.8.5, 2.8, 2.7.5, 2.7, 2.6

See Also

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