This synchronous function inserts values and qualities into the history database at the specified timestamps for one or more items. If a value exists at the specified timestamp, the new value shall not be inserted; instead errors shall indicate an error.
This function is intended to insert new values at the specified timestamps; e.g., the insertion of lab data to reflect the time of data collection.
Visual Basic (Declaration) | |
---|---|
Public Overloads Function Insert( _ ByVal server() As Integer, _ ByVal timeStamps() As Date, _ ByVal dataValues() As Object, _ ByVal qualities() As Integer, _ ByRef errors As Integer() _ ) As Integer |
C# | |
---|---|
public int Insert( int[] server, DateTime[] timeStamps, object[] dataValues, int[] qualities, out int[] errors ) |
Parameters
- server
- The list of server item handles for the items to be inserted.
- timeStamps
- Array of FileTimeUTC time stamps for the new values.
- dataValues
- Array of structures which contain the new item values.
- qualities
- Array of the quality flags of the new values. These are the Data Access Quality flags, not the HDA quality flags.
- errors
- OUT: Array of HRESULTs indicating the success of the individual item. The errors correspond to the handles passed in server. This indicates whether the insert succeeded.
Return Value
S_OK, E_NOTIMPL, E_INVALIDARG, E_FAILThe server, timeStamps, values and qualities are arrays of equal size.
To insert a value for a number of different items at a single time, then fimeStamp array would have the same time for each item.
To insert a stream of values, timestamps and qualities for a single item, set the size of the item array to the number of values to be inserted and put the same ItemID in each element.
Target Platforms: Windows 7/8/10, Windows Server 2008/2012/2016, .NET 4.x