That would be a perfect application for a $2 Arduino, a PWM or PDM (pulse density modulation) 1 pin digital IO followed by an RC integrator (instead of parallel IO followed by R2R), and a few lines of code. Strongly recommend this one, even I'm a big fan of TTL and vintage digital.
However, if you insist to use a counter + R2R, better switch the input point into the chain of flip-flops that makes the counter.
- Implement the first LSB bits of the counter with independent flip-flops, for example 74N74 (two independent D type FF).
- The R2R DAC stays the same, say 8 bits (255 pulses) for 10Volts.
- To switch to 7 bits (127 pulses) for 10V, redirect the stream of input pulses to the 2nd FF, to switch to 6 bits redirect the input pulses to the 3rd FF input, and so on. The bypassed LSB FF will stay to zero after each reset (you'll need to reset the counter before each train of pulses anyway). The redirection can be made with some additional glue logic, either with a multiplexer/demultiplexer, with gates, or with a mechanical switch if the application allows.
- If you want to be exactly 1111 1111 for 6 bits and not 1111 1100, then send a Set instead of a Reset to the first 2 FF
Another way to switch the DAC resolution could be to put a parallel in / parallel out shift register (i.e. a 74N95), and after all the pulses are counted, shift the output of the counter with 1 bit to the MSB direction so the following R2R will see the counted pulses multiplied with 2. When shift fill the LSB with 1, so the DAC will see N*2+1 for N pulses counted.
I would choose the microcontroller solution for being much cheaper, faster to implement, and more flexible.