Relay setup to control spindle

Hello,
Still kinda new to the X-Carve world but would like to setup a relay to control (on/off) my spindle. Pretty sure someone out there has done it and would rather avoid “reinventing the wheel”. Didn’t see anything in the Inventables shop and only limited references in the forums.

Thanks in advance
Larry

Here is what you want:

I use the data loggers V2 relay strip. It switches an outlet. The 0-10V spindle connector goes to the pins of the strip. You leave the dewalt on by switch. I have a second one on the M7 port of the x-controller to switch my shopvac to do dust collection. That way everything starts and stops with g-code

After you wire the second IOT relay and wire it to the m7 port. What do you have to do for programming to make it turn on the second relay? Like having the spindle and shop vac turn on before a carve but found out you need to run 2 of the relays.