Data Acquisition Toolbox
  Function/Property:
    Search    Help Desk 

Calculating Time

Relative and absolute time information can be returned to you via the getdata function and the TriggerTime property. getdata can return a vector of relative times associated with the extracted data, as well as the absolute time of the first trigger. TriggerTime contains the absolute times for each trigger executed. Absolute time and relative time are explained below.

Absolute Time

Absolute times are recorded for each trigger issued. Absolute time can be returned with both the getdata function and TriggerTime property. TriggerTime is discussed in detail in "Configuring Triggers".

Absolute time is returned in datenum form. It is often convenient to convert a datenum value to a string using datestr. The example below illustrates how you can return data, relative time and absolute time using getdata.

You can then convert the absolute time to a string using datestr.

Relative Time

Relative time is returned with the getdata function. time = 0 corresponds to the time the first sample is logged by the data acquisition engine. Time is measured continuously until the acquisition is stopped. You can always find the absolute time that a sample was acquired at by adding its relative time to the absolute time of the preceding trigger. Absolute trigger times are given by the TriggerTime property.



[ Previous | Help Desk | Next ]