Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

How to play a short sound on top of constant tone.

Hello all,

 

I'm trying to play a constant tone on one channel of a DAQ9171, and play various short chirps on top of that tone. I'm using two separate channels, but I'm getting the Error -201105. Can I not use the two channels independently? If not, any ideas how I can accomplish this?

 

Thanks in advance.

0 Kudos
Message 1 of 5
(4,088 Views)

Appologies, it is a NI 9263.

0 Kudos
Message 2 of 5
(4,040 Views)

This error says that the DAQ Analog output resources are already being used by another DAQ task. In order to output the two signals you are going to have to combine them into one task. If you would like for each tone to be output to a different channel, try altering the task to be N channels, N samples. If you If you want them to output on the same channel, try adding the arrays together before you send it to the DAQmx write VI.

 

Jeremy P.

Applications Engineer
National Instruments
0 Kudos
Message 3 of 5
(4,029 Views)

Thanks for responsing, but doing it that way does not allow for me to continuously play the tone, and play the chirp independently without first stopping the tone, then recreating the task with the two outputs, correct?

0 Kudos
Message 4 of 5
(4,025 Views)

I believe that you should be able to still play the first tone continually while playing the next tone. You can do this by only sending small chunks of data at a time to the DAQmx Write VI.

 

On a lower level, all that the DAQmx Write VI does is send the data points that you input to it to a temporary buffer where those points wait for their turn to be output on the DAQ hardware. You can enqueue small chunks of data at a time (about 100 ms would be appropriate) each time you call the DAQmx Write VI. The timing mechanism on the DAQ card will regulate the output of these data samples to the rate that you had configured in the DAQmx Timing VI. It would probably be a good idea to put the DAQmx Write VI in a while loop so that you can repeatly input new data points until the user wants to stop. During each loop, you send a set of data points that contains just the first tone or you can send some data points that contains the first tone plus the second tone. You can use the Wait (ms) VI inside the While loop to regulate how often you add another set of data points to the DAQmx buffer. In this case you would want to wait for the same amount of time as the length of the data that you are inputing so that the amount of data in the buffer doesn't get too large or too small.

 

Jeremy P.

 

 

Applications Engineer
National Instruments
0 Kudos
Message 5 of 5
(4,006 Views)