Measurement Studio for VC++

cancel
Showing results for 
Search instead for 
Did you mean: 

Having Problem Stoppping Data Acquisition.

Hello,
I use three tasks in my application to acquire Analog Data, and RPM data. I read times from source clock according to a gated encoder. In other words, if the encoder is spinning I should be able to receive data, if it is not, I shouldn't receive any data. Well, if I shut the encoder off in the middle of the Data Acq process, I seem to continue receive data for good 2 minutes after. Why is this happening as I expect it to stop (almost)immediately? Is this data still being read from the NI? Or, Is it the left overs in my Buffer? How do I stop this behavior? I thought Stop and Clear Tasks can take care of this problem.
Thanks
0 Kudos
Message 1 of 2
(6,067 Views)
Hi softwareguy,

Thank you for contacting National Instruments.  I'm a little bit fuzzy on what exactly your application is.  Are you trying to pause the analog or digital input data aquisition when a digital trigger is high (the encoder it spinning)?  What signal is the encoder outputting?  My experience with encoders is that they output a digital waveform which changes depending on angular velocity.  If this is your case, how are you gating so that you recieve data constantly while it is running?  Are you using the encoder signal as the sample clock?

What you may be describing is a pause trigger.  This is when an input is suspended while a digital signal is in the pause state (e.g. high or low).   If this is the case, the "DAQmxSetDigLvlPauseTrigWhen" function may configure the behaivior you are looking for.  To get to this function in the NI-DAQmx C Reference Help, I searched for "pause" and it was the first result.

The fact that the data appears to be still acquiring for so long is odd.  If it was emptying the FIFO buffer, I would expect this time to be much shorter.  If you post which DAQ device you are using and your Sampling Rate/Samples to Read information, that would help with further troubleshooting.

Neal M.
NIC AE
www.ni.com/support
Neal M.
Applications Engineering       National Instruments        www.ni.com/support
0 Kudos
Message 2 of 2
(6,057 Views)