public bool Stop() { if (!Recording) { return(false); } _stopThread = true; if (_pollThread != null && Thread.CurrentThread != _pollThread) { _pollThread.Join(); } Console.WriteLine("Stop call von Thread " + Thread.CurrentThread.ManagedThreadId); var resultStopTask = NidaQmxHelper.DAQmxStopTask(_device.InputTaskHandle); if (resultStopTask < 0) { _device.ReportError(new DeviceErrorArgs(NidaQmxHelper.GetError(resultStopTask))); } Marshal.FreeHGlobal(Data); Data = IntPtr.Zero; Recording = false; return(true); }
public void Stop() { if (TaskHandle == 0) { throw new InvalidOperationException("Task not yet created. First create a task"); } var result = NidaQmxHelper.DAQmxStopTask(TaskHandle); if (result < 0) { CleanupAndThrow(result, false); } State = SessionTaskState.Stopped; }
public void Stop() { if (TaskHandle == 0) { throw new InvalidOperationException("Task not yet created. First create a task"); } var result = NidaQmxHelper.DAQmxStopTask(TaskHandle); if (result < 0) { CleanupAndThrow(result); } try { _counter.Stop(); } catch (NationalInstruments.DAQmx.DaqException e) { CleanupAndThrow(e.Error); } State = SessionTaskState.Stopped; }