主要内容

daqread

数据采集​​工具箱(。daq) file

Syntax

data = daqread('fileName')
[数据,时间] = daqread(。。。)
[数据,时间,戒指] = daqread(...)
[数据,时间,戒指,事件] = daqread(...)
[data,time,abstime,events,daqinfo] = daqread(...)
data = daqRead(...,,'Param1', Val1,...)
Daqinfo= daqread('filename','info')

Description

data = daqread('fileName')reads all the data from the Data Acquisition Toolbox™ (。daq) file specified byfilenamedaqreadreturns数据, anm-经过-n数据矩阵,其中mis the number of samples andn是频道的数量。如果数据includes data from multiple triggers, the data from each trigger is separated by aNaN。如果您设置输出格式property totscollection,daqread返回时间系列集合对象。请参阅下面的详细信息。

[数据,时间] = daqread(。。。)返回时间/价值对。timeis anm-经过-1 vector, the same length as数据, that contains the relative time for each sample. Relative time is measured with respect to the first trigger that occurs.

[数据,时间,戒指] = daqread(...)returns the absolute time of the first trigger.abstimeis returned as a向量。

[数据,时间,戒指,事件] = daqread(...)returns a log of events.events是包含事件信息的结构。如果指定样品,Time, orTriggers参数(见下文),事件结构仅包含指定的事件。

[data,time,abstime,events,daqinfo] = daqread(...)返回结构,Daqinfo, that contains two fields:ObjInfohwinfoObjInfo是包含属性名称/属性价值对的结构和hwinfo是包含硬件信息的结构。整个事件日志返回到daqinfo.objinfo.eventlog

data = daqRead(...,,'Param1', Val1,...)specifies the amount of data returned and the format of the data, using the following parameters.

Parameter

Description

样品

指定样品范围。

Time

Specify the relative time range.

Triggers

Specify the trigger range.

Channels

指定通道范围。频道名称可以指定为单元格数组。

DataFormat

Specify the data format asdoubles(default) or本国的

TimeFormat

Specify the time format asvector(default) ormatrix

输出格式

Specify the output format asmatrix(the default) ortscollection。指定时tscollection,daqread仅返回数据

样品,Time, 和Triggersproperties are mutually exclusive; that is, you can specify only one of them in a function call.

Daqinfo= daqread('filename','info')从文件中返回元数据Daqinfo结构,也不会引起从文件中读取数据的开销。这Daqinfostructure contains two fields:

Daqinfo。ObjInfo

a structure containing parameter/value pairs for the data acquisition object used to create the file,filename。Note: The用户数据property value is not restored.

Daqinfo。hwinfo

a structure containing hardware information. The entire event log is returned todaqinfo.objinfo.eventlog

Examples

这个例子展示了如何读取数据,得救了to the log filedata.daqin an earlier release. This logging was achieved by specifying the logging properties of ananaloginputobject as described inanaloginput。你用daqreadto retrieve the data and other acquisition related information.

读all the sample-time pairs fromdata.daq:

[数据,时间] = daqread('data.daq');

读samples 500 to 1000 for all channels fromdata.daq:

data = daqRead('data.daq','Samples',[500 1000]);

从文件中仅读取频道指数2、4和7的1000至2000的样品。data.daq:

data = daqRead('data.daq','Samples',[1000 2000],。。。'Channels',[2 4 7],“ dataformat','native');

读only the data that represents the first and second triggers on all channels from the filedata.daq:

[数据,时间] = daqread('data.daq','Triggers', [1 2]);

data.daq:

Daqinfo= daqread('data.daq','信息'); chaninfo = daqinfo.ObjInfo.Channel;

Obtain a list of event types and event data contained indata.daq:

Daqinfo= daqread('data.daq','信息'); events = daqinfo.ObjInfo.EventLog; event_type = {events.Type}; event_data = {events.Data};

读all the data from the filedata.daq和return it as a time series collection object:

data = daqRead('data.daq','OutputFormat',“ tscollection');

提示

More About .daq Files

  • 如果读取来自多个触发器的数据,则会通过发出的触发器数量增加结果数据阵列的大小,因为每个触发器都被一个触发器分开NaN

  • ObjInfo.EventLogalways contains the entire event log regardless of the value specified by样品,Time, orTriggers

  • 用户数据property value is not restored when you return device object (ObjInfo) information.

  • 什么时候reading a。daqfile, thedaqreadfunction does not return property values that were specified as a cell array.

More About Time Series Collection Object Returned

什么时候输出格式被设定为tscollection,daqread返回时间系列集合对象。此时间序列集合对象包含文件中每个通道的绝对时间序列对象。以下描述了如何daqreadsets some of the properties of the time series collection object and the time series objects.

  • timeproperty of the time series collection object is set to the value of theInitialTriggerTimeproperty specified in the file.

  • nameproperty of each time series object is set to the value of theNameproperty of a channel in the file. If this name cannot be used as a time series object name,daqread设置name to'渠道'HwChannel附加频道的属性。

  • 价值单位property of the time series object depends on the value of theDataFormatparameter. If theDataFormat参数设置为'double',daqread设置Datainfo集合中每个时间序列对象的属性单位property of the corresponding channel in the file. If theDataFormat参数设置为'native',daqread设置单位property to'native'

  • Each time series object will havetsdata.event附加对应于与通道相关的事件日志的对象。