Since Encoders short their pins to ground in most cases, i'd use optocouplers between DOUT and the device you want to control. That way the voltage level present on the device wont matter, as long as the coupler can take it. Polarity does matter though. The isolation between Box and device might save the Box, but fry the coupler. I'd go for sockets and keep some spares. If i understand your code correctly, you plan to use 3 outs per encoder. Usually encoders do have 3 pins, common, a and b. You only need to simulate a and b.