Data Acquisition Toolbox    
daqread

Read a Data Acquisition Toolbox (.daq) file

Syntax

Arguments

'file'
A Data Acquisition Toolbox (.daq) file.
'PropertyName'
A daqread property name.
PropertyValue
A daqread property value.
'info'
Specifies that device object and hardware information are to be returned.
data
An m-by-n array where m is the number of samples and n is the number of channels.
time
An m-by-1 array of relative time values where m is the number of samples.
abstime
The absolute time of the first trigger.
events
A structure containing event information.
daqinfo
A structure containing device object and hardware information.

Description

data = daqread('file') reads all the data from file. data is an m-by-n data matrix where m is the number of samples and n is the number of channels. If data includes data from multiple triggers, then m is increased by the number of triggers because of the addition of NaN's.

data = daqread('file','PropertyName',PropertyValue,...) reads the specified data from file. The amount of data returned and the format of the data is specified with the properties shown below.

Property Name
Description
Samples
Specify the sample range.
Time
Specify the relative time range.
Triggers
Specify the trigger range.
Channels
Specify the channel range. Channel names can be specified as a cell array.
DataFormat
Specify the data format as doubles or native.
TimeFormat
Specify the time format as vector or matrix.

The Samples, Time, and Triggers properties are mutually exclusive.

[data,time] = daqread(...) returns sample-time pairs. time is a vector with the same length as data and contains the relative time for each sample. Relative time is measured with respect to the first trigger that occurs.

[data,time,abstime] = daqread(...) returns sample-time pairs and the absolute time of the first trigger. abstime is returned as a clock vector.

[data,time,abstime,events] = daqread(...) returns sample-time pairs, the absolute time of the first trigger, and a log of events. events contains the appropriate events based on the Samples, Time, or Triggers value specified. The entire event log is returned only if Samples, Time, or Triggers is not specified.

[data,time,abstime,events,daqinfo] = daqread(...) returns sample-time pairs, the absolute time, the event log, and the structure daqinfo, which contains two fields: ObjInfo and HwInfo. ObjInfo is a structure containing property name/property value pairs and HwInfo is a structure containing hardware information. The entire event log is returned to daqinfo.ObjInfo.EventLog.

daqinfo = daqread('file','info') returns the structure daqinfo, which contains two fields: ObjInfo and HwInfo. ObjInfo is a structure containing property name/property value pairs and HwInfo is a structure containing hardware information. The entire event log is returned to daqinfo.ObjInfo.EventLog.

Remarks

More About .daq Files

Example

Suppose you configure the analog input object ai for a National Instruments board as shown below. The object acquires one second of data for four channels, and saves the data to the output file data.daq.

After the data has been collected and saved to a disk file, you can retrieve the data and other acquisition-related information using daqread. To read all the sample-time pairs from data.daq:

To read samples 500 to 1000 for all channels from data.daq:

To read the first 0.5 seconds of data for channels 1 and 2 from data.daq:

To obtain the channel property information from data.daq:

To obtain a list of event types and event data contained by data.daq:

See Also

Functions

getdata

Properties

EventLog, LogFileName, LoggingMode, LogToDiskMode


  daqpropedit daqregister