Code question

What is the code to turn off the IOT relay?

thank you Robert

Depends on where you have it connected.

For the spindle where an M3 turns it on, it is M5 or M3 S0
For M7 or M8 (FLOOD or MIST), it is M9.

Sorry.
I have the new Xcarve with the X controller.
It will be wired from the spindle connection on the back panel to the connection on the IOT relay.
I want to modify the G code to shut off the relay/spindle at the end of each program.

If you’re using Easel, then Easel will handle that when you carve and also when you export Gcode if you did the machine setup indicating automatic spindle control.

If you setup the machine using Easel but are using an outside Gcode source, then the following commands will work:
Turn on: M3 S1
Turn off: M5

If “M3 S1” does not work to turn it on, then you need to look at the $30 configuration parameter. That sets the max RPM for GRBL’s output PWM for the spindle. Anything at max RPM or over will cause the output to be 5V which is what is needed for the IOT relay. Easel setup for the Xcontroller sets $30 to be 1 so that is how the “M3 S1” command works. If $30 is 12500, then you would need “M3 S12500”

I do not have internet in my shop so I cannot use Easel.
Therefore I’m using Vcarve desktop and UGCS to run the machine.

in universal g-code sender issue the $$ from the command line (it is a box under the commands tab) and that will list the parameters that you have for your grbl version (it will also list which version of grbl you have at the very top) you want to check parameter $30=?? that is the RPM max setting. Just in case you needed to know where to find these settings.

This link will get you going on learning the GRBL commands associated with the X-Carve.