# Artisan 40W Laser Control Using Lightburn Macros

**URL:** <https://forum.snapmaker.com/t/artisan-40w-laser-control-using-lightburn-macros/36468>\
**Category:** Artisan (3-in-1)\
**Tags:** Gcode, Laser\
**Created:** [July 26, 2024, 1:56am UTC](https://forum.snapmaker.com/t/artisan-40w-laser-control-using-lightburn-macros/36468 "2024-07-26T01:56:05Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![shaneparlier](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.snapmaker.com/shaneparlier/32/26998_2.png) [@shaneparlier](https://forum.snapmaker.com/u/shaneparlier)\
**Post date:** [July 26, 2024, 1:56am UTC](https://forum.snapmaker.com/t/artisan-40w-laser-control-using-lightburn-macros/36468/1 "2024-07-26T01:56:06Z")

</div>

Good evening,

I’m curious if there is any Macros available to control the Enclosure Fan and Air Purifier? Also a dwell function to use in Lightburn would be nice so that I could get the Start Code to automatically turn on the Air purifier and exhaust fan and then delay turning them off after completion. I’ve already gotten the Crosshair Macro (M2000 L13 P0) to turn that off when starting a project, I would just like to have all of the other functions to turn on/off automatically…

I did not see these macros when looking in the Luban Workspace console. I’ve also searched the forums and asked AI to no avail. Is this only an HMI function? I have had issues with the Controls disappearing (except for the move menu) on the controls screen/having to reboot to bring them back up. It also causes lag when turning the air purifier and exhaust fan on while running g-code in Lightburn.

Thank you for any suggestions/comments,  
SP

---

<div class="post-metadata">

**Author:** ![Skreelink](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.snapmaker.com/skreelink/32/16398_2.png) [@Skreelink](https://forum.snapmaker.com/u/Skreelink)\
**Post date:** [July 26, 2024, 4:11pm UTC](https://forum.snapmaker.com/t/artisan-40w-laser-control-using-lightburn-macros/36468/2 "2024-07-26T16:11:09Z")

</div>

To control the air purifier the gcode is as follows;

```auto
M2000 W42 P1 (This turns the Purifier on P0 turns it off)
M2000 W40 P3 (This controls the speed, P1-P3 for low to high)

```

To wait, that’s simply a `G4` command. Its flags are `Px` and `Sx` (P being miliseconds, S being seconds)

```auto
G4 P1000 (pauses for 1000ms)
G4 S1 (Pauses for 1s)

```

Effectively the above two commands should be the same, but place it in the footer gcode before your purifier off gcode.

```auto
G4 S300
M2000 W42 P0

```

The above gcode waits 5 minutes (300 seconds) before sending the command to turn off the purifier. As far as the fan goes, I’m not sure. I don’t have an artisan to do tests with to try finding which flag controls the fan.

However; there’s a macro in the Ray lightburn profile that might work to turn on/off the enclosure. Might be worth testing.

```auto
"Macro4_Content": "M2000 W5 P0 Q0\n",
"Macro4_Label": "Enable Enclosure",
"Macro5_Content": "M2000 W5 P1 Q0\n",
"Macro5_Label": "Disable Enclosure",

```

Though, I would have figured `P0` would have disabled, not enabled it. Couldn’t hurt to poke [support@snapmaker.com](mailto:support@snapmaker.com) and ask, or maybe @Jade ?

---

<div class="post-metadata">

**Author:** ![shaneparlier](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.snapmaker.com/shaneparlier/32/26998_2.png) [@shaneparlier](https://forum.snapmaker.com/u/shaneparlier)\
**Post date:** [July 26, 2024, 4:35pm UTC](https://forum.snapmaker.com/t/artisan-40w-laser-control-using-lightburn-macros/36468/3 "2024-07-26T16:35:01Z")

</div>

Thank you! The Air Purifier is working as intended. Tried different configurations of the other ones for the enclosure but received errors:

> M2000 W5 P0 Q0  
> [hmi\_set\_enclosure\_check] got a invalid parameter  
> invalid sacp hmi channel[21]  
> ok  
> M2000 W5 P0 Q0\n  
> [hmi\_set\_enclosure\_check] got a invalid parameter  
> ok  
> M2000 W5 P1 Q0\n  
> [hmi\_set\_enclosure\_check] got a invalid parameter  
> ok  
> M2000 W5 P1  
> [hmi\_set\_enclosure\_check] got a invalid parameter  
> ok  
> M2000 W5 P0  
> [hmi\_set\_enclosure\_check] got a invalid parameter  
> invalid sacp hmi channel[49]  
> ok

However, it’s not totally necessary; as long as the purifier is working, it will drag the fan along with it. Thanks again!
