| Data Acquisition Toolbox | Search  Help Desk |
Calculating Time
Relative and absolute time information can be returned to you via thegetdata 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 thegetdata 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.
[data, time, abstime] = getdata(AI); abstime abstime = 7.3000e+005You can then convert the absolute time to a string using
datestr.
abstime_str = datestr(abstime,13) abstime_str = 11:55:14
Relative Time
Relative time is returned with thegetdata 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.