/// <summary> /// Ends an asynchronous read operation. /// </summary><param name="result"> /// An IAsyncResult that represents an asynchronous call started by /// BeginReadFinite. /// </param> protected override void EndReadFinite(IAsyncResult result) { try { AnalogWaveform <double>[] data = Reader.EndReadWaveform(result); Analog_InputComponentReadCompletedEventArgs args = new Analog_InputComponentReadCompletedEventArgs(data); RaiseGenericEventAsync(result, OnReadCompleted, args); } #region Debugger Exception Warnings catch (DaqException ex) { // If you Dispose the component while an asynchronous DAQ operation // is still running, the component may already be disposed or may be in the // process of disposing when this method is called. Depending on timing, this situation // will result in one of the three errors below. This is expected behavior. // // DaqExceptions are processed by the caller of this method in the // NationalInstruments.DAQmx.ComponentModel class library. However, by default, // the Visual Studio debugger intercepts these exceptions and breaks // the debugger when they occur. // // Because these exceptions do not represent errors, they are caught and safely discarded // here. if (ex.Error != -200088 && ex.Error != -88709 && ex.Error != -88710) { throw; } } #endregion }
/// <summary> /// Raises the ReadCompleted event. /// </summary><param name="e"> /// The event arguments of the ReadCompleted event. /// </param> protected virtual void OnReadCompleted(Analog_InputComponentReadCompletedEventArgs e) { RaiseGenericEventDirect(EventReadCompleted, e); }