05-02-2014 02:43 PM
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.
05-05-2014 07:52 AM
Appologies, it is a NI 9263.
05-05-2014 11:19 AM
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.
05-05-2014 12:11 PM
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?
05-06-2014 08:56 AM - edited 05-06-2014 08:59 AM
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.