Diode in parallel with resistor
The diode is there to discharge the capacitor quickly.  

If the output of U3A is high the diode is reversed polarized, so you can ignore it then. Then C7 gets charged via R22 with a time constant of 4 ms. That means it takes about 20 ms to charge completely.

If the output of U3A is low the diode conducts and discharges C7 very quickly, which you can see as the sharp falling edge on the scope.