can通道采样频率_数据采集中的采样率、缓冲区大小以及,每通道采样数之间的关系...

在使用DAQmx进行数据采集时,采样数据会经历从设备到计算机内存的两个重要转移步骤。采样率、缓冲区大小和每个通道的采样数密切相关。当设置为连续采样时,'Samples per Channel'用于确定缓冲区大小,而'DAQmx Read VI'中的'Number of Samples per Channel'输入参数则设定每次从缓冲区读取的数据块大小。如果采样率不足以在超时时间内生成指定大小的数据块,会导致超时错误。设置'Number of Samples per Channel'为-1将读取缓冲区中所有可用数据。
摘要由CSDN通过智能技术生成

Why Do I Have to Specify a Number of Samples to Read When

Continuously Acquiring Data?

Primary Software:LabVIEW

Development Systems>>LabVIEW Base Development

System

Primary Software Version:1.0

Primary Software Fixed Version:N/A

Secondary Software:SignalExpress>>Development

System

Problem:Why

Do I Have to Specify a Number of Samples to Read When Continuously

Acquiring Data?

Solution:When

performing an acquisition with DAQmx , the acquired data is

transferred into your software (LabVIEW, SignalExpress, C-code,

etc) in two important transfer steps:

Data

is transferred from the DAQ device into the memory (RAM) of your

computer. There is a finite amount of space in the RAM, called the

buffer, which is reserved for that transfer.

Data

is read from the buffer and into your software memory in chunks.

When you are prompted to enter a number of samples on the DAQmx

Read VI, it is asking for the size parameter of this transfer.

When

you configure the DAQmx Timing VI for your task in LabVIEW,

theSamples

per Channelvalue

has a different effect depending on whether theSample

Modeis

set toContinuous

SamplesorFinite

Samples.

ForFinite

Samples, theSamples per

Channeldetermines the exact number

of samples to acquire before the task completes.

ForContinuous

Samples, theSamples per

Channelis used to determine the

size of the buffer.

When you configure the DAQmx Read VI, you are essentially

configuring the second transfer from the buffer to the software

memory. In this VI, there is an input calledNumber

of Samples per Channel.

When the task sampling mode is set to continuous,

theNumber

of Samples per Channelinput

sets the size, in samples, of each chunk that is read from the

buffer into the software.

In Signal Express, this parameter is input asSamples

to Read,

in theConfigurationtab

of theStep

Setup.

It should be noted that the DAQmx Read VI waits until a chunk of

data at least that big exists in the buffer before it takes the

data off of the buffer and pulls it into the software for

processing. Therefore, if the sampling rate is not fast enough to

create a chunk of this size in the time allotted by the timeout,

the VI will throw a timeout error. To prevent this, increase the

timeout or reduce theNumber

of Samples per Channel.

In LabVIEW, you also have the option of setting the value

ofNumber

of Samples per Channelto

be -1, which is the default setting in LabVIEW if no value is

specified. When theNumber

of Samples per Channelis

set to -1, the DAQmx Read VI will read all data that is available

in the buffer. If no data is available in the buffer, the DAQmx

Read VI will return an empty array.

Related Links:KnowledgeBase

2V3FK03J : Samples Per Channel Input of -1 On the DAQmx Read

VI

KnowledgeBase 27R8Q3YF: How Is the Actual Scan Rate Determined When

I Specify the Scan Rate for My Data Acquisition?

Attachments:

Report Date:2009-03-30

Last Updated:2015-03-03

Document ID:4VTI04BQ

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值