NI LabVIEW,CVI,数据采集等产品讨论区

取消
显示结果 
搜索替代 
您的意思是: 

为什么在连续采样时还要设置每次采样点数?

在设置任务时,其中要设置两个参数,一个是"采样频率"(Rate(Hz)),另外一个是"每次采样点数"(Samples To Read).在连续采样中,设置这个参数还有意义吗?谢谢
0 项奖励
1 条消息(共 16 条)
11,630 次查看
意义重大。
采样率决定了采样的精度。采样点数决定了每次传到pc内的数据量。比如点数设为1000,pc内会开辟初始大小1000的buffer(buffer大小可以自己改), 板卡就每采1000点往pc传一次。程序每次从buffer读1000点进行处理。所以如果你每次处理需要更多数据,可以增加采样点数。
Ryan Shi
National Instruments
2 条消息(共 16 条)
11,623 次查看
那一般采样点数设为多少合适呢?
另外,如果我选择了"N Samples",那N的值在哪里设置呢?谢谢
0 项奖励
3 条消息(共 16 条)
11,618 次查看
N就是samples to read的值。
samples to read相对于rate不要太低,也不要太高。太低会buffer溢出,太高则不流畅。
 
Ryan Shi
National Instruments
4 条消息(共 16 条)
11,616 次查看
恩,我明白了,谢谢你.
0 项奖励
5 条消息(共 16 条)
11,608 次查看
我也有同样的问题啊,就是关于samplerate&buffer size的相对大小问题
 
我遇到的情况比较奇怪
 
刚开始分别设为100k&100,结果程序只采了55个数
 
然后我设为10k&100,程序就采了100个数
 
最后我又换成100k&100,程序仍旧采100个数
 
这我就不懂了,难道要用10k的比较适合的samplerate带一下,才能用100k的samplerate么?
 
还请高手多多指教啊
6 条消息(共 16 条)
11,599 次查看
缓冲区太小了吧,就给100,你也太吝啬了。
---------------------------
Lady And Basketball Vividly In my Exciting World !!!
Daniel.Tang E-mail: tangye@friendess.com
7 条消息(共 16 条)
11,594 次查看
再请教下各位,采样频率是指PC程序中每秒钟采用的点数吗?最终存储的数据长度是不是只与采样频率有关系,与采样点数没有关系.采样频率和采样点数有没有直接关系呢?
此外,板卡每次传到PC中的点数(采样点数)的间隔时间应该远远小于1s吗?具体是多长时间.
谢谢各位!
0 项奖励
8 条消息(共 16 条)
11,110 次查看

采样频率是指PC程序中每秒钟采用的点数吗?---------------------------------------------------不是,是指采集卡每秒钟采集的次数.

最终存储的数据长度---------只与你在程序中存储的数据长度有关.

采集卡采集到的数据不是采一次传一次,而是采集到一定数量传一次,这一定数量就是由采样点数决定的.

板卡每次传到PC中的点数(采样点数)的间隔时间应该远远小于1s吗?-------------------这就取决你的实际应用了,比如你要求你的程序中对数据更新的要求不是很高,可以很长时间再传一次,当然这时要设置较低的采样频率,否则会溢出.

0 项奖励
9 条消息(共 16 条)
11,096 次查看

Please refer to the Daqmx help file as following:

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.

0 项奖励
10 条消息(共 16 条)
11,083 次查看