Method Reference I-L
- I
- Import Method (Alarms Object)
-
This function imports the alarms/events in the specified file into this Alarms object.CAUTION: Any previously imported alarms will be discarded.
Syntax
object.Import(FileName, FileFormat)
Table 1. Parameters 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)
Table 2. Parameters 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)
-
Imports the specified file into the EnumeratedSets collection. The following file formats are supported:
Imported files follow a specific format that contains specific keywords. With CSV files, 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.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)
Table 3. Parameters 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)Table 4. Parameters 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)
-
Imports the specified file into the current TagRecordset. If the TagRecordset contains items when the Import method is invoked, the method first clears the current TagRecordset before importing the specified file. After you have imported a file, call the WriteRecordset method of the TagRecordset object to save the data to the Historian server. The following file formats are supported:
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.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 Note: Prepare a file for import by exporting it with the desired fields for import.Syntax
object.Import(FileName, FileFormat)
Table 5. Parameters 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:
Imported files follow a specific format that contains specific keywords. With CSV files, 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.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)
Table 6. Parameters 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)
Table 7. Parameters 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)
Table 8. Parameters 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