Hi,
still don't know what you require. One of the plugins that ships with Mach4 is ModBus, a serial communication protocol widely used with industrial
machinery.
Its not for realtime use, that is to say you cannot use ModBus as a motion controller, but is highly suitable for data/switch/sensor input/output.
If, for instance you had an Ethernet SmoothStepper, or a Pokeys 57CNC motion controller and that motion controller interfaces to your machine per standard practice,
but you could use ModBus to issue instructions from your STM micro to Mach and thence to your machine.
Craig