Jump to content

Two analog out put generation using DAQ USB 6221


Viswanath

Recommended Posts

Hi all,

I am trying to generate two analog output waveforms at the same time using two analog out put channels of NI USB 6221 DAQ board. Here is the vi attached which i used. when i run the vi i can see only one out put and after sometime it says error and i found think the problem with this vi is triggering, but i am stuck with this since last month, please help me out with correct vi. My aim is to generate two waveforms and at different amplitudes and with different phases and at different frequencies independently using two AO of DAQ.

Regards

viswanath

Link to comment

QUOTE (Viswanath @ Jul 23 2008, 08:12 AM)

My aim is to generate two waveforms and at different amplitudes and with different phases and at different frequencies independently using two AO of DAQ.

Regards

viswanath

You probably can't do that with hardware timing. These cheap DAQ cards have only a single DMA channel (I'm not exactly sure how the USB card works..) and FIFO but the long and short of it is: you can do only 1 hardware timed operation at a time.

Instead generate BOTH AO's with the higher frequency, and then downsample the output of the lower frequency one in software.

There are VI's in the pallets to downsample either the entire waveform or pt-by-pt in a loop.

Another approach is if the frequencies are low enough, output both waveforms with software timing in two separate loops. You'll have to experiment to see if this works for you.

Neville.

Link to comment

You cannot start two analog output tasks on the same board. You need to start one task that includes both channels. You then need to write to the task with one signal for each channel. The attached image in a non-funtional example of this. Also, make sure you understand the 'reset input' for the generation VI.

Good luck

Link to comment

I learned something new here too. :thumbup:

I was trying to figure out how to programatically setup a Task that had more than one channel. I'd always done in MAX previously.

I did find something called "DAQmx flatten channel to string VI" that would convert an array of channels into "list" that you could pipe into the the Create Task VI. But I like what you've shown much better.

Link to comment

QUOTE (pallen @ Jul 23 2008, 06:30 PM)

I learned something new here too. :thumbup:

I was trying to figure out how to programatically setup a Task that had more than one channel. I'd always done in MAX previously.

I did find something called "DAQmx flatten channel to string VI" that would convert an array of channels into "list" that you could pipe into the the Create Task VI. But I like what you've shown much better.

Hi djolivet,

Thanks for your valuable clue. I did generate two signals with low frequencies and i have attched the VI with this post. I can not generate two channel outputs with different frequencies, for example in channel-1, frequency was 10000Hz and in channel-2, frequency was 10Hz and i started VI execution but it shows error indicating that frequency must be less than or equal to half of sampling rate. Please help me, my extream oprational requeriments are 10Hz to 100kHz of frequency.

Thanks very much to all

Viswanath

Link to comment

QUOTE (Viswanath @ Jul 31 2008, 06:12 AM)

Hi djolivet,

Thanks for your valuable clue. I did generate two signals with low frequencies and i have attched the VI with this post. I can not generate two channel outputs with different frequencies, for example in channel-1, frequency was 10000Hz and in channel-2, frequency was 10Hz and i started VI execution but it shows error indicating that frequency must be less than or equal to half of sampling rate. Please help me, my extream oprational requeriments are 10Hz to 100kHz of frequency.

Thanks very much to all

Viswanath

Hi Viswanath

your problem is with the 'Basic Function Generator.vi". You've got it set to a generation rate of 1000 sample/second and trying to have it generate a 10KHz signal. Clearly this wont work. Make sure you understand the function and you should be able to figure out your problem.

Denis

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.