微波EDA网,见证研发工程师的成长!
首页 > 研发问答 > 测试测量 > 虚拟仪器 > 谁详细研究过buffer size,每循环读出数据量,采样率

谁详细研究过buffer size,每循环读出数据量,采样率

时间:12-13 整理:3721RD 点击:
谁详细研究过buffer size,每循环读出数据量,采样率之间的关系?
每次修改单次循环读出数据长度的时候就要反复实验才能得到合适的buffer size郁闷
按理说,读出速度应该很快,只要buffer size比单词循环读出数据量大很多
就不应该有什么问题啊
为什么改短了单次循环数据读出量反而会常常overflow
越发不懂了

没看明白你说的是啥。。。。

没仔细看过,不过在DAQmx Help里面有这样的内容可以参考一下:
How Is Buffer Size Determined?
Input Tasks
If your acquisition is finite (sample mode on the Timing function/VI set to
Finite Samples), NI-DAQmx allocates a buffer equal in size to the value of
the samples per channel attribute/property. For example, if you specify
samples per channel of 1,000 samples and your application uses two channels,
the buffer size would be 2,000 samples. Thus, the buffer is exactly big
enough to hold all the samples you want to acquire.
If the acquisition is continuous (sample mode on the Timing function/VI set
to Continuous Samples), NI-DAQmx allocates a buffer equal in size to the
value of the samples per channel attribute/property, unless that value is
less than the value listed in the following table. If the value of the
samples per channel attribute/property is less than the value in the table,
NI-DAQmx uses the value in the table.
Sample Rate Buffer Size
no rate specified 10 kS
0–100 S/s 1 kS
100–10,000 S/s 10 kS
10,000–1,000,000 S/s  100 kS
>1,000,000 S/s 1 MS
You can override the default buffer size by calling the Input Buffer Config
function/VI.
NI-DAQmx does not create a buffer when the sample mode on the Timing
function/VI is set to hardware-timed single point.
Note  Using very large buffers may result in diminished system performance
due to excessive reading and writing between memory and the hard disk.
Reducing the size of the buffer or adding more memory to the system can
reduce the severity of these problems.
Output Tasks
For generations, the amount of data you write before starting a generation
determines the size of the buffer. The first call to a Multiple Samples
version of the Write function/VI creates a buffer and determines its size.
You also can use the Output Buffer Config function/VI to create an output
buffer. If you use this function/VI, you must use it before writing any data.
The samples per channel attribute/property on the Timing function/VI does not
determine the buffer size for output. Instead it is the total number of
samples to generate. If n is your buffer size, setting samples per channel to
3×n generates the data in the buffer exactly three times. To generate the
data exactly once, set samples per channel to n.
NI-DAQmx does not create a buffer when the sample mode on the Timing
function/VI is set to hardware-timed single point.

早看过几百遍了
还是没对我的问题有任何帮助
我设置的buffer size是他们推荐值的5倍
而且最古怪的是,每循环的读取长度越小,buffer size需求越大
快晕死了
我猜估计是win好不容易给daq一次读取时间
如果一次只读取一小段,buffer反而很容易满
如果一次读一大半buffer的长度,由于实际读取耗时相当短
所以不需要频繁取buffer,对buffer需求量反而小.
大家不知道用过stream to disk没有
不知道实际使用的时候对硬件有什么要求?

【 在 draculalord ( 嗯?) 的大作中提到: 】
早看过几百遍了
还是没对我的问题有任何帮助
我设置的buffer size是他们推荐值的5倍
而且最古怪的是,每循环的读取长度越小,buffer size需求越大
快晕死了
我猜估计是win好不容易给daq一次读取时间
+++++++++++++++++++++++++++++++++++++
如果一次只读取一小段,buffer反而很容易满
如果一次读一大半buffer的长度,由于实际读取耗时相当短
所以不需要频繁取buffer,对buffer需求量反而小.
+++++++++++++++++++++++++++++++++++++
上面这一段很正确啊,读得越快所需的buffer size越小
想读的快就得每次多读,比如去超市购物,是一次多买还是每次买一点买多次省时间?
大家不知道用过stream to disk没有
不知道实际使用的时候对硬件有什么要求?

Copyright © 2017-2020 微波EDA网 版权所有

网站地图

Top