Hi Kaushal,
If you look at these lines of code from the example:
DAQmxErrChk (DAQmxCfgDigEdgeStartTrig(taskHandle,"/Dev1/PFI0",DAQmx_Val_Rising));
DAQmxErrChk (DAQmxCfgDigEdgeRefTrig(taskHandle,"/Dev1/PFI1",DAQmx_Val_Falling,100));
The first line configures a start trigger on PFI0. When the first rising edge is detected on PFI0, you will start latching in data to a buffer.
The second line configures a reference trigger on PFI1. When the first rising edge is detected on PFI1, it will pull 100 pretrigger (relative to the edge on PFI1) samples and the remaining samples specified by DAQmxCfgSampClkTiming() and return them when you call DAQmxRead. So to start with, if you remove the Reference trigger, your start trigger will start the acquisition and return data when DAQmxRead has been called. Also, you could just send a trigger to PFI1 when you want to acquire. This should get you started.
Your end goal, "I have an external clock that runs at 10% duty cycle with the pulse width of 2ms. I need the DAQ to be acquiring data only during the pulse width" is going to be more complicated. You'll need to use counters to achieve this. This KB:
How Can I Perform a Retriggerable Acquisition? has a great overview and links to examples that should be closer to what you want.
Hope this helps,
Andrew S
National Instruments