Here is the info I got from Carbide3D :
Disclaimer : This is for 2.4D board. Hooking up a 3rd party device will void the warranty.
There are no on board relays that would let you hook that up, you'd have to put something together.
There is also no convenient place to grab 24V from the board but I'm attaching a board image for 2 pins you can use. If you need to turn a relay on, you can use the 4 pins next to the limit switches labeled GND, PWM, 5V and D13 (inside the red rectangle in the image)
Also, M7 and M9 commands are not supported in carbide Motion, so if you end up going that route you'd need a different gcode sender, like UGS or bCNC
Friendly PSA, hooking up a third party device to the board will void the warranty
PWM is D11. It sends a square wave for spindle speed. If you use either D13 or D11 you won't be able to use them for spindle ON/OFF.
There is one more place you can grab a signal, A3 inside the red circle. That pin turns on automatically with M7 and M9. A3 is the coolant ON/OFF pin.
You don't need to recompile GRBL to use M7, M8, or M9, you'll just need to use a different gcode sender than Carbide Motion.
I think M7 is deactivated by default, see GRBL documentation. You need to enable it in the config file and re-compile grbl. I prefer to use M8 instead
You can definitely flash grbl1.1 onto your board.

- Carbide Motion Board Layout, ver. 2.4D
- CM_24_silk_led.png (296.8 KiB) Viewed 1833 times
With this info in hand, I first started to hook it up this way (
http://playground.arduino.cc/uploads/Main/relays.pdf). When I would press M8, it would turn ON, when I would press M9, it would turn OFF, and suddenly, repeats that same command over and over until my CPU (or memory) gets saturated and I can't move the mouse and have to shut off manually the computer. Maybe I didn't something wrong, maybe I should have put a flyback diode across the solenoid valve (i put one across the relay coil though).
So instead, I switched to another circuit, I built this one :

- Schematic for controlling a DC 24V Solenoid Air Valve on shapeoko
- irl.png (28.6 KiB) Viewed 1833 times
And it works perfectly for now

Special thanks to the Cardbide3D support, top notch!

- Picture of shapeoko with air cooling
- air.jpg (222.49 KiB) Viewed 1833 times