/// <summary> /// Requests that the server periodically send notifications when new data becomes available for a set of items. /// </summary> /// <param name="startTime">The beginning of the history period to read.</param> /// <param name="resampleInterval">The interval between returned values.</param> /// <param name="numberOfIntervals">The number of resample intervals that the server should return in each callback.</param> /// <param name="items">The set of items to read (must include the item name).</param> /// <param name="requestHandle">An identifier for the request assigned by the caller.</param> /// <param name="callback">A delegate used to receive notifications when the request completes.</param> /// <param name="request">An object that contains the state of the request (used to cancel the request).</param> /// <returns>A set of results containing any errors encountered when the server validated the items.</returns> internal OpcItemResult[] AdviseProcessed( TsCHdaTime startTime, decimal resampleInterval, int numberOfIntervals, TsCHdaItem[] items, object requestHandle, TsCHdaDataUpdateEventHandler callback, out IOpcRequest request) { LicenseHandler.ValidateFeatures(LicenseHandler.ProductFeature.HistoricalAccess); if (Server == null) { throw new NotConnectedException(); } OpcItemResult[] results = ((ITsCHdaServer)Server).AdviseProcessed( startTime, resampleInterval, numberOfIntervals, items, requestHandle, callback, out request); return(results); }
/// <summary> /// Sends an asynchronous request to read the attributes of an item. /// </summary> /// <param name="startTime">The beginning of the history period to read.</param> /// <param name="endTime">The end of the history period to be read.</param> /// <param name="item">The item to read (must include the item name).</param> /// <param name="attributeIDs">The attributes to read.</param> /// <param name="requestHandle">An identifier for the request assigned by the caller.</param> /// <param name="callback">A delegate used to receive notifications when the request completes.</param> /// <param name="request">An object that contains the state of the request (used to cancel the request).</param> /// <returns>A set of results containing any errors encountered when the server validated the attribute ids.</returns> internal TsCHdaResultCollection ReadAttributes( TsCHdaTime startTime, TsCHdaTime endTime, OpcItem item, int[] attributeIDs, object requestHandle, TsCHdaReadAttributesCompleteEventHandler callback, out IOpcRequest request) { LicenseHandler.ValidateFeatures(LicenseHandler.ProductFeature.HistoricalAccess); if (Server == null) { throw new NotConnectedException(); } TsCHdaResultCollection results = ((ITsCHdaServer)Server).ReadAttributes( startTime, endTime, item, attributeIDs, requestHandle, callback, out request); return(results); }
/// <summary> /// Begins the playback of processed data from the historian database for a set of items. /// </summary> /// <param name="startTime">The beginning of the history period to read.</param> /// <param name="endTime">The end of the history period to be read.</param> /// <param name="resampleInterval">The interval between returned values.</param> /// <param name="numberOfIntervals">The number of resample intervals that the server should return in each callback.</param> /// <param name="updateInterval">The frequency, in seconds, that the server send data.</param> /// <param name="items">The set of items to read (must include the item name).</param> /// <param name="requestHandle">An identifier for the request assigned by the caller.</param> /// <param name="callback">A delegate used to receive notifications when the request completes.</param> /// <param name="request">An object that contains the state of the request (used to cancel the request).</param> /// <returns>A set of results containing any errors encountered when the server validated the items.</returns> internal OpcItemResult[] PlaybackProcessed( TsCHdaTime startTime, TsCHdaTime endTime, decimal resampleInterval, int numberOfIntervals, decimal updateInterval, TsCHdaItem[] items, object requestHandle, TsCHdaDataUpdateEventHandler callback, out IOpcRequest request) { if (_server == null) { throw new NotConnectedException(); } OpcItemResult[] results = ((ITsCHdaServer)_server).PlaybackProcessed( startTime, endTime, resampleInterval, numberOfIntervals, updateInterval, items, requestHandle, callback, out request); return(results); }
/// <summary> /// Sends an asynchronous request to read item values that have been deleted or replaced. /// </summary> /// <param name="startTime">The beginning of the history period to read.</param> /// <param name="endTime">The end of the history period to be read.</param> /// <param name="maxValues">The number of values to be read for each item.</param> /// <param name="items">The set of items to read (must include the item name).</param> /// <param name="requestHandle">An identifier for the request assigned by the caller.</param> /// <param name="callback">A delegate used to receive notifications when the request completes.</param> /// <param name="request">An object that contains the state of the request (used to cancel the request).</param> /// <returns>A set of results containing any errors encountered when the server validated the items.</returns> internal OpcItemResult[] ReadModified( TsCHdaTime startTime, TsCHdaTime endTime, int maxValues, OpcItem[] items, object requestHandle, TsCHdaReadValuesCompleteEventHandler callback, out IOpcRequest request) { if (_server == null) { throw new NotConnectedException(); } OpcItemResult[] results = ((ITsCHdaServer)_server).ReadModified( startTime, endTime, maxValues, items, requestHandle, callback, out request); return(results); }
/// <summary> /// Sends an asynchronous request to read item values that have been deleted or replaced. /// </summary> /// <param name="startTime">The beginning of the history period to read.</param> /// <param name="endTime">The end of the history period to be read.</param> /// <param name="maxValues">The number of values to be read for each item.</param> /// <param name="items">The set of items to read (must include the item name).</param> /// <param name="requestHandle">An identifier for the request assigned by the caller.</param> /// <param name="callback">A delegate used to receive notifications when the request completes.</param> /// <param name="request">An object that contains the state of the request (used to cancel the request).</param> /// <returns>A set of results containing any errors encountered when the server validated the items.</returns> internal OpcItemResult[] ReadModified( TsCHdaTime startTime, TsCHdaTime endTime, int maxValues, OpcItem[] items, object requestHandle, TsCHdaReadValuesCompleteEventHandler callback, out IOpcRequest request) { LicenseHandler.ValidateFeatures(LicenseHandler.ProductFeature.HistoricalAccess); if (Server == null) { throw new NotConnectedException(); } OpcItemResult[] results = ((ITsCHdaServer)Server).ReadModified( startTime, endTime, maxValues, items, requestHandle, callback, out request); return(results); }
/// <summary> /// Initializes the object with a relative time. /// </summary> /// <param name="time">The relative time.</param> public TsCHdaTime(string time) { TsCHdaTime value = Parse(time); _absoluteTime = DateTime.MinValue; _baseTime = value._baseTime; _offsets = value._offsets; }
/// <summary> /// Initializes the object with a relative time. /// </summary> /// <param name="time">The relative time.</param> public TsCHdaTime(string time) { TsCHdaTime value = Parse(time); absoluteTime_ = DateTime.MinValue; baseTime_ = value.baseTime_; offsets_ = value.offsets_; }
/////////////////////////////////////////////////////////////////////// #region ReadAnnotations /// <summary> /// Reads any annotations for an item within the a time interval. /// </summary> /// <param name="startTime">The beginning of the history period to read.</param> /// <param name="endTime">The end of the history period to be read.</param> /// <param name="items">The set of items to read (must include the item name).</param> /// <returns>A set of annotations within the requested time range for each item.</returns> internal TsCHdaAnnotationValueCollection[] ReadAnnotations( TsCHdaTime startTime, TsCHdaTime endTime, OpcItem[] items) { if (_server == null) { throw new NotConnectedException(); } return(((ITsCHdaServer)_server).ReadAnnotations(startTime, endTime, items)); }
/////////////////////////////////////////////////////////////////////// #region Delete /// <summary> /// Deletes the values with the specified time domain for one or more items. /// </summary> /// <param name="startTime">The beginning of the history period to delete.</param> /// <param name="endTime">The end of the history period to be delete.</param> /// <param name="items">The set of items to delete (must include the item name).</param> /// <returns>The results of the delete operation for each item.</returns> internal OpcItemResult[] Delete( TsCHdaTime startTime, TsCHdaTime endTime, OpcItem[] items) { if (_server == null) { throw new NotConnectedException(); } return(((ITsCHdaServer)_server).Delete(startTime, endTime, items)); }
/////////////////////////////////////////////////////////////////////// #region ReadAttributes /// <summary> /// Reads the current or historical values for the attributes of an item. /// </summary> /// <param name="startTime">The beginning of the history period to read.</param> /// <param name="endTime">The end of the history period to be read.</param> /// <param name="item">The item to read (must include the item name).</param> /// <param name="attributeIDs">The attributes to read.</param> /// <returns>A set of attribute values for each requested attribute.</returns> internal TsCHdaItemAttributeCollection ReadAttributes( TsCHdaTime startTime, TsCHdaTime endTime, OpcItem item, int[] attributeIDs) { if (_server == null) { throw new NotConnectedException(); } return(((ITsCHdaServer)_server).ReadAttributes(startTime, endTime, item, attributeIDs)); }
/// <summary> /// Deletes the values with the specified time domain for one or more items. /// </summary> /// <param name="startTime">The beginning of the history period to delete.</param> /// <param name="endTime">The end of the history period to be delete.</param> /// <param name="items">The set of items to delete (must include the item name).</param> /// <returns>The results of the delete operation for each item.</returns> internal OpcItemResult[] Delete( TsCHdaTime startTime, TsCHdaTime endTime, OpcItem[] items) { LicenseHandler.ValidateFeatures(LicenseHandler.ProductFeature.HistoricalAccess); if (Server == null) { throw new NotConnectedException(); } return(((ITsCHdaServer)Server).Delete(startTime, endTime, items)); }
/// <summary> /// Reads any annotations for an item within the a time interval. /// </summary> /// <param name="startTime">The beginning of the history period to read.</param> /// <param name="endTime">The end of the history period to be read.</param> /// <param name="items">The set of items to read (must include the item name).</param> /// <returns>A set of annotations within the requested time range for each item.</returns> internal TsCHdaAnnotationValueCollection[] ReadAnnotations( TsCHdaTime startTime, TsCHdaTime endTime, OpcItem[] items) { LicenseHandler.ValidateFeatures(LicenseHandler.ProductFeature.HistoricalAccess); if (Server == null) { throw new NotConnectedException(); } return(((ITsCHdaServer)Server).ReadAnnotations(startTime, endTime, items)); }
/////////////////////////////////////////////////////////////////////// #region ReadModified /// <summary> /// Reads item values that have been deleted or replaced. /// </summary> /// <param name="startTime">The beginning of the history period to read.</param> /// <param name="endTime">The end of the history period to be read.</param> /// <param name="maxValues">The number of values to be read for each item.</param> /// <param name="items">The set of items to read (must include the item name).</param> /// <returns>A set of values, qualities and timestamps within the requested time range for each item.</returns> internal TsCHdaModifiedValueCollection[] ReadModified( TsCHdaTime startTime, TsCHdaTime endTime, int maxValues, OpcItem[] items) { if (_server == null) { throw new NotConnectedException(); } return(((ITsCHdaServer)_server).ReadModified(startTime, endTime, maxValues, items)); }
/////////////////////////////////////////////////////////////////////// #region ReadProcessed /// <summary> /// Reads processed data from the historian database for a set of items. /// </summary> /// <param name="startTime">The beginning of the history period to read.</param> /// <param name="endTime">The end of the history period to be read.</param> /// <param name="resampleInterval">The interval between returned values.</param> /// <param name="items">The set of items to read (must include the item name).</param> /// <returns>A set of values, qualities and timestamps within the requested time range for each item.</returns> internal TsCHdaItemValueCollection[] ReadProcessed( TsCHdaTime startTime, TsCHdaTime endTime, decimal resampleInterval, TsCHdaItem[] items) { if (_server == null) { throw new NotConnectedException(); } return(((ITsCHdaServer)_server).ReadProcessed(startTime, endTime, resampleInterval, items)); }
/////////////////////////////////////////////////////////////////////// #region ReadRaw /// <summary> /// Reads raw (unprocessed) data from the historian database for a set of items. /// </summary> /// <param name="startTime">The beginning of the history period to read.</param> /// <param name="endTime">The end of the history period to be read.</param> /// <param name="maxValues">The number of values to be read for each item.</param> /// <param name="includeBounds">Whether the bounding item values should be returned.</param> /// <param name="items">The set of items to read (must include the item name).</param> /// <returns>A set of values, qualities and timestamps within the requested time range for each item.</returns> internal TsCHdaItemValueCollection[] ReadRaw( TsCHdaTime startTime, TsCHdaTime endTime, int maxValues, bool includeBounds, OpcItem[] items) { if (_server == null) { throw new NotConnectedException(); } return(((ITsCHdaServer)_server).ReadRaw(startTime, endTime, maxValues, includeBounds, items)); }
/// <summary> /// Reads the current or historical values for the attributes of an item. /// </summary> /// <param name="startTime">The beginning of the history period to read.</param> /// <param name="endTime">The end of the history period to be read.</param> /// <param name="item">The item to read (must include the item name).</param> /// <param name="attributeIDs">The attributes to read.</param> /// <returns>A set of attribute values for each requested attribute.</returns> internal TsCHdaItemAttributeCollection ReadAttributes( TsCHdaTime startTime, TsCHdaTime endTime, OpcItem item, int[] attributeIDs) { LicenseHandler.ValidateFeatures(LicenseHandler.ProductFeature.HistoricalAccess); if (Server == null) { throw new NotConnectedException(); } return(((ITsCHdaServer)Server).ReadAttributes(startTime, endTime, item, attributeIDs)); }
/// <summary> /// Reads processed data from the historian database for a set of items. /// </summary> /// <param name="startTime">The beginning of the history period to read.</param> /// <param name="endTime">The end of the history period to be read.</param> /// <param name="resampleInterval">The interval between returned values.</param> /// <param name="items">The set of items to read (must include the item name).</param> /// <returns>A set of values, qualities and timestamps within the requested time range for each item.</returns> internal TsCHdaItemValueCollection[] ReadProcessed( TsCHdaTime startTime, TsCHdaTime endTime, decimal resampleInterval, TsCHdaItem[] items) { LicenseHandler.ValidateFeatures(LicenseHandler.ProductFeature.HistoricalAccess); if (Server == null) { throw new NotConnectedException(); } return(((ITsCHdaServer)Server).ReadProcessed(startTime, endTime, resampleInterval, items)); }
/// <summary> /// Reads raw (unprocessed) data from the historian database for a set of items. /// </summary> /// <param name="startTime">The beginning of the history period to read.</param> /// <param name="endTime">The end of the history period to be read.</param> /// <param name="maxValues">The number of values to be read for each item.</param> /// <param name="includeBounds">Whether the bounding item values should be returned.</param> /// <param name="items">The set of items to read (must include the item name).</param> /// <returns>A set of values, qualities and timestamps within the requested time range for each item.</returns> internal TsCHdaItemValueCollection[] ReadRaw( TsCHdaTime startTime, TsCHdaTime endTime, int maxValues, bool includeBounds, OpcItem[] items) { LicenseHandler.ValidateFeatures(LicenseHandler.ProductFeature.HistoricalAccess); if (Server == null) { throw new NotConnectedException(); } return(((ITsCHdaServer)Server).ReadRaw(startTime, endTime, maxValues, includeBounds, items)); }
/// <summary> /// Requests that the server periodically send notifications when new data becomes available for a set of items. /// </summary> /// <param name="startTime">The beginning of the history period to read.</param> /// <param name="updateInterval">The frequency, in seconds, that the server should check for new data.</param> /// <param name="items">The set of items to read (must include the item name).</param> /// <param name="requestHandle">An identifier for the request assigned by the caller.</param> /// <param name="callback">A delegate used to receive notifications when the request completes.</param> /// <param name="request">An object that contains the state of the request (used to cancel the request).</param> /// <returns>A set of results containing any errors encountered when the server validated the items.</returns> internal OpcItemResult[] AdviseRaw( TsCHdaTime startTime, decimal updateInterval, OpcItem[] items, object requestHandle, TsCHdaDataUpdateEventHandler callback, out IOpcRequest request) { if (_server == null) { throw new NotConnectedException(); } return(((ITsCHdaServer)_server).AdviseRaw(startTime, updateInterval, items, requestHandle, callback, out request)); }
/// <summary> /// Requests that the server periodically send notifications when new data becomes available for a set of items. /// </summary> /// <param name="startTime">The beginning of the history period to read.</param> /// <param name="updateInterval">The frequency, in seconds, that the server should check for new data.</param> /// <param name="items">The set of items to read (must include the item name).</param> /// <param name="requestHandle">An identifier for the request assigned by the caller.</param> /// <param name="callback">A delegate used to receive notifications when the request completes.</param> /// <param name="request">An object that contains the state of the request (used to cancel the request).</param> /// <returns>A set of results containing any errors encountered when the server validated the items.</returns> internal OpcItemResult[] AdviseRaw( TsCHdaTime startTime, decimal updateInterval, OpcItem[] items, object requestHandle, TsCHdaDataUpdateEventHandler callback, out IOpcRequest request) { LicenseHandler.ValidateFeatures(LicenseHandler.ProductFeature.HistoricalAccess); if (Server == null) { throw new NotConnectedException(); } return(((ITsCHdaServer)Server).AdviseRaw(startTime, updateInterval, items, requestHandle, callback, out request)); }
/// <summary> /// Sends an asynchronous request to read raw data from the historian database for a set of items. /// </summary> /// <param name="startTime">The beginning of the history period to read.</param> /// <param name="endTime">The end of the history period to be read.</param> /// <param name="maxValues">The number of values to be read for each item.</param> /// <param name="includeBounds">Whether the bounding item values should be returned.</param> /// <param name="items">The set of items to read (must include the item name).</param> /// <param name="requestHandle">An identifier for the request assigned by the caller.</param> /// <param name="callback">A delegate used to receive notifications when the request completes.</param> /// <param name="request">An object that contains the state of the request (used to cancel the request).</param> /// <returns>A set of results containing any errors encountered when the server validated the items.</returns> internal OpcItemResult[] ReadRaw( TsCHdaTime startTime, TsCHdaTime endTime, int maxValues, bool includeBounds, OpcItem[] items, object requestHandle, TsCHdaReadValuesCompleteEventHandler callback, out IOpcRequest request) { if (_server == null) { throw new NotConnectedException(); } return(((ITsCHdaServer)_server).ReadRaw(startTime, endTime, maxValues, includeBounds, items, requestHandle, callback, out request)); }
/// <summary> /// Begins the playback raw data from the historian database for a set of items. /// </summary> /// <param name="startTime">The beginning of the history period to read.</param> /// <param name="endTime">The end of the history period to be read.</param> /// <param name="maxValues">The number of values to be read for each item.</param> /// <param name="updateInterval">The frequency, in seconds, that the server send data.</param> /// <param name="playbackDuration">The duration, in seconds, of the timespan returned with each update.</param> /// <param name="items">The set of items to read (must include the item name).</param> /// <param name="requestHandle">An identifier for the request assigned by the caller.</param> /// <param name="callback">A delegate used to receive notifications when the request completes.</param> /// <param name="request">An object that contains the state of the request (used to cancel the request).</param> /// <returns>A set of results containing any errors encountered when the server validated the items.</returns> internal OpcItemResult[] PlaybackRaw( TsCHdaTime startTime, TsCHdaTime endTime, int maxValues, decimal updateInterval, decimal playbackDuration, OpcItem[] items, object requestHandle, TsCHdaDataUpdateEventHandler callback, out IOpcRequest request) { if (_server == null) { throw new NotConnectedException(); } return(((ITsCHdaServer)_server).PlaybackRaw(startTime, endTime, maxValues, updateInterval, playbackDuration, items, requestHandle, callback, out request)); }
/// <summary> /// Parses a string representation of a time. /// </summary> /// <param name="buffer">The string representation to parse.</param> /// <returns>A Time object initailized with the string.</returns> public static TsCHdaTime Parse(string buffer) { // remove trailing and leading white spaces. buffer = buffer.Trim(); TsCHdaTime time = new TsCHdaTime(); // determine if string is a relative time. bool isRelative = false; foreach (TsCHdaRelativeTime baseTime in Enum.GetValues(typeof(TsCHdaRelativeTime))) { string token = BaseTypeToString(baseTime); if (buffer.StartsWith(token)) { buffer = buffer.Substring(token.Length).Trim(); time.BaseTime = baseTime; isRelative = true; break; } } // parse an absolute time string. if (!isRelative) { time.AbsoluteTime = System.Convert.ToDateTime(buffer).ToUniversalTime(); return(time); } // parse the offset portion of the relative time. if (buffer.Length > 0) { time.Offsets.Parse(buffer); } return(time); }
/// <summary> /// Sends an asynchronous request to delete values for one or more items. /// </summary> /// <param name="startTime">The beginning of the history period to delete.</param> /// <param name="endTime">The end of the history period to be delete.</param> /// <param name="items">The set of items to delete (must include the item name).</param> /// <param name="requestHandle">An identifier for the request assigned by the caller.</param> /// <param name="callback">A delegate used to receive notifications when the request completes.</param> /// <param name="request">An object that contains the state of the request (used to cancel the request).</param> /// <returns>A set of results containing any errors encountered when the server validated the items.</returns> internal OpcItemResult[] Delete( TsCHdaTime startTime, TsCHdaTime endTime, OpcItem[] items, object requestHandle, TsCHdaUpdateCompleteEventHandler callback, out IOpcRequest request) { if (_server == null) { throw new NotConnectedException(); } OpcItemResult[] results = ((ITsCHdaServer)_server).Delete( startTime, endTime, items, requestHandle, callback, out request); return(results); }
/// <summary> /// Sends an asynchronous request to read the attributes of an item. /// </summary> /// <param name="startTime">The beginning of the history period to read.</param> /// <param name="endTime">The end of the history period to be read.</param> /// <param name="item">The item to read (must include the item name).</param> /// <param name="attributeIDs">The attributes to read.</param> /// <param name="requestHandle">An identifier for the request assigned by the caller.</param> /// <param name="callback">A delegate used to receive notifications when the request completes.</param> /// <param name="request">An object that contains the state of the request (used to cancel the request).</param> /// <returns>A set of results containing any errors encountered when the server validated the attribute ids.</returns> internal TsCHdaResultCollection ReadAttributes( TsCHdaTime startTime, TsCHdaTime endTime, OpcItem item, int[] attributeIDs, object requestHandle, TsCHdaReadAttributesCompleteEventHandler callback, out IOpcRequest request) { if (_server == null) { throw new NotConnectedException(); } TsCHdaResultCollection results = ((ITsCHdaServer)_server).ReadAttributes( startTime, endTime, item, attributeIDs, requestHandle, callback, out request); return(results); }