I downloaded the manuals for the PoKeys57CNC and the CWD250 thinking it would just be a matter of finding the right pins to connect. However it turns out not to be that simple.
https://www.poscope.com/wp-content/uploads/downloads/Pokeys/Manuals/PoKeys57CNC%20user%20manual.pdfhttp://www.cw-motor.com/uploadfile/file/20150603/201506030428050.rarPage 4 of the CWD250 manual shows two options for using the opto isolated inputs.
Figure 1, common cathode, uses the controller outputs and ground for positive logic.
Figure 2, common anode, uses the controller outputs and +5V for inverted logic.
The table on page 5 shows the external resistor is not needed for 5V operation.
Either method will work as long as the settings in MACH program match.
The problem is the limited current output of the PoKeys57CNC.
Page 16 lists the enable, step and direction outputs as type DO5. Page 18 shows type DO5 outputs have a 100 ohm resistor in series and the maximum current is 8 mA.
The CWD250 inputs consist of a opto coupler input diode and a 270 ohm resistor is series. This would draw about 12 mA if connected to 5V.
When the 100 ohm resistor of the PoKeys output is taken into account the current would be about 9 mA, if the output actually can do a bit more than the 8 mA.
So, the question is, would connecting as per the CWD250 figures work reliably? My guess is yes but there is no guarantee.
Detailed information needed to verify that operation is not available.
A buffer could be added between the outputs and input to supply the full current. Two ways that come to mind would use hex inverter ICs or CMOS transistors.
I suspect building such a circuit would take you out of your comfort zone.