Main Content

tsintersect

Intersection of timestamps in OPC HDA data object

Description

newObj = tsintersect(dObj) resamples data in OPC HDA data object dObj so that all elements of the object have the same timestamps. The function obtains same timestamps by the intersection of all timestamps in all elements of dObj.

If dObj contains elements with the same item ID, the function combines those elements into one element. So the size of newObj might be smaller than the size of dObj.

example

Examples

collapse all

Load the OPC HDA example data file and find all common timestamps of hdaDataSmall.

load opcSampleHdaData;
newObj = tsintersect(hdaDataSmall);

Display the values and timestamps of the new object.

opc.setDateDisplayFormat('yyyy-mm-dd HH:MM:SS');
showValues(newObj)
OPC HDA Data object array:

              TIMESTAMP  Example.ItemR.1  Example.ItemR.2  
    ===================  ===============  ===============  
    2010-06-01 09:30:00         0.000000         1.000000  
    2010-06-01 09:30:30         2.000000         2.000000  
    2010-06-01 09:31:00         0.000000         3.000000  

Input Arguments

collapse all

Raw OPC HDA data, specified as an OPC HDA data object.

Output Arguments

collapse all

Resampled OPC HDA data, returned as an array of OPC HDA data objects. Each element in the array corresponds to one item.

Version History

Introduced before R2006a

See Also

Functions