Method Reference E-H

E

Export Method (Alarms Object)

Exports the contents of the AlarmRecordSet into the specified file.

Syntax

object.Export(AlmRS, RSInfo, FileName, FileFormat)

Table 1. Parameters
Name Data Type Description
AlmRS AlarmRecordSet Returns the requested records (writeable).
RSInfoAlarmOpenRecordSetInfoContains descriptions of the desired records (read-only).
FileNameStringFully qualified export filename (read-only).
FileFormatihFileFormatFile format of the export file (read-only).

Returns

Boolean. Returns whether or not the Export operation succeeded.

Export Method (DataRecordset Object)

Exports the contents of the current DataRecordset into the specified file.

Syntax

object.Export(FileName, FileFormat)

Table 2. Parameters
Name Data Type Description
FileName StringFully qualified export filename (read-only.
FileFormatihFileFormatFile format of the export file (read-only).

Returns

Boolean. Returns whether or not the Export operation succeeded.

Example

' Export File From Existing Query Results
If Not MyRecordset.Export("C:\Temp\DataReport.RPT", ihFileFormat.Report) Then
Err.Raise 1, , "Error Exporting File: " + MyRecordset.LastError
End If

Export Method (EnumeratedSets Object)

Applies to:

Exports the contents of the EnumeratedSets collection into the specified file.

The following file formats are supported:

Name DescriptionValue
CSVFile is imported/exported as comma separated values.1
XMLFile is imported/exported as XML.2

Imported files follow a specific format that contains specific keywords. With CSV, the first row of the file establishes the fields in the file and their positions. With XML reports, the files describe the format of the data.

Syntax

object. Export(FileName, FileFormat)

Table 3. Parameters
Name Data Type Description
FileNameStringFully qualified export file name (read-only).
FileFormatihFileFormatFile format of the export file (read-only).

Returns

Boolean. Returns True if the sets have been exported successfully.

Export Method (MessageRecordset Object)

Exports the contents of the current MessageRecordset into the specified file.

The following file formats are supported. Exported files follow a specific format containing specific keywords. With CSV and tabular reports, the first row of the file establishes the fields in the file and their positions. With XML, the file itself describes the format of the data.

Name DescriptionValue
CSVFile is imported/exported as comma separated values.1
XMLFile is imported/exported as XML.2
ReportFile is exported as a columnar report3

Syntax

object.Export(FileName, FileFormat)

Table 4. Parameters
Name Data Type Description
FileNameStringFully qualified export file name (read-only).
FileFormatihFileFormatFile format of the export file (read-only).

Returns

Boolean. Success/Failure.

Export Method (TagRecordset Object)

Exports the contents of the current TagRecordset into the specified file.

The following file formats are supported:

Name DescriptionValue
CSVFile is imported/exported as comma separated values.1
XMLFile is imported/exported as XML.2
ReportFile is exported as a columnar report3
Imported files follow a specific format that contains specific keywords. With CSV and tabular reports, the first row of the file establishes the fields in the file and their positions. With XML reports, the files describe the format of the data. Prepare a file for import by exporting it with the desired fields for import.

Syntax

object.Export(FileName, FileFormat)

Table 5. Parameters
Name Data Type Description
FileNameStringFully qualified export file name (read-only).
FileFormatihFileFormatFile format of the export file (read-only).

Returns

Returns whether or not the Export operation succeeded.

Example

' Export file from existing query results
Set MyRecordset = MyServer.Tags.NewRecordset 
MyRecordset.Criteria.Tagname = "*" 
MyRecordset.Fields.AllFields 
MyRecordset.QueryRecordset
If Not MyRecordset.Export(Path & "TagReport.RPT", ihFileFormat.Report) Then 
err.Raise 1, , "Error exporting file: " & MyRecordset.LastError
End If

Export Method (UserDefinedType Object)

Applies to:

Exports the contents of the User Defined Type into the specified file.

The following file formats are supported:

Name DescriptionValue
CSVFile is imported/exported as comma separated values.1
XMLFile is imported/exported as XML.2
Imported files follow a specific format that contains specific keywords. With CSV, the first row of the file establishes the fields in the file and their positions. With XML reports, the files describe the format of the data.

Syntax

object. Export(FileName, FileFormat)
Table 6. Parameters
Name Data Type Description
FileNameStringFully qualified export file name (read-only).
FileFormatihFileFormatFile format of the export file (read-only).

Returns

Boolean. Returns TRUE if the User Defined Type is exported successfully.

G

GetCurrentValue Method (Collector Object)

Returns the current value for a given tag.

Syntax

object.GetCurrentValue(SourceAddress, ErrorMessage, CurrentValue)

Table 7. Parameters
Name Data Type Description
SourceAddress StringThe tag source address.
ErrorMessageStringThe error message string encountered, if any.
CurrentValue StringA DataValue object representing the current tag value.

Returns

Boolean. Succeeded/Failed. Example
Dim OPC1 As iHistorian_SDK.Collector
Dim MyTagValue As Variant
Dim MyErrorMessage As String
' Request The Collector To Get the Current Value for a Tag 
Set OPC1 = MyCollectors.Item("USIM031_OPC1") 
OPC1.GetCurrentValue "OPCTag1", MyErrorMessage, MyTagValue

GetFilters Method (OPCFilters Object)

Returns the current set of Filters configured for MyCollector.

Syntax

object.GetFilters(MyServer, MyCollector)

Table 8. Parameters
Name Data Type Description
MyServerVariantThe Historian server connection.
MyCollectorMyCollectorThe Collector object to acquire the Filter information for.

Returns

Boolean true on success, false otherwise

GetLastError Method (Server Object)

Returns the last error message encountered by the Server object. To see a complete list of messages, refer to the ErrorList property. When possible, the system translates messages into the locale of the client.

Syntax

object.GetLastError

Parameters

None

Returns

String. The last error message encountered.

GetPrimaryCollectorName Method (Collectors Object)

Returns the name of the Primary Collector for a set of redundantly configured Collectors.

Syntax

object.GetPrimaryCollectorName(CollectorName)

Table 9. Parameters
Name Data Type Description
CollectorName StringThe name of the Collector.

Returns

String. The primary collector name.