Hi Jejun,
From what I understand, you want to sample analog input data at a specified frequency once you get a trigger signal. I would simply use a standard analog input example without using an external Convert Clock. If you want to sample at a specific rate then you need only do that. Or if you do want to use the counter as the scan clock, you can just use the select_signal call with Counter 0 Output as the source and Scan Start as the signal. You can find these options in the NI-DAQ C Function Reference located at Start >> Programs >> National Instruments >> NI-DAQ >> Help.
The reaason you might be missing samples is that your code is dependent on the operating system reading data as its available. At 400Hz it is almost always going to be ready. However, since you are using a Windows (probably), the OS will give a time slice (since it is a multitasking OS) to your program at which point it does the AI Check (which is false). Then OS gives processor time to another program (at which point you will occasionally miss the data point when it is ready). The OS once again returns to your program and performs the AI Check but the data is gone and you are acquiring the next point. This might not be exact but this is probably (roughly) what's going on.
If you know you are going to acquire x amount of samples (100 or 10000 etc) or so at a specified frequency (400Hz), then use an AI Scan operation and you can use the internal timebase as the scan clockk or you can use a counter (as described above). What the scan does is it acquires a bunch of data points (or continuous) on one or more channels. DAQSingleBufTrig_E_Series on a trigger or just simply a DAQSingleBuf example. These are all shipping example that should be found in your folders for NI-DAQ.
Anyway, the point is to not use a single point acquisition when you are acquiring multiple points as there are a multitude of ways to lose data points along the way.
LabView uses similar versions to the standard NI-DAQ function calls you are using.
Anyway, hope that helps.
Ron
Applications Engineer
National Instruments