Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

DAQmx Triggered Multiple Analog write

This should be simple but I can't seem to get this to work.

I am using a DAQpad6015 USB and I am having trouble trying to output two AO values while using an external trigger. I can get it to work great without triggering (ie with the sampling clock and digital edge vis removed). I think I am confused about what the sampling clock vi actually does. I think the sample clock vi is setting the sampling for the digital edge vi but I am getting an memory underflow error (ERROR -200016) which leads me to think that it affects the AO settings as well... If someone could clarify this for me as well as tell me what I can do to fix my vi I would be very grateful.
0 Kudos
Message 1 of 6
(4,152 Views)

Hi hbar,

 

A reason why the VI works without configuring the sample clock and trigger is because without configuring the sample clock, the output is software timed, and not hardware timed. This means that the output is not deterministic, as when you have a clock. Please not the limitations of the USB-6015 analog output ( 6015 Family Specifications – P.5). The USB-6015 is limited to 300S/s software timed, and 50S/s hardware timed.

I may suggest looking at some of the shipping examples which come with LabVIEW. (Help >> Find Examples.. >> Hardware Input and Output >>NI-DAQmx >> Analog Generation >> Voltage). I would also suggest using the Context help (Help >> show Context help) as this gives detailed descriptions of all VI’s when you hover your mouse over them. If you need to post back, please expand more on the configuration you are looking for. (continuous? finite generation?)

Message Edited by David L. on 05-29-2007 11:33 PM

David L.
Systems Engineering
National Instruments
0 Kudos
Message 2 of 6
(4,116 Views)
David,

Thanks for the reply!

Sorry if I wasn't clear about what I am trying to do. I just want to update the output voltage value of the ao once for each external trigger signal received. Here is where I get confused... does the sampling clock determine the rates for the digital edge.vi or just the analog write (or both)? I guess I am confused by the fact that they all share the same task. In all the example vis, the ao is outputing a waveform so it is obvious the sampling clock applies to ao. However, in my case, I don't really even want the sampling clock.vi in there because I am just trying to output one value as quickly as I can. I really dont' care about the timing on the ao and the only reason I have the sampling clock vi is in there is that the digital edge.vi seem to require it (I get error -200262).

Just for some background, what I am trying to do experimentally is to syncronize my CCD camera with my galvo (which controls my laser position via a X Y voltage input that comes from the DAQ board ao1 and ao2). I do not want the galvo to move while the CCD is taking an image. The CCD puts out a TTL when it is done acquiring an image so I want the galvo  to trigger off of that signal before updating to the next X Y position.

So I looked more into the analog output rates you mentioned for the 6015 and I found this article
http://digital.ni.com/public.nsf/allkb/8B2BAB87BCAB2D9C8625712B00559824

If I lower my sampling rate to 10Hz, I am unable to trigger off of a digital TTL.

I would appreciate any additional help...

hbar

Message Edited by hbar on 05-30-2007 10:14 AM

Message Edited by hbar on 05-30-2007 10:16 AM

Message Edited by hbar on 05-30-2007 10:29 AM

0 Kudos
Message 3 of 6
(4,105 Views)

Hi hbar,

That sheds much more light on your questions and what you are trying to accomplish, Thanks!!

Lets start with the clock and trigger: Input and Output (both digital and analog) can be done software timed, but a trigger is done in hardware (hardware comparison). The 80Mhz clock is used to latch digital values on the trigger line. When it latches one value low, and the next value high, then it triggers a rising edge. This rising edge then causes the task sample clock to start, thus beginning the acquisition or generation.

What you are looking to do is a ‘retriggerable analog output’ task. This is not directly supported with an AO task, but can be done by combining a counter task with an analog task. The counter task DOES have the property to be retriggerable, and we can then have this output a finite pulse and use this pulse as the finite clock for our AO. The AO task only runs when it sees the clock, thus only when the trigger sets off the counter which creates the pulse. Please see the shipping example” Multi-Function-Ctr Retrigg Pulse Train Generation for AI Sample Clock.vi” (Help >> Find Examples… >> Hardware Input and Output >> Synchronization). Although this example is for AI, you can change it to work for AO.

David L.
Systems Engineering
National Instruments
Message 4 of 6
(4,074 Views)
Hbar,

Following up from the phone support, here is a VI which will do hardware timed analog output. It uses a PFI line as the clock (or trigger if you would like to think about it that way), so everytime a pulse comes along the analog output is updated. Because the clock is basically the trigger, no DAQmx trigger vi is needed.

Hope this helps the community.
David L.
Systems Engineering
National Instruments
Message 5 of 6
(4,027 Views)
David,

You and Drew have been very helpful. I was lucky to catch you guys when I called in 🙂 Your previous post seemed like a great solution, but thanks for coming up with another way for my particular situation since I was already using both ctr outputs.

The vi works like a charm. Thanks again.

hbar

Message Edited by hbar on 06-04-2007 01:42 AM

0 Kudos
Message 6 of 6
(4,022 Views)