Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

How to achieve desired sample rate?

Hi,

 

I'm having a problem with sampling rate of DAQ card.

 

I'm using Labview PDA 8.5 version and DAQ card 6004. I'm trying to read data from a hardware unit with DAQ card placed on a PDA at a rate of 9600(or 4800) samples per second. 

 

So, I think I have 2 things to configure. 1) DAQ BaseMx Task Configuration utility and 2) Samples per channel part of DAQMx Base read vi. On DAQ Config tool there is Scan Rate and Number of scans. Scan rate should be set to 9600 Hz for my purposes but I have no idea about what is number of scans is for. In this config, when I set Samples per channel greater than 10000, I receive "Memory Overflow" error. 

 

I would like to read 144000 samples at 9600 Hz which should finish in 15 seconds. How can I achieve this? Could you please help me?

 

Omer

0 Kudos
Message 1 of 13
(4,178 Views)

Hi Omer,

 

I was unable to get the information in you DAQmx Base Task.  Could you generate this code for me and attach it to your next post, so I can see exactly how you are configuring your task?

Regards,

Sara Lewandroski
Applications Engineer | National Instruments
0 Kudos
Message 2 of 13
(4,147 Views)

I've attached.

 

Thx,

Omer

0 Kudos
Message 3 of 13
(4,127 Views)

Hi Omer,

 

I cannot open this .cfg.  Could you generate the code in LabVIEW, and send me the VI? 

Regards,

Sara Lewandroski
Applications Engineer | National Instruments
0 Kudos
Message 4 of 13
(4,104 Views)

Hi,

 

You should import this .cfg file via DAQ Config tool.  I'm sorry but I couldn't understand what do you mean by "generate the code"? Can you please show me?

 

Regards,

Omer 

0 Kudos
Message 5 of 13
(4,092 Views)

I couldn't receive any responses 😞

 

Omer

0 Kudos
Message 6 of 13
(4,013 Views)
Setting the number of samples to be greater tnan the rate is a bad idea, in my opinion. Instead, just set a loop to run for x amount of time.
0 Kudos
Message 7 of 13
(4,001 Views)

Thx for the quick reply.  I have some questions but. What does "number of scans" mean? Also, why it's not not a good idea to set number of samples greater than sample rate? I think I have some problems understanding these terms. Could you please help me how to set these values to achieve 144000 samples in a rate of 9600 Hz and in 15 seconds?

 

Regards,

Omer

0 Kudos
Message 8 of 13
(3,994 Views)

A single scan is a sample taken at each channel in the scan list so number of scans is simply how many times you sample each channel.

 

I don't like to use a high number of scans because of the buffer size problem and you cannot quickly stop an acquisition loop. Obviously, you need a much bigger buffer to hold many seconds of scans than a single second. To acquire x number of samples, set the while loop to stop when the iteration count is greater than number of samples/sample rate. You can use functions on the timing palette to execute a while loop for any time you want. The elapsed time function is perfect for this and simple to use.

0 Kudos
Message 9 of 13
(3,988 Views)

But I see that it does not work as I expected. If I set number of samples to 8000 lets say and sample rate to 9600, I see that my program can read this amount of samples in 17 seconds whereas I expect it to be lower than 1 second. So, what is wrong with my program?

 

Regards,

Omer

0 Kudos
Message 10 of 13
(3,971 Views)