Hello all,
I am currently working on photon couting program using a single photon counting module (Excelitas) and PCI-6602 connected to BNC-2121.
I have taken a look other posts but I still could not solve my problem (or, still I am not so sure whether or not the problem is the hardware specification).
In the program, I am generating a trigger pulse at 1 MHz using one trigger in one separate loop.
Other than that, I have producer-consumer template based loops to acquire the data and do simple subtraction to calculate the number of photons in 1 microsecond.
Depending on the values connected to 'Input.BufSize' of DAQmx Buffer and 'Samples per channel' of DAQmx timing, I could change the looping number that the program does its job properly.
With the values, the program acquires 1 MHz photon counting signls for 139 times.
After that, the program stops and looping number increases very fast.
When I forcifully stop the program while the looping number is increasing very fast, the program pops up 'Error -200141'.
The error says 'Data was overwritten before it could be read by the system. If Data Transfer Mechanism is Interrupts, try using DMA or USB Bulk. Otherwise, divide the input signal before taking the measurement.', even though the counter explictly works in DMA mode when using sample clock.
I wonder there is any way that can solve my problem or still the only solution will be buying a better counter/timer board.
Thank you all for reading this.
I will be very happy with any clue 
Regards,
Myeongsu