public void Write(double[] data, int offset, int samples) { int written; Device.OutputBuffer.Write(ChannelNumber, data, offset, samples); if (Device.OutputBuffer.BufferReady) { unsafe { fixed(double *ptr = Device.OutputBuffer.CurrentBuffer.Data) { var result = NidaQmxHelper.DAQmxWriteAnalogF64( taskHandle: Device.OutputTaskHandle, numSampsPerChan: Device.OutputBuffer.CurrentBuffer.SamplesPerChannel, autoStart: 1, timeout: 10, dataLayout: NidaQmxHelper.DaQmxValGroupByChannel, writeArray: new IntPtr(ptr), sampsPerChanWritten: out written, reserved: IntPtr.Zero ); if (result < 0) { Device.ReportError(new DeviceErrorArgs(NidaQmxHelper.GetError(result))); } } } Device.OutputBuffer.MoveToNextBuffer(); } }