LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Samples Per Channel DAQmx Read VI and DAQmx Timing VI

Hi all, 

 

I am running a continuous acquisition for accelerometer measurements acquiring at 250 kHz sampling rate using the DAQmx Timing VI. My question is for the samples per channel in the DAQmx Read and DAQmx Timing. I configured the sampling rate but I am a bit confused of how to set up the samples per channel in the DAQmx Read and DAQmx Timing.

 

The speed at which the DAQ hardware acquires samples is always given by the sample clock settings (DAQmx Timing), and this part of the acquisition is entirely done by the hardware. So the 250 kHz sampling rate is allocated to the timing function. For continuous acquisition, the samples per channel in the DAQmx Timing VI determines the size of the buffer, in other words the amount of space in the RAM. The DAQmx Read VI determines the software readings.  

 

I used 125 kHz for the number of samples in the DAQmx Read VI but my computer crushes. I used 1 sample per scan in the DAQmx Read VI and it seems to be working really quick. On the other hand, I understand that the samples per channel in the DAQmx Timing VI sets the buffer size for finite acquisition. Of course, I would like to view the waveform graph, but I am not quite sure of the exact values that I need to specify for samples per channel for both DAQmx Read and DAQmx Timing. Any suggestions of how to set up correctly the settings for the acquisition would be much appreciated. Thanks in advance.

0 Kudos
Message 1 of 7
(3,378 Views)
Hi Lynn,

Quick answer: don't set #samples at DAQmxTiming. At DAQmxRead you set the number according to desired loop rate. Default recommendation is to use a loop rate of 10Hz, so you should read 25kS!
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 7
(3,371 Views)

Hello GerdW, 

 

Your answer is appreciated. If 25 kHz is used for in the DAQmx Read VI as can be seen in the attached screenshoot, the computer crushes :/..The computer is not that fast as the hardware. 

 

Regards, 

0 Kudos
Message 3 of 7
(3,361 Views)

Hi Lynne,

 

what do you mean by "crushes"?

BSOD? DAQmx error messages?

 

What kind of computer do you use?

How many channels are you reading?

Applications like this have been run an computers more than 10years ago…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 7
(3,329 Views)

Hi GerdW, 

 

Number of channels:7

 

The data stored in RAM is huge..The computer used for the operation is a HP laptop..There is no error message, despite the fact that the user interface is quite slow. So, most of the applications use a default recommendation for loop rate of 10 Hz?

 

Regards,

0 Kudos
Message 5 of 7
(3,315 Views)

Hi Lynne,

 

The data stored in RAM is huge.

Why is it "huge"? In the image you have shown all you have is 25kS for 7 channels and a datacopy for the waveform graph. That's not huge…

 

There is no error message, despite the fact that the user interface is quite slow.

When there is no error message your program is working. How do you know it "crushes"?

Having a slow UI is no problem of the DAQmx routine, it's a problem your your programming style…

 

So, most of the applications use a default recommendation for loop rate of 10 Hz?

That's a recommendation to start with DAQmx. You can adapt it to your needs/requirements…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 6 of 7
(3,303 Views)

GerdW, the VI works fine now. I have one more question. The frequency rate means how 'fast' your data are aquired. The number of samples in the channel means how many samples you acquire per one iteration of the loop.

 

If you take it step by step, I would like to capture the readings as fast as possible with as many samples as possible. The sampling rate happens in the hardware and not in the software. Where is the number of samples per iteration being specified in the hardware? 

Regards,

 

0 Kudos
Message 7 of 7
(3,285 Views)