Hello;
The best way to go about that is to start with one of the NI-DAQ shipping examples that shows how to configure counters to operate as buffered event counting.
You can find that example at C:\Program Files\National Instruments\NI-DAQ\Examples\VisualC\Ctr, and the example name is STCsingleBuffEventCount.c.
Regarding your second question, the digital line update is taking that much due to the fact that board only does Software timed digital update, meaning that the digital line will be updated through Software calls. Since Windows manages all tasks on your machine, the time it takes for the digital line to update is totally system dependent.
To achieve faster rates on digital updates, you need to work with a DAQ device that allows hardware timed
updates, such as the 653x family.
Hope this helps.
Filipe A.
Applications Engineer
National Instruments