I keep getting error codes

i try starting a project and it stps before it starts, i get this error but i cant figure it out!

Unsupported or invalid g-code command found in block.

On or near line 2:

Job halted

Do you have any code listed in Gcode tab in Edit->Device Settings?

If not, can you provide the following:

  1. Type of controller you have
  2. Version of GRBL (run $I in Console if you’re not certain)
  3. Save gcode for the job using a .txt extension and upload here.

I have the mks dlc32



[MSG:Using machine:MKS DLC32]


test square.dxf (288.2 KB)

Can you push the “Save g-code” button in Laser window and save the file with a .txt extension? The .txt extension will allow the file to be uploaded here.

it wont let choose .txt, it sets itself to nc. and there is not drop box to make it txt

You can type an arbitrary extension. Or change it in a file manager after the fact.

sorry im working on it, its being a pain

squaretest.txt (222.9 KB)


Right off the bat I can see that you setup your device as a GRBL-LPC device. You should be setup as a GRBL device.

Press the “Devices” button in Laser window. Edit your configuration and change the device type to GRBL. Then step through the other configurations assuming they are correct.

Then retest.

Regenerate gcode if you still have a problem and upload.

oops thank you!
now i have this:



[MSG:Using machine:MKS DLC32]



Starting stream

[MSG:Program End]

Stream completed in 0:01

Starting stream

Layer C00

[MSG:M4 requires laser mode or a reversable spindle]


Unsupported or invalid g-code command found in block.

On or near line 2:

Job halted

Stream completed in 0:00


Is this a brand new laser setup? How are you connected to the machine?

Go to Edit->Machine Settings. Find $32 and change to 1 if current 0.

Then retest.

its a new board, my old one got fried.

these are my setting now




















































$32 was set to 1 arleady

Interesting. Can you resave gcode and upload?

squaretest5.txt (295.7 KB)

Can you try entering these commands in Console one at a time. Confirm that you get the error:20 when you enter M4.

G00 G17 G40 G21 G54
G0 X58.777Y132.647

If so, I’m wondering if you’re running a bad or old firmware.

1 Like

thank you for your help yesterday, it was due to old/ bad software. it ran great after. i couldn’t let you know because i hit my max messages being new.

Thanks for the update. What did you upgrade to in case others run into this?

GitHub - makerbase-mks/MKS-DLC32: MKS DLC32 motherboard kit, which is an offline engraving master control kit developed for desktop engraving machines. The hardware is equipped with a 32-bit high-speed ESP32 module, integrated WIFI function, and directly drives a 3.5-inch touch color screen; it can realize fast engraving and WEB web pages. Control, mobile phone APP control and other functions. i just got the latest one. Thank you for your help!

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.