Method Reference I-L
I
Import Method (Alarms Object)
Syntax
object.Import(FileName, FileFormat)
Name | Data Type | Description |
---|---|---|
FileName | String | Fully qualified import filename (read-only). |
FileFormat | Long | File format of the import file (read-only). |
Returns
Boolean. Returns whether or not the Import operation succeeded.
Import Method (DataRecordset Object)
Imports the specified file into the current DataRecordset. If the DataRecordset contains items when the Import Method is invoked, the method first clears current DataRecordset before it imports the specified file.
Syntax
object.Import(FileName, FileFormat)
Name | Data Type | Description |
---|---|---|
FileName | String | Fully qualified import filename (read-only). |
FileFormat | Long | File format of the import file (read-only). |
Returns
Boolean. Returns whether or not the Import operation succeeded.
Example
' Get A New Recordset
Set MyRecordset = MyData.NewRecordset
' Import The File
If Not MyRecordset.Import("C:\Temp\ImportData.CSV", ihFileFormat.CSV) Then
Err.Raise 1, , "Error Importing File:" + MyRecordset.LastError
End If
' Commit Data
If Not MyRecordset.WriteRecordset Then
Err.Raise 1, , "Error Committing File: " + MyRecordset.LastError
End If
ImportMethod (EnumeratedSets Object)
Name | Description | Value |
---|---|---|
CSV | File is imported/exported as comma separated values. | 1 |
XML | File is imported/exported as XML. | 2 |
Syntax
object. Import(FileName, FileFormat, Server)
Name | Data Type | Description |
---|---|---|
FileName | String | Fully qualified export file name (read-only). |
FileFormat | ihFileFormat | File format of the export file (read-only). |
Server | Server | Server from which the sets are imported. |
Returns
Boolean. Returns True if the sets have been imported successfully.
Import Method (MessageRecordset Object)
Attempts to import a list of Messages from a file.
Syntax
object.Import(FileName, FileFormat)Name | Data Type | Description |
---|---|---|
FileFormat | ihFileFormat | The format of the file specified in FileName |
FileName | String | The name of the file to import. |
Returns
Boolean true if the Import succeeded, false otherwise.
Import Method (TagRecordset Object)
Name | Description | Value |
---|---|---|
CSV | File is imported/exported as comma separated values. | 1 |
XML | File is imported/exported as XML. | 2 |
Report | File is exported as a columnar report. | 3 |
Syntax
object.Import(FileName, FileFormat)
Name | Data Type | Description |
---|---|---|
FileName | String | Fully qualified import file name (read-only). |
FileFormat | Long | File format of the import file (read-only). |
Returns
Returns whether or not the Import operation succeeded.
Example
' Get a new recordset
Set MyRecordset = MyTags.NewRecordset
' Import the file
If Not MyRecordset.Import(Path & "ImportTags.csv", ihFileFormat.CSV) Then err.Raise 1, , "Error importing file: " & MyRecordset.LastError
End If
' Commit Data
If Not MyRecordset.WriteRecordset Then
err.Raise 1, , "Error committing file: " & MyRecordset.LastError
End If
Import Method (UserDefinedType Object)
Applies to:
Imports the specified file into the User Defined Type collection. The following file formats are supported:Name | Description | Value |
---|---|---|
CSV | File is imported/exported as comma separated values. | 1 |
XML | File is imported/exported as XML. | 2 |
Syntax
object. Import(FileName, FileFormat, Server)
Name | Data Type | Description |
---|---|---|
FileFormat | ihFileFormat | File format of the import file (read-only). |
FileName | String | Fully qualified export file name (read-only). |
Server | Server | Server from which the sets are imported. |
Returns
Boolean. Returns TRUE if the type imports successfully.
InitiateFailover Method (Collectors Object)
Manually tries to initiate a Failover to a redundantly configured collector.
Syntax
object.InitiateFailover(CollectorName)
Name | Data Type | Description |
---|---|---|
CollectorName | String | Name of the collector to fail-over. |
Returns
Collector. Returns Success/Failure.
Example
Dim MyCollectors As iHistorian_SDK.Collectors
Set MyCollectors = MyServer.Collectors
MyCollectors.InitiateFailover "SimulationCollector"
L
LastError Method (Alarms Object)
This function returns the last error message generated by this object.Syntax
object.LastError
Parameters
None
Returns
String. The last error message encountered.
LoadUserCalcLibrary Method (Server Object)
Retrieves the user calculation library from the Server object. This library contains all of the user-created functions and subroutines available for calculations on this Server. The calculation library will be returned as an array of UserCalcFunction objects. If no functions exist in the library, UserCalcFunctions should be set to Empty
Syntax
object.LoadUserCalcLibrary(UserCalcFunctions)
Name | Data Type | Description |
---|---|---|
UserCalcFunctions | Variant | Resulting array of UserCalcFunction objects. |
Returns
Boolean. Returns whether or not the calculation library was loaded successfully.
Example
Dim MyServer As New iHistorian_SDK.Server
Dim MyUserCalcFunctions() As iHistorian_SDK.UserCalcFunction
Dim MyNewFunction As New iHistorian_SDK.UserCalcFunction
' Connect to the local server
If Not MyServer.Connect("", "", "") Then
err.Raise 1, , "Failed to connect to the local server" End If
' Load the calculation library
MyServer.LoadUserCalcLibrary MyUserCalcFunctions
' Create a new function
MyNewFunction.Name = "Sum"
MyNewFunction.Definition = "Function Sum(a, b)" & vbCrLf & "Sum = a + b" & vbCrLf & "End Function"
' Add it to the loaded library
If IsArray(MyUserCalcFunctions) Then
ReDim Preserve MyUserCalcFunctions(UBound(MyUserCalcFunctions) + 1) Else
ReDim MyUserCalcFunctions(0) End If
Set MyUserCalcFunctions(UBound(MyUserCalcFunctions)) = MyNewFunction
' Save the changes to the calculation library
If Not MyServer.SaveUserCalcLibrary(MyUserCalcFunctions) Then err.Raise 1, , "Failed to save the calculation library"
End If