Quantcast
Channel: Counter/Timer topics
Viewing all articles
Browse latest Browse all 1271

Stopping BeginReadMultiSample acquisition in .NET?

$
0
0

I have setup a long term acquisition using BeginReadMultiSampleDouble, a delegate to receive N samples and then start the next read.  This works well enough:

 

 

counterReader->BeginReadMultiSampleDouble(numberOfSamples, continuousCallback, object);

...

ContinuousSaveCallback(System::IAsyncResult ^ar)
{

counterData = counterReader->EndReadMultiSampleDouble(ar);
counterReader->BeginReadMultiSampleDouble(numberOfSamples, continuousCallback, object); //starts N+1 read
//save data here

}

 


What is less clear to me is how I am supposed signal the end of an acquisition?  One option is to set a timeout for the BeginReadMultiSampleDouble, and then at the end of the time out, check to see if the user hit stop, and if not, just redo the read.  This seems a little ugly though.  Or am i supposed to just do an infinite read with no time out, and then somehow signal to  counterReader that the acquisition is over?


Viewing all articles
Browse latest Browse all 1271

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>