Data Acquisition Toolbox    

Returning Time Information

You can return relative time and absolute time information with the getdata function. Relative time is associated with the extracted data. Absolute time is associated with the first trigger executed.

Relative Time

To return data and relative time information for the analog input object ai:

time is an m-by-1 array of relative time values where m is the number of samples returned. time = 0 corresponds to the first sample logged by the data acquisition engine, and time is measured continuously until the acquisition is stopped.

The relationship between the samples acquired and the relative time for each sample is shown below for m samples and n channels.

Absolute Time

To return data, relative time information, and the absolute time of the first trigger for the analog input object ai:

The absolute time is returned using the MATLAB clock format.

The absolute time from the getdata call is

To convert the clock vector to a more convenient form:

The absolute time of the first trigger is also recorded by the InitialTriggerTime property.

Note that absolute times are recorded by the EventLog property for each trigger executed. You can always find the absolute time associated with a data sample by adding its relative time to the absolute time of the associated trigger. Refer to Recording and Retrieving Event Information for more information about returning absolute time information with the EventLog property.


  Extracting Data from the Engine Configuring Analog Input Triggers