Hi Maxime-
I'm not sure why your counter would be counting too fast, but it might have something to do with the comparator circuit. Are you able to count edges successfully with your counter? I would suggest using the LabVIEW shipping example "Count Digital Events.vi" that can be found by accessing Help>>Find Examples in LabVIEW and then browsing to Hardware Input and Output>>DAQmx>>Counter Measurements. You will need to connect your comparator output to the source input of the counter.
If this VI works for you then I have another suggestion along the lines of Kevin's earlier suggestion to use two counters. The counters on your board can be configured to output a pulse once the counter reaches your Terminal Count (i.e. the highest value the counter can reach before rolling over to zero). Your PCI-6110 has 24-bit counters, so the terminal count will be 2^24-1 or 16777215.
By using the first counter to count zero crossing events from your comparator and setting the initial count to be a certain number of counts less than the Terminal Count you can output a pulse after a user-specified number of rising edges. This output can then be routed to trigger pulse train generation on the second counter of specified frequency and length. Finally, you can route this generated pulse train to be the external clock for your analog input operation.
I have attached a modified edge counting example that shows how to route the terminal count to a pin that can be used to trigger the pulse train on the second counter. For an example of AI operation with a counter-generated pulse train, check out "Multi-Function-Ctr Retrigg Pulse Train Generation for AI Sample Clock.vi" in the Hardware Input and Output>>DAQmx>>Synchronization>>Multi-Function folder in the Example Finder.
Thanks-
Tom W
National Instruments