I would look at how much current the encoder can source/sink at each differential pair. If you are planning to drive the photo-emitter in the opto-coupler directly from say the A A~ pins, then the A pin would be sourcing while the A~ pin would be sinking. You would like a minimum of ~ 10mA.
An open-collector photo-transistor on that side of the opto-coupler could be hooked emitter grounded, pullup returned to +24V with the collector also connected to the PLC input.
There are TTL input, high-voltage open-collector output level-shifters (a.k.a. Hex inverters/buffers) out there, too.