Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

How to set a voltage with the DAC to A0 and sample 0.01 ms later?

I want to apply a 40 kHz, 50% duty cycle, 100% amplitude modulation voltage waveform to my experimental system and then about 10 microseconds after the leading edge of of each "on" half cycle, I want to measure voltages at two different points.  Is it possible to do this with a PCI-6221 multifunction DAQ board and if so how?
 
How do I synchronize and delay the analog input sampling with the analog output?  The output impedances of the two voltage sources I want to measure are 1 kohm and 10 ohms. 
 
If necessary, I could reduce the frequency of the square wave.  Ideally, I would collect and average data from 1 second, 40 thousand samples, but I could live with averaging only the few thousand that would fit in an FIFO buffer.
0 Kudos
Message 1 of 3
(3,016 Views)

Hi OldLaserJock,

 


You can easily synchronize the analog input and output channels of your PCI 6221 for a continuous acquisition.  If I understand your application correctly however, it sounds like you would like to retrigger the analog input for every rising edge.  Analog Inputs on the PCI 6221 do not support retriggering; meaning they can only be triggered once for a finite acquisition. The workaround is to use a retriggerable counter task.

The idea is to create a counter task that outputs a finite digital pulse train every time it is triggered.  You can then internally route this pulse train to the sample clock for the analog input.  Every time your analog output produces a rising edge, the counter will be triggered and will generate a finite number of pulses, which will clock in a finite number of samples for the analog input.  There is a shipping example in LabVIEW which demonstrates how to clock the analog input with a counter pulse generation.  You can find it under  Hardware Input and Output » DAQmx » Synchronization » Multi Function » Multi-Function-Ctr Retrigg Pulse Train Generation for AI Sample Clock. 

 


As for the .01ms delay, you can effectively achieve the delay by discarding the first few data point. 

 


I have one last question about your application.  When you say you want to “measure voltages at two different points,” do you mean that you would like to use two analog input channels?  Keep me posted on your progress.

 


Keep me posted on your progress. 



Best Regards

Hani R.
Applications Engineer
National Instruments
0 Kudos
Message 2 of 3
(2,993 Views)
Hi Hani,
 
When looking for the example Hardware Input and Output » DAQmx » Synchronization » Multi Function » Multi-Function-Ctr Retrigg Pulse Train Generation for AI Sample Clock, I found the example on synchronizing the AO and AI channels, which when I added to the AI channel the node to control the delay between the AI Sample clock and the AI Sample Convert clock, does what I want for one AI channel and one AO channel.  The delay can be adjusted from 100 ns on up in 50 ns steps, which easily meets my needs.
 
I will start working on extending this example to collect on 2 AI channels, AI2 converting 0.01 ms after the AO0 channel changes and AI0 converting 0.01 ms after the AI2 channel converts.
 
Thanks,
OldLaserJock 
0 Kudos
Message 3 of 3
(2,976 Views)