Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Retriggering an Analog Input and Counting the Trigger Pulses - not the standard retrigger question

I'm using DAQmx 8.0, with a 6011 "E" series board, VC++.   The application: Trigger a series of single channel AI reads (to get an average) on an encoder pulse, and continuously count the encoder pulses.   The goal is to end up with an array of voltages and encoder counts, so I know what the average voltage was at each encoder pulse.   The encoder is maxed out at about 600Hz.  I can't miss any encoder pulses.
 
The "simple" approach does not seem to be fast enough.  "Simple" meaning:
1)  Set up edge triggered counter and Analog In with external digital trigger (both triggers are PFI3)
2)  START counter task, COMMIT analog task
3)  Loop:
        start analog task
        read analog value
        read counter value
        stop analog task
        print analog and counter value to console window
 4)  end
I have to slow down the encoder to about 300Hz to stop missing encoder pulses.
 
The retriggerable counter method will not work either since that uses two counters, and therefore I loose my ability to continuously count encoder pulses.
 
It just hit me that printing to the console window won't be happening in the real application, but the printing overhead might not be too different than the overhead due to averaging the analog samples and stuffing everything into the final array.
 
Am I missing something in my approach?   Is there a (better) way to do this with my hardware?
 
Thanks,
 
Jim 
 
I previously posted this question in the MS VC++ group.  Sorry for the confusion.
0 Kudos
Message 1 of 2
(3,064 Views)

Hi Jim,

 

Analog input acquisition on NI hardware is inherently non-retriggerable. There are ways around this, documented in this KB and the related links from it.

I would suggest you start there as it should answer most of your questions.

 

Regards
JamesC
NIUK and Ireland

It only takes a second to rate an answer 🙂

0 Kudos
Message 2 of 2
(2,708 Views)