Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

Continuous Buffered Period for Photon Counting

Hi everyone,

 

i'm trying to measure a continuous time trace of photon counts from a single-photon avalanche diode (SPAD) with a NI-6602 card. I'm using the DAQmxCreateCIPeriodChan function in the DAQmx_Val_HighFreq2Ctr mode (example  "DigPeriods-Buff-Cont-HighFreq2Ctr.c" from Nat. Instr.). I wired the SPAD to the PFI_39 input line, which is the default input line for DAQmxCreateCIPeriodChan. If i just try to read the ~100 counts/sec. "noise" (i.e. dark counts) from the SPAD  and read out the number of samples I get zero, although I'm using a measurement time of 1 second. Can anybody tell me what I'm doing wrong?

 

Regards, Christian W.

 

SOURCE CODE

 

int main(void)
{
    int         error=0;
    TaskHandle  taskHandle=0;
    int32       read;
    float64     data[100]={0};
    char        errBuff[2048]={'\0'};

    /*********************************************/
    // DAQmx Configure Code
    /*********************************************/
    DAQmxErrChk (DAQmxCreateTask("",&taskHandle));
    DAQmxErrChk (DAQmxCreateCIPeriodChan(taskHandle,"Dev1/ctr0","",0.000001,0.100000,DAQmx_Val_Seconds,DAQmx_Val_Rising,DAQmx_Val_HighFreq2Ctr,1,4,""));
    DAQmxErrChk (DAQmxCfgImplicitTiming(taskHandle,DAQmx_Val_ContSamps,100));

    /*********************************************/
    // DAQmx Start Code
    /*********************************************/
    DAQmxErrChk (DAQmxStartTask(taskHandle));

    printf("Continuously reading. Press Ctrl+C to interrupt\n");
    while( 1 ) {
        /*********************************************/
        // DAQmx Read Code
        /*********************************************/
        DAQmxErrChk (DAQmxReadCounterF64(taskHandle,-1,10.0,data,100,&read,0));

        printf("Acquired %d samples\n",read);
        fflush(stdout);
    }

0 Kudos
Message 1 of 1
(5,703 Views)