Could you use your encoder to control a solid-state relay? This would switch the 24V on the output side of the relay that you could then feed to your PLC input.
An example of an item you could consider (depending on the resultant output frequency of your encoder): Woertz 45315T/7
What are the specifications for your encoder card(voltage range)? Also, what are the specifications for you encoder? Some TTL encoders can take 24VDC input for power(still puts out TTL signals).