Nigel,
You could have used the multi-record feature of the HSDIO driver to
count edges. You could use the rising (or falling) edge of your
pulse as a multi record advance trigger and use an attribute to
determine how many records have been fetched. In this fashion,
you would be counting edges and ignoring the duration of the
pulse. However, there is a minimum amount of clock cycles for
this trigger to rearm (~140samples) so at 100MHz, the rising (or
falling) edges could not be closer to one another than ~1.4us.
Your method of just capturing the pulse train and post processing it is
certainly valid. There are certain caveats to this method in
regards to streaming the data. In order to capture more data than
your memory can hold (as in very long acquisitions), you must be able
to fetch data out of the memory faster than you're putting it in.
This can be done and benchmarked but is very system dependent as your
are now pushing data across the PCI bus which is inherintly
slower. You can get better performance by using the "Data Width"
attribute to be more efficient with your memory usage.
You could also use your gating signal as a Pause Trigger and capture
only the pulses that occur when your gate signal is deasserted.
In this fashion, when your gate is asserting the Pause Trigger, the
acquisition sessions stops putting data into memory. When the
gate deasserts Pause, the data then gets stored. This will allow
you to store only "qualified" data and give you better memory
utilization.
Alternatively, NI HSDIO 1.4 introduced some new Hardware Compare
features. There is a white paper available for this new set of
features
(http://zone.ni.com/devzone/conceptd.nsf/webmain/15de80989fd122188625704d007885ea).
The feature that could be of use to you is the error count. I
would suggest using a Response mode without the stimulus. This
allows you to use an acquisition Pause Trigger as described
above. You would then generate "expected" data of L (for rising
edge detection; H for a falling edge detector) on the channel to which
is connected your pulse train. When the data on your gate is 1
(NOT paused) and on your pulse train is 0, then there is no
error, When the pulse train transitions to 1, the hardware
will generate an error. If you turn on the "FilterRepeatedErrors"
then the hardware will only store the first error of a consecutive set
of errors allowing you to only register/count the first occurance (the edge)
rather than the errors that occur in the duration of the pulse.
When the gate drops to 0, the comparison will pause so you will no
longer count or record errors. There is no rearm time required
for this operation and will give you the best memory utilization and
response time of the methods I've brought up so far. This is a
little trickier in that it is a departure from the "classical" digital
applications but once you use the features a couple of times and read
through the white paper it becomes second nature.
Please let us know if you have any questions
-Ryan M
Message Edited by Ryan M on 06-15-2006 09:51 AM