Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Wave file I/O using the DAQ-9172

I just got a NI DAQ with LabView, and for starters I want to play a wave file out my DAQ output module, while simultaneously recording to a wave file from my DAQ input module.  I know this basic question has been asked many timesI've spent days looking through the NI forum archives, but I can't seem to get something that works reliably for my needs.  I've tried many of the example VIs posted on the forum, but a lot of the ones that look like they might do what I need use the traditional DAQ drivers, and so far I wasn't able to figure out how to convert them to use the new drivers.
 
Anyhow, here's a summary of what I'd like to do:
  • wave file 1 -> DAQ AO1
  • DAQ AI1 -> wave file 2
  • 5 to 60 seconds of play/record time
  • 96kHz sample rate
  • 16 bits
  • using LabView 8.5 or Signal Express
  • using NI 9263 output module
  • using NI 9215 input module
With what I've tried in LabView and Signal Express, I often get -200284 errors (or various other buffer underrun/overrrun errors).  I read many posts regarding these errors, but it didn't fix the problem.  Also, in Signal Express I can't figure out how to connect "DAQmx Aquire" to "Sound File Write Simple".  To do this in LabView I had to use a build array vi, but I can't seem to get that to work in Signal Express.
 
 
Thanks,
Chris
0 Kudos
Message 1 of 5
(2,922 Views)
You are not very cleau in your explanation but are you aware that you cannot record a sound directly with a analog input of the 9215 module ?
And please post your VI, it makes us understand your errors.
Wilfried.
0 Kudos
Message 2 of 5
(2,902 Views)
Thanks for your response.  I've attached a LabView 8.5 vi and a Signal Express project. 
 
In the case of "Measurement IO Project4.vi" I get -200284 error for record buffer sizes greater than about 1 Meg (~10 seconds).  I've tried various styles of breaking up the aquistions into smaller blocks, but that didn't seem to help.
 
For the signal express project "GenerateTestSignalRecordWaveFile.seproj" I can't figure out how to connect the DAQmx Aquisition output to Sound File Write and I also get -200284 errors for large buffer sizes.
 
 
Thanks,
Chris
0 Kudos
Message 3 of 5
(2,891 Views)

Hi Chris,

I noticed that the error number that you provided for your LabVIEW code is a timeout error. The text should say something like “Some or all of the samples requested have not yet been acquired.” This error can be seen in the Knowledge Base Document 2XQEAPQJ: Common NI-DAQmx Error Codes and Solutions: Codes -200000 to -20029...

The timeout is a parameter of the DAQmx read function. It specifies the amount of time in seconds to wait for the VI to read all the requested samples. The VI returns an error if the time allotted elapses before the read is complete. For input operations, the VI also returns any samples read before the time elapses.

The default timeout is 10 seconds. I believe that this is why, when you tell the DAQ Assistant to acquire more than ten seconds worth of data, you receive an error. You can increase the sample rate that you have specified so that all of the samples are acquired before 10 seconds have passed. Or, if you set timeout to -1, the VI waits indefinitely for the data samples to be returned. This might take care of your problem.

I hope that this helps, Mallori M.

Mallori M
National Instruments
Sr Group Manager, Education Services

ni.com/training
0 Kudos
Message 4 of 5
(2,874 Views)

Thanks Mallori.  I really appreciate your help.  Anyhow, initially I found that changing the timeout parameter didn't make any difference.  It always returned an error at 10 seconds, regardless of whether the timeout parameter was -1, +1, or +100.  But then I tried changing to continuous mode and that in combination with an increased timeout seems to have fixed the problem.  This doesn't totally make sense to me, but at least it works.

-Chris 

0 Kudos
Message 5 of 5
(2,859 Views)