I have a process that produces a digital pulse train from a rotary encoder. I need to be able to stop the process once a stepper motor has moved a given distance. The trick is, I need to manually set the length of the process, probably using a potentiometer. So what I'm looking for is something that takes the digital pulse train as an input and produces an analog voltage as an output, the voltage increasing with the number of pulses received. I can then compare this output voltage with the voltage at the potentiometer and stop the process when they match.
This stopping is secondary to the main purpose of the stepper motor, and is not a precise requirement; the exact number of pulses received is not important. I want to stop the stepper motor if it overruns its intended distance, so a potentiometer control is adequate.
I've been searching the web for articles that give a solution to this, but haven't found any. I've looked at digital-to-analog converters but can't find one that does what I need. Basically, it's a digital counter that produces an analog voltage output which increases with the input count.