Hi Chris-
The only way to reset a counter to zero (or other initial count you specify for a task/channel) is to stop and restart the task. There isn't a property or method for setting or resetting the count value when a task is running.
Thanks-
Does that mean that the reset function would only work if there happened to be incoming pulses at the exact instant when the Z input was asserted? If that's the case, then are you saying there's really no way of resetting the counter ahead of time, in anticipation of pulses which will come at an arbitrary later time?
Sometimes, it's necessary to zero out the pulses ahead of time, knowing that when the pulses finally do come in, the count will start from zero. One application that comes to mind is a fluid displacement meter. This device generates a given number of pulses for a given amount of fluid flow. Often times, you want to zero this out before starting the fluid flow. It would be nice to be able to fire the "clear" output just prior to starting the fluid flow.
Thanks - that's a good suggestion. And I think it will work well in 2-pulse mode (separate up and down pulses). I can imagine that it may be a bit more problematic if we're hooked up to a quadrature encoder, because it might be hard to know the exact states of A and B when Z is asserted. And yes, you certainly can zero out the counter in software (which is what we do now!).
Thanks for your time and help!
can you explain it to me in detail? As in what would i need to do if i want to generate say a trigger after every 2000 counts from a counter?