Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

500 Hz tone through speakers using analogue output

Hi,

What I would like to do is quite basic.  I would like to generate a 500 Hz tone from speakers I have hooked up to a NI USB-6259 DAQ.  I have attached a file that I thought would work but does not.  A noise is generated but it is not 500 Hz.  I was wondering if someone could tell me what is wrong with what I have.

0 Kudos
Message 1 of 2
(2,666 Views)

Hi REK,

 

You are currently outputting this 1D array without specifying any timing before you start the task.  Therefore, it is probably taking whatever default timing parameters are currently stored on the DAQ device.  You should look into a couple of tutorials orexamples either online or in the Example Finder.  Here's one in the shipping examples:

 

Help>>Find Examples... and then Hardware Input and Output>>DAQmx>>Analog Generation>>Voltage and look at the Cont Gen Voltage Wfm-Int Clk example. 

 

As you'll see in these examples, it's easier to pre-load your samples into the DAQ card's FIFO buffer using the DAQmx Write VI, and set up the task with certain timing parameters using the DAQmx Timing VI (this is the VI with a blue stop watch).  Once you've done this, you can simply start your task and let it run indefinitely, until you hit the "stop" button.

 

Be aware the shipping example I referred you to above uses a "waveform" data type to define it's timing.  You can also use a 1D array, but then you'll need to modify the DAQmx Timing VI by left-clicking the label and changing it to "Sample Clock".  This will give you a "rate" input to the VI that allows you to set the analog output sample clock--in other words, the rate at which you want your 1D array data to be generated on the output terminal.

 

Hope this helps,

Andrew

National Instruments
0 Kudos
Message 2 of 2
(2,641 Views)