Jump to content

Simultaneous analog and digital output with DAQmx


vugie

Recommended Posts

Dear LAVAs, I'm stucked.

I have M series device (USB 6251) and want to use it to control device "E". E needs to provide analog trapezoidal waveform, clock and number of digital signals. Just like on a chart on front panel below. At this point it is ok to generate same data continuously.

I generate a clock with onboard frequency generator and use is as an external clock source for output tasks. Number of samples to be generated is 150 for each line, rate is 1 MHz. I am able to generate analog and digital signals separately, but when I try to join it analog task generate such an error:

QUOTE

DAC conversion attempted before data to be converted was available.

Decrease the output frequency to increase the period between DAC conversions, or reduce the size of your output buffer in order to write data more often. If you are using an external clock, check your signal for the presence of noise or glitches.

or:

QUOTE

Onboard device memory underflow. Because of system and/or bus-bandwidth limitations, the driver could not write data to the device fast enough to keep up with the device output rate.

Reduce your sample rate, alter the data transfer method (from interrupts to DMA), use a product with more onboard memory, or reduce the number of programs your computer is executing concurrently.

So, what I am doing wrong? Already tried to reduce a rate (but is this huge set of samples?).

Help please and then I'll have more time for VIpreVIEW polishing :)

http://forums.lavag.org/post-a11780-test.swf

Link to comment

Guys, you almost forced me to ask the question on the dark side...

[EDIT]didn't see your answer when writing this, Ton :) [/EDIT]

But fortunately I found the solution: AO.UseOnlyOnBrdMem property has to be set to True.

[EDIT2]

QUOTE

1. Make some data dependency between the tasks, starting the output tasks after you have started the clock task.

It does not change the behaviour.

QUOTE

2. Let the analog output task generate the clock, and let the analog clock be used for the the digital output.

Set the start trigger of the digital task to be the analog start. Then first start the digital task and then start the analog task.

I started with this approach and results were similar. I think that there is to less samples to be tranfered effectively, but I don't understand why DAQmx wants to do it each cycle.

[/EDIT2]

Link to comment

I have two ideas:

  1. Make some data dependency between the tasks, starting the output tasks after you have started the clock task.
  2. Let the analog output task generate the clock, and let the analog clock be used for the the digital output.
    Set the start trigger of the digital task to be the analog start. Then first start the digital task and then start the analog task.

Ton

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.