Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Hardware timing AO, DO, and AI

Hello,

 

I am currently using a PCI-6110 to set a digital output (DO) value to high, output an analog pulse, switch the DO value to low and wait a specified time, then read an analog input, and switch the DO value back to high. However, in order to improve the sensitivity of my system, I need to be able to precisely time the delay (to microsecond or better precision) between the end of the AO pulse and the start of the AI read so that I can repeat the measurement multiple times and average the measurements. Right now, I am unable to improve my signal-to-noise ration because I am software timing that delay and my measured signals each repetition are out of phase. 

 

So my question is, how can I effectively hardware time this process in such a way that it will be repeatable (e.g. inside a For loop). I know that the PCI-6110 has a 40 MHz onboard clock, so it should be possible to use it as a timebase to coordinate these multiple DO/AO/AI functions, but I am having difficulty understanding the best way to code hardware timing using the DAQmx timing VI. Perhaps I also need the DAQmx trigger?

 

I will attach the current VI that I am using to accomplish single repetitions of this function. Any help or suggestions for implementing hardware timing are greatly appreciated!

 

Thank you,

 

Michael

 

0 Kudos
Message 1 of 6
(4,061 Views)

Take a look at the example “Voltage – Hardware-Timed Single Point Input.vi” (you can find it by navigating to Help in LabVIEW, click Find Examples, Hardware Input and Output, DAQmx, Analog Input). Specifically check out how the DAQmx Timing and DAQmx Wait For Next Sample Clock (inside the while loop) VIs are being used. The documentation in the code is pretty informative, but post any other questions you may have!

Ross S.
Applications Engineering
National Instruments
0 Kudos
Message 2 of 6
(4,027 Views)

Hi Ross,

 

Thank you for your suggestion. I took a look at the example you mentioned, but it turns out that my PCI-6110 does not support single-point hardware timing (noted in the error that LV returned). Is there another way that I could coordinate AI, AO, and DO using hardware timing? For example, could I use an external TTL signal as a reference for hardware timing the AI, AO, and DO? 

 

My application requires that I output an analog signal pulse of a length in the range of fractions of ms at 25 kHz, then wait a precise amount time (with precision on the order of microseconds) before reading an AI signal. I tried to implement this with the examples from the timing and synchronisation page on the NI website(figure 2 at http://www.ni.com/product-documentation/4322/en/#toc5), but could not get my card to execute the timed AI/AO as the example block diagram showed. The error that was given said that I had to choose "On Demand" as my timing type, which implements software timing as far as I understand it. 

 

I greatly appreciate any help or suggestions you might have!

 

Michael

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

If you have an external clock reference, you could certainly use that. Your DAQ card has 2 counters on it, so you could also reference those as clocks. The AO operation will default to using the analog output clock (internal clock), but the AI operation will need you to specify the source (specify the same analog output sample clock). Figure 2 from the link you posted outlines this.

Ross S.
Applications Engineering
National Instruments
0 Kudos
Message 4 of 6
(3,991 Views)

Hi Ross,

 

I went back to the AI/AO synchronization page and tried to put together a vi that would just AO a pulse, delay, and read in a specified number of samples (see attached, ignore the disabled DO line). I can get it to output no problem, but it does not read in, let alone read after a delay. I removed the while loop and "Is Task Done?" vi because there cannot be any software control for my application and I do not want continuous read/write function. Am I missing something basic from my code?

 

Thank you,

 

Michael

0 Kudos
Message 5 of 6
(3,973 Views)

As long as your clock source is from the hardware, the timing is hardware controlled. The while loop and Is Task Done function facilitate the data/task that is being processed. You can still specify how much data you want to acquire. I’ve used that exact example VI with synchronous AO/AI and haven’t run into problems. I’ve thrown in a link that references some of the DAQmx functions in greater detail, and might clarify some of the things I’m talking about better than I can.

 

http://www.ni.com/product-documentation/2835/en/

Ross S.
Applications Engineering
National Instruments
0 Kudos
Message 6 of 6
(3,950 Views)