Run cmd command before and after cut

Hello, i have a question.

I am using my TwoTrees TTS-5 laser with air assist, but my board does not have air assist controll support. So i need to turn my air assist pump by hand every time. Its bit annoying.

I want to make it automatic. So i would like to use some USB relay to turn air assist on/off. Saddly, LightBurn can only operate in M7/M8 commands.

My question is, is it possible to automaticly run some .bat file, or CMD command before and after whole laser operations? I would like to turn my usb relay on/off by this.

Or, is there some realtime gcode sniffer for same purpore? If this software sniff M7/M8 command, then run relay on?

btw. sorry for my bad english :))

I don’t know if something like that exists, but if you’re brave enough, you could do it electronically.
I installed a solid state relay in my CO2 machine that turns on the extractor every time it works, because I almost always forgot to do it.

I know you can enter Start and Finish Gcode commands. Other kind of commands I don’t think so.

Show a picture of your mainboard. Most grbl mainboards have the (usually undocumented) ability to control a relay as well.

Sure, here :slight_smile:

That one has an odd name, I never saw a MKS LTS board yet. Only DLC and DLC32 boards.
But anyhow, this board seems to feature the I²C interface as well. Those pins can be used to drive a relay, usually. In most cases, it’s already active. Try the M7, M8 and M9 commands and measure the pin status of the SCL and SDA pins. Maybe it already works. Otherwise you need to switch to FluidNC firmware, which definitely offers this function.

You can find some wiring scheme for the DLC32 board at the bottom of this page: Relay Control - Diode Laser Wiki

Wow, thank you. Ill try measure those pins tomorrow :slight_smile:

I am not sure if i want to mess up with new firmware. But its last chance :slight_smile:

Sadly no current change on any of those pins when M7, M8 and M9 fired…

Check on Gitub for other firmware versions. In some versions they dedicate an output for a specific function.