LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Can we apply a sampling rate of 44.1kHz in a Labview project to synchronize two signals?

Hi,

 

I am a new user of Labview. I am using a NI-USB 6009 DAQ device to record simultaneously 2 analog input voltage signals coming from 2 different devices (an acoustic sensor and a flow sensor) and wanted to sample both signals at 44.1kHz.

 

The maximum sampling rate I could apply as an input of the DAQmx Timing.vi was 24kHz. Is 24kHz the maximum sampling rate that can be applied using the DAQmx Timing.vi? Or is this problem due to the NI-USB 6009 I am using?

 

You can download the code I created. I would really appreciate any help.

 

Thank you very much.

0 Kudos
Message 1 of 13
(3,684 Views)

The spec is 48kS/s, then divide that by your 2 channels and you get 24kS/s.  It is a limitation of your DAQ board.  You might want to consider something more like the USB-6210.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 2 of 13
(3,679 Views)

24 kHz at 2 channels is 6009 limitation.

Before you get into MHz rates, it will be limited by board spec (or programming), then transfer rates, required processing and PC capabilities may start causing errors.

Look at Max sampling rate (aggregate) specification in the manual, usually NI specifies it on the specification page of the board (6009)

0 Kudos
Message 3 of 13
(3,675 Views)

Thank yoy very much!

 

I tried with another DAQ device (NI USB 6211) applying the same Labview code. With this DAQ, the maximum sampling rate is 250kS/s, so it should work at 44.1kHz. But I can’t record 2 signals on a synchronized way, I just obtain voltage data of one of those channels. Do you know how is that possible?

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

Hi helena,

 

Do you know how is that possible?

Well, you made something wrong?

 

You might attach your VI before we might be able to answer your questions!?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 5 of 13
(3,601 Views)

helenalacalle wrote:I tried with another DAQ device (NI USB 6211) applying the same Labview code. With this DAQ, the maximum sampling rate is 250kS/s, so it should work at 44.1kHz. But I can’t record 2 signals on a synchronized way, I just obtain voltage data of one of those channels. Do you know how is that possible?

Something sounds very wrong with your setup then.  Is it still the same code as above?


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 6 of 13
(3,596 Views)

Yes my VI is still the same as the one I attached above. And about my setup, the two output signals and grounds (from the two sensors that I want to synchronize) seem to be correctly connected to the NI USB 6211, i checked the datasheet. Also, if I try to record one of those sensors (selecting just one analog input), the code works. 

 

Any ideas? 

0 Kudos
Message 7 of 13
(3,580 Views)

Exactly what error are you getting?  I am wondering if you are getting a buffer overflow error.  You might want to consider writing to a TDMS file instead of xlsx.  Or, even better, use the DAQmx Configure Logging feature so that you do not even need to mess around with the file IO: DAQmx will do it all for you.

 

Another note from messing with your code, you should be using Charts instead of graphs.  Charts keep a history while graphs just show the last thing you wrote to it.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 8 of 13
(3,553 Views)

Okay, the thing is that I am not obtaining any error with that code. It is just that the plots that are obtained are not logical at all. Sometimes I get just the flow signal and the acoustic signal is a constant line at one particular voltage (so the voltage signal is not being captured by Labview); sometimes viceversa; ...

At the datasheet of the NI USB 6211 it says that there is just one analog ground (one input of the DAQ where I can add the ground wires), so I added the two ground wires at this DAQ input; is that okay? Perhaps that is the problem.

 

Anyway, I wrote a DAQ Assistant code which is easier than the DAQmx code I had, you can download it. I reached my objective, I obtained an Excel file with the voltage data of both the acoustic and the flow sensor. 

 

Thank you very much for your advices about the Labview Code.. 🙂

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

Hi Helena,

 

now you got exactly the same type of VI that NI is always proposing on their hands-on seminars… (Sarcasm!)

 

Do you really want to take 480k samples at a sample rate of 48k? Waiting 10s for data to arrive? With a timeout value of exactly 10s?

 

Hint: Right-click the DAQAssistent and select "Open Front panel" to convert it to a "standard" VI…

Or examine the VIs in the example finder on DAQmx...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 10 of 13
(3,497 Views)