LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

DAQassistant triggered voltage acquisition

Hi all,

I am trying to sample a TTL voltage using DAQassistant, on a PCI6221 board in labview 2013. I want to start to record the voltage at a time specified by the first rising edge of a "control "TTL signal, which is a square wave, so it has multiple rising edges. I have thus set in DAQassistant the input channel I want to sample, the number of samples I need to acquire and the rate at which I want it to happen, then I have set the rising edge of the "control" signal as my start trigger for the voltage sampling.

As it does not look like the sampling is working as it should, I was wondering if the voltage sampling is "restarted" by each rising edge of my "control" TTL signal, of if it does ignore further rising edges after the first one until n samples at whichever rate I have specified have been acquired.

 

thanks a lor for your help

 

Giovanni 

0 Kudos
Message 1 of 4
(1,051 Views)

Under DAQmx, a "trigger" is a one-time event during the run time of the task.  Your task will be triggered to start acquisition by the first rising edge that arrives after the task is started.  All subsequent edges are ignored by the triggering circuitry until the task has acquired N samples and is stopped.

 

So no, voltage sampling is not being restarted by subsequent rising edges.  Some devices *do* support the notion of re-triggering, but:

- only after acquiring all the samples specified in a finite acquisition task

- your M-series MIO device does *not* support retriggered analog tasks anyway

 

FWIW, I'd highly recommend you work at moving away from the DAQ Assistant and learn to use the regular DAQmx functions.  This article (seemingly also available in video form) and the shipping examples for Hardware I/O are a good place to get started.

 

 

-Kevin P

ALERT! LabVIEW's subscription-only policy came to an end (finally!). Unfortunately, pricing favors the captured and committed over new adopters -- so tread carefully.
Message 2 of 4
(1,035 Views)

thanks I will have a look at the regulax DAQ functions, one more thing I am unsure about is the sample clock.

if I understand it correctly if it is set as internal as soon as the voltage acquisition is started by the first rising edge on the start trigger channel it will proceed at whatever rate I specified in software, until n samples are acquired. But is it possible to use the aforementioned ctrl 1khz sq wave input channel as both a start trigger (first rising edge) and as an external sample clock(voltage sampled every time the sq wave goes high)?

looks like labview is letting me do this, but at the same time i do not understand what the acquisiton rate means in this case, as it should be dictated by the time between two consecutive rising edges of the sample clock...

 

thanks a lot

0 Kudos
Message 3 of 4
(991 Views)

Yes, you *can* specify that the external square wave be used as *both* a start trigger *and* a sample clock.  In that case, you're right to be suspicious of the so-called "acquisition rate".

 

Reality: your actual sample rate will be determined by the external square wave itself.  If its frequency can be variable, so will your actual sample rate.

    But DAQmx has no way to guess or predict that rate when it isn't in charge of generating the sample clock from its known timebase sources.  So it just happily believes whatever value you tell it when setting up DAQmx Timing.

    The "gotcha" is that the task's sample rate is used to auto-size the buffer for Continuous Sampling tasks.  So it *can* be important for you to give a decent estimate of the external frequency.  When in doubt, estimate the highest expected frequency to avoid a too-small auto-sized buffer.

 

As a general rule, when using the same signal as both trigger and sample clock I would tend to use rising edge for one and falling for the other.  Using the same edge for both makes for a circuitry race condition -- will the edge that causes triggering *also* capture a sample?  I tend to suspect not, but can't be certain.  By using different polarities I can avoid the ambiguity.

 

 

-Kevin P

ALERT! LabVIEW's subscription-only policy came to an end (finally!). Unfortunately, pricing favors the captured and committed over new adopters -- so tread carefully.
0 Kudos
Message 4 of 4
(975 Views)