Hi Ganga-
The /Dev1/PFI0 line is configured for a digital start trigger in this case. If you do not need triggering then you can simply comment this line out.
In order to switch to continuous operation, you only need to change the "DAQmxErrChk (DAQmxCfgSampClkTiming (taskHandleDig,"/Dev1/Ctr0InternalOutput",rate,DAQmx_Val_Rising,DAQmx_Val_FiniteSamps,sampsPerChanToAcquire));" to indicate continuous sampling by "DAQmx_Val_ContSamps" . More information is available in the NI-DAQmx C Reference Help (Start>>Programs>>National Instruments>>NI-DAQ). A similar change is necessary to configure the counter for continuous generation in the "DAQmxErrChk (DAQmxCfgImplicitTiming (taskHandleCtr,DAQmx_Val_FiniteSamps,sampsPerChanToAcquire));" function.You would then also need to update the example to call the DAQmxRead function multiple times in a loop to ensure that you do not overflow your input buffer.
If you are trying to measure pulse characteristics you would be better advised to use one of the counters on your device. "On time" measurements are more commonly referred to as pulse width measurements and are demonstrated by the example "C:\Program Files\National Instruments\NI-DAQ\Examples\DAQmx ANSI C\Counter\Measure Period or Pulse Width\Pulse Width". Period measurements can be performed as in "C:\Program Files\National Instruments\NI-DAQ\Examples\DAQmx ANSI C\Counter\Measure Period or Pulse Width\Dig Periods-Buff-Cont-High Freq 2 Ctr".
The first example shows a "single shot" measurement while the second shows a buffered measurement that requires a clock to repeatedly sample data at specified intervals. Both schemes will work well for either measurement type. As before, the clock can be generated by the second counter on your device. If you are making the measurement with counters, you will need to be careful to perform continuous pulse train generation because a finite pulse train requires the use of both counters and would preclude the period and/or pulse width measurement from being taken.
Hopefully this helps-