Hello Chen56,
There are a couple of options for your application. What kind of board do you have? This will determine whether you will use digital, analog or counter lines to achieve your goal.
1)If your board has 3 or more counters (i.e. PCI-6602), you could synchronize 3 counter input tasks with an arm-start. In software you can determine how many pulses occurred during your period of interest. (i.e. find the point in which counter A increments and the point where C increments and take your B signal at both points and subtract to determine number of pulses).
2)If your board has 2 counters (i.e. M-Series Card), you could use channel A to clock "Non-Cumulative Buffered Edge Counting" of channel B on one counter and channel C on another (see M-Series Help). Channel B&C would reset each time A has a rising edge, enabling you to count all of the C pulses in one revolution. Channel B should continue to count the 500 pulses, however you could determine the count before C begins by looking for a non-zero count on C.
Both of these options would use comparison functions to determine the 'stop counting' condition. You may also be interested in reading this discussion on a similar application as well as this analog trigger example.
Hope this helps,
Jennifer O.
Applications Engineer
National Instruments