ni.com is currently experiencing unexpected issues.

Some services may be unavailable at this time.

Multifunction DAQ

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

Data read from continuous DAQmx analog input for queuing is not synchronized for dequeuing...

Please see the attached VI. In this VI, I used DAQmx analog input to continuously read data of 1 second long (sampling-rate samples) and thus immediately put it into a queue. Meanwhile there is a loop running in parallel to dequeue that data. In principle the data should be dequeued per second that means the loop index should increase every one second. So in this VI, I simulated this senario using two other loops to make sure the period for such push/pull paradigm is correct. In the timed loop, I generate the data into another queue every one second. And another loop running simutaneously to dequeue that data. If you run my VI, you will see the loop index (Numeric2) for simulation case really increases for every one second. However, in the DAQ-input case, the loop index (Numeric1) increased way too fast...(in milli-seconds interval). Why could this be possible? Can anyone help me to solve this puzzle? It's a very important design pattern for my experimental applications. Thanks a lot!
0 项奖励
1 条消息(共 6 条)
4,623 次查看

A couple things:

If you don't specify the "Number Of Samples per Channels" on the DAQmx read, it will read the number of samples available. If you specify that to be the same as the input to your DAQmx Timing vi, you should see the behavior you're expecting:

Also, if you are using a simulated device, make sure you have DAQmx 8.3 or later. Otherwise it will just run as fast as possible.

Hope this helps,

Andrew S

National Instruments

Message Edited by stilly32 on 06-18-2007 03:22 PM

Message Edited by stilly32 on 06-18-2007 03:23 PM

0 项奖励
2 条消息(共 6 条)
4,620 次查看

Hi, Andrew:

Thank you very much for your quick reply! I used the PCI-6229 M-Series DAQ card for the VI. But I am not sure which version of DAQmx driver it is. I am using LabVIEW 8.0. Could you please tell me how to check out the DAQmx version?

For contineous acquisition, I am still confusing with specifying the "Number of Samples per Channel" on the DAQmx Read as well as the "Samples per Channel" on DAQmx Timing vi. Do you mean that I have to leave it unwired as default (-1) on DAQmx Read and set the "Samples per Channel" on the DAQmx Timing as the number of samples per buffer, say in my case 32000 samples (1 second long)? Or vice versa? What indeed the differences between either singly or both setting the "samples per channel" on DAQmx Timing and "number of samples per channel" on DAQmx Read, respectively?

3 Possible combinations for continuous acquisitions:

DAQmx Timing(samples per channel)   DAQmx Read(number of samples per channel)

  32000                                                                    -1

     -1                                                                     32000

32000                                                                   32000

Could you tell me the outcome of these different combinations? Thanks.

 

Claude Wang,

 

 

0 项奖励
3 条消息(共 6 条)
4,604 次查看

Hey Claude,

The input to the DAQmx Timing VI helps determine the buffer size, check out the "How Is Buffer Size Determined?" section in the DAQmx Help. The input to the DAQmx Read determines how many samples you pull from the buffer for each read. If you specify -1, it just grabs however many samples are avialable in your buffer and returns, if you specify a certain amount, the DAQmx read will wait until the specified number of samples have been acquired and then return. What I meant to show was that if you want to grab a full seconds worth of data at 32kS/s, you'd want to grab 32k samples at a time.

For your table, the buffer size is going to be 100k (see the DAQmx Help section) for a continuous acquistionat 32k. The only difference will be how fast you read based on your inputs to DAQmx Read.

Hope this helps,

Andrew    

0 项奖励
4 条消息(共 6 条)
4,583 次查看

Thank you very much, Andrew! It's really helpful...

However, I have another question which will be the last one I am gonna ask! I will establish a new post for it. If you have time, please go to take a look to give me some help! Thanks again!

Claude.

0 项奖励
5 条消息(共 6 条)
4,560 次查看
Hi, Andrew:
 
I have posted another problem that made me to struggle for more than one week. Could you please also do me a favor to take a look at:
to give me some helps? Thanks a lot.
 
Claude.
0 项奖励
6 条消息(共 6 条)
4,539 次查看