10-16-2006 02:25 PM
10-17-2006 04:15 PM
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
10-19-2006 01:00 PM - edited 10-19-2006 01:00 PM
Message Edited by chen56 on 10-19-2006 01:03 PM
10-20-2006 05:48 PM
Hi Chen56,
This is not a simple task with the PCI-6014 (E-Series Board).
With an M-Series board you have an option to do two-edge separation measurements. This enables you to measure time or pulses that occur between two digital edges. These edges can be on one or two different lines. This would enable you to make a simple modification to a 2-Edge Separation example to measure the number of pulses (Channel B) between edges on channels A&C. This would involve adding a property node to the example to specify the source and edge (rising or falling) for each. This is not an option with the PCI-6014.
If you must use an E-Series board, you may be able to read all 3 signals on your analog channels in one task (this would correlate the time of each signal) and create a software algorithm to determine the number of pulses. Alternatively you could use external hardware to combine signals A&C (or- gate?) and use them as the clock to determine when the count of B is latched in a buffered edge count task. This would still require some programming on your part to determine which counts are of interest (i.e you will get the count when A goes high, then each time C goes high and again when A goes high, the software will have to pick out only the difference between the first two latched counts and disregard the others.
The M Series option will be much easier (see here for E-Series and M-Series differences).
Regards,
Jennifer O.