Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

Stopping BeginReadMultiSample acquisition in .NET?

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?

0 Kudos
Message 1 of 1
(2,852 Views)