LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Strange counter reading on NI 6602 using triggered acquisition

I'm using the 6602 connected to a Pulse generator going at about 100Hz. This goes to PFI 35.

 

An APD (photon counter) is connected to PFI 39.

 

I want synchronous acquisition at PFI39, after the falling edge of the pulse on PFI 35. I also count PFI 35 to see the falling edge.

 

This needs to happen at a rate of 100kHz. Note that I've coded all of this and it's working and it is synchronous but there is one problem.

 

Every 100th acquisition or so I get a strange spike. This spike can happen at any point and even at low counts so it does not seem to be an overflow problem.

It can also happen at low acquisition rates so there has to be something wrong with my code.

 

I have attached the normal response and the strange response. The waveform graph shows the output of the acuisition at PFI39 (photon counter).

 

Any ideas what could be causing this?

 

I also attach the VI. Sorry it is a bit messy.

 

Note that the problem is not specific to looping, it can happen at the first iteration.

It seems to happen more often if the acuisition duration is low (say 10kHz sampling, 10 samples, rather than 10kHz sampling nad 10ksamples).

0 Kudos
Message 1 of 3
(2,123 Views)

I found out that it is actually cause by buffer overflow not counter overflow.

I guess I could just ignore the data every time there is a buffer overflow as it only happens about 1/1000 times?

0 Kudos
Message 2 of 3
(2,117 Views)

Hello

 

I guess you could do that!

 

I would like to see if I could come up with a better solution but I am struggling to understand your code. I see that you are acquiring on 2 channels synchronously, both triggered by you 100Hz source. However, I do not understand how you are detecting the falling edge and using this as a trigger?

 

This aside, from your code, it seems that you are effectively doing a finite acquisition because you stop the tasks immediately after you read the first set of samples. You will probably avoid the buffer overflow by changing the task type to 'finite samples'. The program will then effectively be performing repeated finite acquisitions.

 

I hope this helps.

Nick
0 Kudos
Message 3 of 3
(2,099 Views)