How far have you got with this EBB system so far?.
It's easy to convert a digital 5v signal to 24v for a swich using an opto module:
https://www.aliexpress.com/item/3301...%2315613%23459
https://www.cnczone.com/forums/attac...d=466388&stc=1
BUT..............
These have standard optoisolators fitted. These are only reliable around a 20khz pulse width. Fine for steppers but not convinced on servo's. If the EBB can work with that then, fine.
Depending on the pulse width needed for the encoder count, it would need high speed optoisolators for this application.
At this point in time I would either....
1: Live with being resigned to running it using analog signals.
2: Dump either the Pokeys boards or the EBB drive and go with something else.
Could you possibly build a couple of high speed optoisolation units yourself?.