Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

USB-6343, error code 201298, counter edge counting, try to use pause trig and reset together

 

Sure, I made very slight mods to the originally posted snippet.   The whole purpose of the 2nd (upper) counter task was to generate a clock whose periods would be measured.  You don't need that as you can use the Laser On/Off signal.

 

Note: in this setup, photons are counted all the time whether the laser is on or off.  At the end of every rising edge interval, the instantaneous count is buffered and then the count is reset back to 0.   If it's important to count *only* during the laser's on time, you could change this to a semi-period measurement.  That would buffer and reset counts on both edges.   You'd end up ignoring half that data and you'll have to be careful about polarity to be sure you know which half to keep, but it gives you a method to get hardware-accurate APD counts only while the laser is on.

 

 

-Kevin P

 

apd periods.png

CAUTION! New LabVIEW adopters -- it's too late for me, but you *can* save yourself. The new subscription policy for LabVIEW puts NI's hand in your wallet for the rest of your working life. Are you sure you're *that* dedicated to LabVIEW? (Summary of my reasons in this post, part of a voluminous thread of mostly complaints starting here).
0 Kudos
Message 11 of 15
(1,474 Views)

I'm back from my Easter day. Thank you very much Lin and Kevin for yours helps, I will keep you posted on the progress.

Have a nice time,

Best regards,

Palm

0 Kudos
Message 12 of 15
(1,452 Views)

Dear Kevin,

I can understand the suggested setup that the setup based on the Implicit Buffered Semi-period measurement, in which the signals to be counted is routed to the Source input of the counter and the Laser signals (ON/OFF) is routed to the Gate input. A question raises here: Does it matter if both signals are not periodic? 

I'm taking the point from your suggestion that the polarity is thing I should be carreful. In the following Fig., if I want to count only the # photon while the laser is ON, should I leave out all the "odd" values from the returned data array ( keeping 3, 2 while ignoring 1 in this case)?

Thanks again,

Regards,

Palm

0 Kudos
Message 13 of 15
(1,449 Views)

 

Assuming your Laser ON signal is active high then yes, you would want to keep all the even indices (photons counted during Laser high time) and ignore all the odd indices (photons counted during Laser low time).

 

You can explicitly configure the task to start counting on your chosen edge.  If not configured, the default is to start on a Rising edge so that index 0 of the measurement array would be photons counted during the gate's high time.  Below is a snippet that shows an additional property for configuring this polarity as well as a handy Decimate Array function that'll make it easy to split the full measurement array into even and odd indices.

 

 

-Kevin P

 

config period meas.png

CAUTION! New LabVIEW adopters -- it's too late for me, but you *can* save yourself. The new subscription policy for LabVIEW puts NI's hand in your wallet for the rest of your working life. Are you sure you're *that* dedicated to LabVIEW? (Summary of my reasons in this post, part of a voluminous thread of mostly complaints starting here).
Message 14 of 15
(1,413 Views)

It is great, Kevin, my program for photon counting runs perpectly.  Thank you very much.

Best regards,

Palm,

0 Kudos
Message 15 of 15
(1,394 Views)