If the MX2 takes a variable frequency pulse train... then it looks like a stepper motor to Mach4. Presuming the ESS supports out-of-band motors (I don't know), then configure the spindle for step pulse control and assign it to OB1 (or OB2, etc.). Set the max sep rate to 32 KHz (I presume... you would need to read the MX2 manual to figure out how to map step rate to spindle speed). Then you will need a way to convert the ESS outputs to 0-24V. You don't mention if you are using a breakout board along with the ESS. The PMDX-105 (
http://pmdx.com/PMDX-105) can do this for you. See Figure 5 on page 7, and wire J5 pin 1 to your +24V supply. The MX2 would connect where the diagram shows the PLC, though you would only connect 1 signal.
[EDIT] Oops - I just double-checked the specs on our PMDX-105. The opto-couplers won't pass a high enough frequency to work here. The max is around 500 Hz, nowhere near 32 KHz. See the option below.[END EDIT]
Though I'm wondering why you don't use the 0-10V analog input. Then you can use any number of spindle control boards including our PMDX-407-S (
http://pmdx.com/PMDX-407, which can operate stand-alone with any motion controller/breakout board). Confirure Mach4 and the ESS to generate a PWM signal. Then the MC2, terminal "H" provides the 10V reference into the 407's "Aref" input, and terminal "O" takes the "Aout" from the 407, and the "L" terminal goes to the "Agnd" on the 407. If you go this way, make sure to order the "-S" version.
Bob