| Data Acquisition Toolbox | Search  Help Desk |
Retrieving Logged Information
You can retrieve data, time, events, and engine and hardware information from an existing log file using thedaqread function.
Any part or all of the information stored in a log file can be returned with one call to daqread. In some cases you may want to issue separate calls to daqread to return sample-time pairs, and event, hardware, and engine information. Therefore, the syntax for these two function calls is discussed in separate sections below.
Retrieving Data and Time Information
The logged data can be characterized by the sample number or the time the sample was acquired. Data and time information can be returned with the command[data, time, abstime] = daqread('file', 'P1, V1, 'P2', V2,...);
data is the logged data
time (optional) is the relative time associated with the returned data
abstime (optional) is the absolute time the triggers were issued. abstime is returned as a datenum value and can be converted to a string using datestr.
file is the name of the log file.
'P1', V2, 'P2', V2,&(optional) are the property name/property value pairs listed below. Samples, Time, and Triggers properties are mutually exclusive. Time must be specified as a datenum value. This allows event times to be used when specifying the Time range. If none of these three properties are specified, then all the data will be returned.
The daqread call shown above reads the specified data from file and returns an m-by-n matrix to data, where m specifies the number of samples and n specifies the number of channels. If data from multiple triggers is read, each trigger is separated by a NaN. The amount of data returned and the format of that data is specified with property/value pairs given in the preceding table.
Retrieving Event, Object, and Hardware Information
You can retrieve event, object, and hardware information along with data and time information using the syntax shown below.[data, time, abstime, events, daqinfo] = daqread('file', 'P1',
V1,. . .);
events is a structure containing event information associated with the logged data and daqinfo is a structure containing object and hardware information. All other arguments are described in the previous section.
daqinfo contains two fields: ObjInfo and HwInfo. ObjInfo is a structure containing property information for the device object and any channels it contains. HwInfo is a structure containing hardware information. The hardware information returned is identical to that given by daqhwinfo(obj).
events contains the appropriate event structure based on the samples, triggers or time specified, and is identical to the information returned by daqinfo.ObjInfo.EventLog. The entire event log is returned only if samples, time, and triggers are not specified.
Alternatively, you can return only object and hardware information with the command
daqinfo = daqread('file', 'info');
daqinfo.ObjInfo.EventLog.
Note:
daqread if the specified file is open.