Analog inputs are available for this purpose - voltage range is 0 to 3.3V.
In Mach4, the analog inputs map directly to registers, that are accessible via LUA script to do anything. There is a blog article on how to use it for FRO.
In Mach3, analog inputs can be mapped directly to DROs in the settings with selectable gain.