This method reads the attribute values and timestamps from the history database for the specified time domain for an item. If the current values for the attributes are desired, endTime is MinValue time. This method is intended to be used to retrieve attributes that have changed to correlate the values of these attributes with the values of their data. For example, the recalibration of a sensor may have required the normal maximum and minimum attributes to be changed. If the only attribute values available for the item are the current values, these shall be returned and errors set to OPC_S_CURRENTVALUE. Except for the case where current values are requested (endTime = MinValue), the server shall always return a beginning bounding value. Thus, if the client requests attribute values for Jan1, 1997 to October 1, 1997, the server shall return a value for the attribute on Jan 1, 1997, rather than the first value returned being the first new value for the attribute after Jan 1, 1997. Likewise, the timestamp for that first value shall be Jan 1, 1997, regardless of when the attribute actually took that value. All other timestamps shall be for the time when the value of the attribute changed. Note that while the client can query the server for the native datatype of an ItemID, the client cannot assume that all data sent from the server will be that datatype. The datatype of a given ItemID may have changed over the life of the Item, and thus clients should be able to handle receiving data of a different datatype than that returned from this call.
Overload | Description |
---|---|
ReadAttribute(DateTime,DateTime,Int32,Int32[],OPCHDAAttribute[],Int32[]) | Synchronous ReadAttribute. This method reads the attribute values and timestamps from the history database for the specified time domain for an item. If the current values for the attributes are desired, endTime is MinValue time. This method is intended to be used to retrieve attributes that have changed to correlate the values of these attributes with the values of their data. For example, the recalibration of a sensor may have required the normal maximum and minimum attributes to be changed. If the only attribute values available for the item are the current values, these shall be returned and errors set to OPC_S_CURRENTVALUE. Except for the case where current values are requested (endTime = MinValue), the server shall always return a beginning bounding value. Thus, if the client requests attribute values for Jan1, 1997 to October 1, 1997, the server shall return a value for the attribute on Jan 1, 1997, rather than the first value returned being the first new value for the attribute after Jan 1, 1997. Likewise, the timestamp for that first value shall be Jan 1, 1997, regardless of when the attribute actually took that value. All other timestamps shall be for the time when the value of the attribute changed. Note that while the client can query the server for the native datatype of an ItemID, the client cannot assume that all data sent from the server will be that datatype. The datatype of a given ItemID may have changed over the life of the Item, and thus clients should be able to handle receiving data of a different datatype than that returned from this call. |
ReadAttribute(Int32,DateTime,DateTime,Int32,Int32[],Int32,Int32[]) | Asynchronous ReadAttribute. This method reads the attribute values and timestamps from the history database for the specified time domain for an item. If the current values for the attributes are desired, endTime is MinValue time. This method is intended to be used to retrieve attributes that have changed to correlate the values of these attributes with the values of their data. For example, the recalibration of a sensor may have required the normal maximum and minimum attributes to be changed. The results are returned via the client's IOPCHDA_DataCallback::OnReadAttributeComplete method. If the only attribute values available for the item are the current values, these shall be returned and errors set to OPC_S_CURRENTVALUE. Except for the case where current values are requested (endTime = MinValue), the server shall always return a beginning bounding value. Thus, if the client requests attribute values for Jan1, 1997 to October 1, 1997, the server shall return a value for the attribute on Jan 1, 1997, rather than the first value returned being the first new value for the attribute after Jan 1, 1997. Likewise, the timestamp for that first value shall be Jan 1, 1997, regardless of when the attribute actually took that value. All other timestamps shall be for the time when the value of the attribute changed. Note that while the client can query the server for the native datatype of an ItemID, the client cannot assume that all data sent from the server will be that datatype. The datatype of a given ItemID may have changed over the life of the Item, and thus clients should be able to handle receiving data of a different datatype than that returned from this call. |
Target Platforms: Windows XP Professional, Windows Server 2003 family, Windows Vista, Windows 7, Windows Server 2008 family