Academic Hardware Products (myDAQ, myRIO)

cancel
Showing results for 
Search instead for 
Did you mean: 

mydaq

Hi,

I have a quick question that nobody seems to be able to answer. I am using a NI myDAQ and I need to get two inputs (audio in and ai0 (or ai1)) concurrently. I know that both these use the same ADC so i need to create one task with two inputs to avoid the resource conflict error, but when I do so I end up just not getting any output at all. everything runs with no errors, but no output. I can get one or the other (audio in or ai0) separately, but when I join them into a single task nothing its a no-go.

 

Please PLEASE help me resolve this issue. I have been combing the forums and tearing my hair out for the past week.

0 Kudos
Message 1 of 5
(6,453 Views)

Hi pegasus1,

 

I took a quick look at the VI and observed the behavior as mentioned by you.

 

To resolve that,

I then created a constant of 1000 and wired it to 'number of samples per channel' terminal of the DAQmx Read in the While loop.

 

This terminal tells DAQmx, how many values to read each time. By default the value is -1, by not wiring any other value to this terminal, it will read the values that are there in the buffer and gives us whatever is available. Probably it was reading very less points for every Read operation (may be just 1 point). This might be the reason why you were not able to see the data.

 

Hope it helps!

0 Kudos
Message 2 of 5
(6,434 Views)

Hi, thanks for your reply. I tried the constant thing before and it works when I'm just trying to get ai0 and ai1... but when I try to get ai0 and audio in it still doesnt work. Maybe I'm doing something wrong?

0 Kudos
Message 3 of 5
(6,423 Views)

You want to make sure your limits are set to -2 to +2V on both audio input and output, and have both left and right in the same DAQ assistant for input and the smae asst. for output.

 

Further, the ai is set at 2V, but it will elt values through above that at times.  For that reason, I ahve tried using an In Range and Coerce VI to force the limits to -2 to +2V before feeding data to the output and have been successful.

 

Best,

Adam
Academic Product Manager
National Intruments
0 Kudos
Message 4 of 5
(6,408 Views)

Hello Pegasus,

 

On myDAQ you cannot use AI and Audio Input in the same task. You are correct that they are multiplexed to the same ADC. Similarly, the two DACs are used to generate the AO0 and AO1 or AudioOutputLeft and AudioOutputRight. We can only output to either AO or AudioOut, but not both simultaneously. To be consistent, we disallow putting AI and AudioIn in the same task.

 

I hope this is helpful.

 

Charles Y.

National Instruments

0 Kudos
Message 5 of 5
(6,350 Views)