Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

High speed acquisition programming

Hello,
 
I'm now working on an NMR spectrometer which uses Labview as the GUI. This GUI lets the user configure
  • the pulse sequence (pulse lengths/phases, looping for different pulse lengths/phases, repeating part of the sequence, ...)
  • number of acquisition points and sampling rate

Sometimes we need to have acquisitions (with different number of acquisition points) separated by a very short time (like several tens of micro-seconds). What I did now is to

  1. create a virtual channel
  2. set the timing
  3. set the trigger (hardware digital trigger w/ rising edge coming from another timing board)
  4. start the task
  5. read data from the DAQ board
  6. clear the task

for each of those "temporally-shortly-separated" acquisitions. The problem is it misses some (actually, many) of the hardware triggers and thus I lost some physical events like a free-induction-decay.

I guess my way of programming is very inefficient in the sense that it takes quite a bit of time to create the physical channels, read from them and then clear them for every single acquisition event I have. Is there a more efficient way to programme them? In particular, I would like to have it programmed in such a way that it could do the following:

  1. wait for a hardware digital trigger (rising edge)
  2. acquire N1 samples at a sampling rate S
  3. wait for another hardware digital trigger (rising edge), the waiting time is like several tens of micro-seconds
  4. acquire N2 samples at the same sampling rate S
  5. repeat step 3 and 4
  6. maybe some more repeats

Sorry for my very long question. But I hope it's clear enough to be understood. Thanks!

0 Kudos
Message 1 of 5
(3,462 Views)

Hello tklui,

There is actually an example in LabVIEW that demonstrates this exact application. (Help >> Find Examples >> Hardware Input and Output >> DAQmx >> Synchronization >> Multi-Function >> Multi-Function-Ctr Pulse Train Generation for AI Sample Clock.vi)

This example is going to use a finite counter task that is retriggerable as the sample clock for the analog input task.  When the counter receives a trigger, it will then create a finite pulse train.  This finite pulse train will be used by the analog input task to acquire data.  Once the counter task is finished generating its finite pulse train, it can then be triggered again after a small rearm time.  This rearm time is dependent upon your DAQ board. 

Respectfully,

Rob F
Test Engineer
Condition Measurements
National Instruments
0 Kudos
Message 2 of 5
(3,445 Views)

Robert,

I've gone through the sample you mentioned. But I still don't understand how it would work out for me. Where should I hook the digital trigger to? Ctr0 source, Ctr0 gate or Ctr out? I'm sorry I don't quite understand the counters.

Thanks a lot!

0 Kudos
Message 3 of 5
(3,430 Views)

Hello tklui,

We are using a counter to create a finite pulse train that can be retriggered.  Then we are internally routing the counter output to be used as the sample clock of the analog input task.  We are controlling when we acquire data on the analog input task by turning on and off the clock used for acquisition. 

The clock source of the analog input task should be the counter internal output source.  Then the samples per channel is going to identify how many finite pulses are created ever time your trigger is received.  The Rate is going to identify how fast your clock is going to be generated.  The source of the digital trigger is going to be a PFI line.  When the PFI line receives either a rising digital edge it will trigger the counter to generate a clock signal.  (You can go to the block diagram and change the trigger source to analog edge if that suits your application better.)

Respectfully,

Rob F
Test Engineer
Condition Measurements
National Instruments
0 Kudos
Message 4 of 5
(3,400 Views)

Hello Robert,

I finally figured out how the retriggerable pulse train generation as the sample clock works. Thank you very much for your help. The example I should have looked at is

Hardward Input and Output >> DAQmx >> Synchronization >> Multi-function >> Multi-function-Ctr Retrigg Pulse Train Generation for AI Sample Clock.vi

instead of

Hardward Input and Output >> DAQmx >> Synchronization >> Multi-function >> Multi-function-Ctr Pulse Train Generation for AI Sample Clock.vi

Now I have another question. It looks like the retiggerable pulse train generation is for repeated generation of pulse trains with the SAME number of pulses. What should I do if I would like to generate pulse trains with different number of pulses?

Thank you very much

0 Kudos
Message 5 of 5
(3,341 Views)