is is possible do create a digital input (for a PC IO Card)
with a variable input voltage from 5VDC to 230VAC -optocoupled
without jumper, the speed is not important
(like multimeter automatic range switch )
For 5V its simple just via resistor apply input voltage to optocoupler.
230V is little more complicated. There are you need to add resistor and capacitor in seria with diode in optocoupler and you have to add inverse diode parallel to input diode of optocoupler to protect input diode of inverse (230V*1.41)V. Capacitor you calculate like resistor:
Rc=1/(2*3.14*f*C)
to get much current to switch on optocouplers secundar when 230V is ON.