Multifunction DAQ

Showing results for 
Search instead for 
Did you mean: 

How do I synchronize a 250x250 Scan AO and AI with hardware clocks?

I am building a Scanning tunneling Microscope STM which requires a 250 by 250 pixel scan with a delay of about 1ms between pixels. I want to start the scan with a software trigger. The scan entails outputting an x and y value using two AO channels , wait about 1ms then read a tunnel current analog input value at that position, store it in an array and repeat till done. The array will then be plotted using an intensity graph.

As an option, I would like to plot a single line of the scan as it is completed to allow operator monitoring as the scan is produced. I have programmed this in sw using nested while loops but the overhead is too great for 1ms pixel sample times.

I have found a close solution in forum under the AI delay following an AO that used a hardware trigger to start process : See""

I have a PCI MIO 16E-4 DAQ board and am using LABVIEW 6.

PS: Is there any discrete that is generated by an AO which can be used to trigger an AI or a counter?
0 Kudos
Message 1 of 4
It sounds like you may want to try to use the AO to set a trigger that would cause a retriggerable pulse on a counter. You could then set your sample clock for the AI operation to be the counter out that is triggering off of the AO operation.

In DAQmx (LabVIEW 7.0 and higher) you can simply point both processes to the same sample clock and delay one operation by a defined amount. This would easily work around the problem and would work for the board that you are using.
Training and Certification
Product Support Engineer
National Instruments
0 Kudos
Message 2 of 4
I have several follow up questions:
Q1)Re your suggestion to use the AO to trigger a counter : What signals sources from AO processes are available to route to the counter trigger? I have no external sources.

What about this alternative proposal for a single AI read at each point?
a) use counter0 to generate a single pulse (about 1ms wide) , low phase 1, hi phase 2. Start counter with SW.
b) set AI trigger to output of counter0. Trigger on hi to low edge.
c) set AO trigger identical to AI trigger. Trigger on low to hi edge.
Set AI scan rate and number of scans to match the AO scan parameters with timing based on internal scan clocks.

Q3)I foresee a possible need to make 20 to 100 AI samples at each (x,y) point for post processing averaging of noise effects. What modifications are needed to AI trigger scheme to make these reads to a buffer and read the buffer without adding significant software overhead?

Thanks again
0 Kudos
Message 3 of 4
  1. Depending on how large of an AO signal you are sending you could route that into a PFI pin and use that as a trigger. It would have to be at least a large as a digital signal to be considered such.

  2. That would probably work, but you would have to reconfigure your task between each operation. If you don't care too much about the timing between samples, then this may be the simplest answer to create.

  3. If part 2 works for you then you could simply acquire a finite number of data points and specify your number of points to be 20 or 100.

Training and Certification
Product Support Engineer
National Instruments
0 Kudos
Message 4 of 4