Diminished data rate with logic output optoisolator
Take another look at the datasheet, specifically at the 'recommended' RL pull-up resistor value.
That's 270 Ohms, while you're using 15k.  

That device sources very little (if any) current when the output goes high, so the rise time you're seeing is directly proportional to that RL pullup resistor you're using (combined with the gate capacitance of your Q40 and any parasitics).