Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I use multiple analog output channels with PCI-6731?

I need to have my sound files playing through one AO channel, while the other AO would have constant noise being generated. I've tried adding an extra channel to the DAQ-assistant VI that's playing the array of sound files, but I don't know how to wire the two data sources together. Then I tried using a separate DAQ-assistant VI to generate the noise, but then I get an error message saying "the specified resource is reserved." I know this board can generate samples at up to 4 analog output channels simultaneously, so I don't understand the error message.

Any thoughts?
0 Kudos
Message 1 of 6
(3,582 Views)
Hi,
Look at example code in this link
 
It will surely help you achieve what you are trying to do
 
Regards,
Dev

Message Edited by devchander on 10-18-2006 10:13 PM

0 Kudos
Message 2 of 6
(3,576 Views)
But is there a way I could have the noise being generated continuously? When I add the both signals and generate it through only one DAQ-assistant VI, the noise is being played in steps, along with the other signal. But I need the noise to be played seamlessly.
0 Kudos
Message 3 of 6
(3,562 Views)
Hello,
 
You will only be able to use one DAQ Assistant at a time when accessing the AO channels.  If you try to use more than one then you have 2 pieces of code trying to access the same hardware and that is why the driver returns an error.  Therefore you need to have both AO channels inside of one DAQ Assistant.  This means that your signals will share the same timing.  The example above shows how to pass data into a DAQ Assistant with multiple channels.  The data is combined into a 2D array and then converted into dynamic data.  The particular DAQ Assistant in this example is only configured to write N samples.  If you wish to write continuously then select the Continuous generation mode.  Then the DAQ Assistant will need to be placed inside a loop.  The clock rate that you set your DAQ Assistant to will determine how quickly your signal is updated.  If it is only set to 1 Hz then your signal will appear to only update in "steps" as you describe.  However, if you increase the Rate then it should update more smoothly.  I hope this information helps.
 
Have a great day,
 
Brian P.
Applications Engineer
0 Kudos
Message 4 of 6
(3,519 Views)
The gaps are not being caused by a low sampling rate. In fact, I'm using 44.1 KHz. The gaps happen between every iteration of the loop - which is why I wanted to have a separate DAQ-assistant outside of the loop.
0 Kudos
Message 5 of 6
(3,509 Views)

Hello,

Putting a DAQ assistant outside of the loop will not solve the problem because it will not execute until the loop has completed execution.  Setting the DAQ Assistant task timing to continuous should resolve the pause with each iteration it will output continuously.

Daryl E
Applications Engineer
National Instruments

 

0 Kudos
Message 6 of 6
(3,476 Views)