LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Reading a high speed signal to fill an array

I have an extremely fast signal that I need to read and place into an array.  The voltage values reset at a rate of 65,536 Hz, and I need to read the voltage immediately before each reset and place that element into an array.  This would continue for the first 256 elements before stopping.  I was thinking of doing this by placing a DAQ Assist inside a For Loop, but that would require dealing with timing issues with each iteration of the loop.  Is this possible or is there a simpler way to perform this task?
 
Thanks,
Anthony
0 Kudos
Message 1 of 12
(4,203 Views)
Anthony,

You will not be able to read that fast with software timed acquisition. Most DAQ boards can do some hardware timed acquisition. Please specify the DAQ hardware you are using and someone will probably be able to suggest an approach.

Lynn
Message 2 of 12
(4,191 Views)
Our signals are coming from the laser/circuit system into a SCB-68 board which sends the signal into a PCI-6259 acquisition card.
0 Kudos
Message 3 of 12
(4,179 Views)
Hello Anthony,

You can do this operation by doing a finite buffered acquisition (also called an N samples acquisition).  In the DAQ Assistant, you can configure the rate at which you want to acquire as well as the number of samples you want to acquire.  You won't need to put it in a For Loop at all.  If you are using an external sample clock, you can configure that in the DAQ Assistant as well.

You can also take a look at the DAQmx Examples in the NI Example Finder (Help >> Find Examples...)
Eric
DE For Life!
Message 4 of 12
(4,157 Views)
I guess I should be more specific as to what's going on with my system.  I have a digital to analog converter in a circuit that I designed which outputs a continuously rising voltage.  The reset of this signal is controlled by a high frequency square wave outputted by LabVIEW.  This is the 65,536 Hz signal which controls the resetting of my converter.  While the square wave is high, the voltage is allowed to accumulate and continues to rise until the square wave becomes low, causing the voltage to reset to 0V.  I want the greatest possible duty cycle with this square wave in order to get the least amount of error as possible.  The final voltage just before the reset is what I need to store into the array.
Right now the duty cycle is set to 90% and is still recognizable by my converter, but it will most likely change later on.  I am just using the internal clock to control the readings.  I have looked at the DAQmx examples, but I'm still confused as to how the sampling will be affected by these specifications.  Can this be done simply using the N sample acquisition or a DAQ Assistant?  I have tried without any luck thus far.
 
Thanks again,
Anthony

Message Edited by AntLee29 on 12-22-2005 07:38 AM

0 Kudos
Message 5 of 12
(4,147 Views)
Anthony,
 
It will be impossibly to tell the computer to sample one point every 65000th of a second and throw that value into an array.  Your best bet is going to be to read your voltage values in using an analog input.  I would read in like 6 or 7 "sets" of data, where a set is the rising voltage and its being set back to zero.  I would read these values in and then write them to a file.  After you have acquired all of the data, I would read them back in from the file and use the Peak Detector.VI to read through the entire array.  This VI will return the following:  an array of the peaks, their location, and even their second derivative if you want it. 
 
This will be the most efficient method to do the analysis that you are looking for. 
 
I hope this is helpful.
 
-Jeff P.
National Instruments Applications Engineer
Message 6 of 12
(4,120 Views)

Hi Anthony,

      I'm not familier with the 6259, but most/many of NI's Analog-input boards can be configured to acquire (rapidly/repeatedly) on an external trigger.  If the 6259 has this capability, perhaps you could trigger each DAQ on a pulse-edge.  It may take a little ingenuity to construct a pulse that re-inits your D to A shortly after NI_DAQs A to D  Smiley Happy

Cheers!

When they give imbeciles handicap-parking, I won't have so far to walk!
Message 7 of 12
(4,105 Views)

Anthony,

You are right.  The 6259 can do high speed externally triggered data acquisition.  But, the problem here does not lie within the capabilities of the board, but within the parameters of the system.  It will be extremely difficult to trigger the board at the specific moment when your DtoA goes low.  You are running on Windows (I assume), which is very  non-deterministic.  It will be very improbably that you can repeatedly grab that LAST sample prior to zeroing out and bring JUST that one point back.  This issue of just grabbing that last sample is the road block we are going to run into.  That is why I suggested bring all of the values in and then disgarding the ones that you don't want.  If you can come up with a way to know exactly when that last point is, you are a smarter man than I, which isn't saying much.  Smiley Happy
-Jeff P.

Message 8 of 12
(4,100 Views)

Hi Jeff, Anthony,

      Please forgive me if I misunderstand the scenario, here.  It sounds like Anthony needs to acquire 256 samples, at ~65KHz, with each sample representing voltage at the AtoD of the 6259 - immediately prior to the reset of an external DtoA.  I'm suggesting that Anthony use the same pulse he now generates for his DtoA as an external scan-clock - falling-edge-triggered.  Let the hardware accumulate the 256 samples - no need to worry about the OS, once the NI-DAQ acquisition is configured/armed.  ~65KHz seems to be well within the capability of the 6259.  NI-DAQ triggers are (typically) very flexible with respect to edge direction.

The question (as I see it) is whether the edge-triggered AtoDs will complete before the DtoA reset occurs.  If necessary, perhaps some delay can be encorporated in the DtoA device, or some delay circuitry could be inserted between The Pulse and the DtoA, to make the DtoA wait a bit.

Again, sorry if this idea is way off-base! Smiley Tongue

P.S. LV7.1 shipped with an example called "Acquire N Scans - ExtScanClk.vi"


@Jeffrey P wrote:

the problem here does not lie within the capabilities of the board, but within the parameters of the system.  It will be extremely difficult to trigger the board at the specific moment when your DtoA goes low...




 

Message Edited by Dynamik on 12-28-2005 02:07 PM

Message Edited by Dynamik on 12-28-2005 02:11 PM

Message Edited by Dynamik on 12-28-2005 02:12 PM

When they give imbeciles handicap-parking, I won't have so far to walk!
Message 9 of 12
(4,088 Views)
Hello Everyone,

It looks like there are some great ideas but a little confusion over the terminology.  We probably do not want to trigger the acquisition on every edge of the ~65kHz square wave.  However, like Dynamik said, we can use the square wave to externally clock the acquisition.  This can be setup to be an N samples or continuous acquisition depending on how you want to set things up.  You can also setup the DAQ assistant so that the clock source of your acquisition is external (you need to specify at which terminal the external clock will be input).

I also like Dynamiks idea of using some delay circuitry to delay the clock to gonig to your DAC device.
Eric
DE For Life!
Message 10 of 12
(4,072 Views)