SAVE GCode -> Running output from offline controller

Newbie here running a SainSmart 3018 Pro with SainSmart 5500 mW diode laser. grbl 1.1f.
I am just wondering if there any known issues with saving a design containing an image using Lightburn’s Save GCode, transferring it to a USB drive and running from the offline controller? Does anyone have experience doing this? Does the output GCode need to be edited or re-formatted in any way?

I haven’t tried yet but interested in knowing what issues may arise. The controller was bundled with the CNC machine and works fine with the test files that were originally loaded onto it. I would like to be able to use my laptop without it being tied to the machine during a longer laser job.

I can be corrected if wrong but:
The G-code is in no way different than what Lightburn Streams live
So should be able to do what you need
Of course yuo will lose the ability to jog the machine prior. job start gets then hard coded in the Gcode.

That machine doesn’t like comments in the files, and requires carriage return/line feed line endings (Windows style) instead of just carriage return (Mac / Unix style). I’m thinking of adding an export type specifically for that.

Ok I have tried a quick test file and it worked. Here’s what I did:

  1. In Lightburn, I created a small test file containing an image and some text (fill).

  2. I used the Save GCode function to create file TEST.NC

  3. I am running Windows 10, so I used NotePad++ (free download) to open TEST.NC

  4. In NotePad++, you need to convert LF (end-of-line or line feed characters) to CRLF (carriage return/line feed) and remove all comment lines (lines starting with ; semi-colon). Here’s how:

  • within Notepad ++ to see the end of line markers, Click on View > Show Symbol > then Show End of Line.
  • After that, you will be able to see the end of line characters and see which ones are used (you should see a highlighted LF at the end of each line)
  • Using the find and replace within Notepad++, we will be using \r (CR) and \n (LF) as matching values.
  • Click on Search > Replace (or Ctrl + H)
  • Find what: \n
  • Replace with: \r\n
  • Search Mode: select Extended
  • Replace All
    You should now see a highlighted CR and LF at the end of each line.

While still in NotePad++, use Find to find ; (semi-colon). Cursor should jump to next line containing a semi-colon. Delete entire line. Click Find Next. Delete line. Repeat until all lines containing comments have been deleted. (this is a pain if you have a complex design and there are probably ways to delete comment lines in one fell swoop - custom scripts?)
Save .NC file (Save As if you want to keep original .NC file)

  1. Connect Offline Controller to PC via USB and copy the edited .NC file to offline controller. (Copy to root folder on controller - not into a sub-folder)

  2. Disconnect controller from PC, and plug controller into CNC machine control board with supplied ribbon cable. Turn on CNC machine. Navigate to File menu on controller - you should see your file. Navigate using arrow buttons to your file.

  3. Using the Jog controls on the controller, move the laser head to desired origin position and press OK. Engraving should begin.

Hope this helps…

If you’re using Notepad++, you should just be able to right-click on the ‘Line Endings’ type in the status bar, pick the Windows one, and re-save. No search/replace required.


Awesome! The more you know… Is there by chance a built-in function for removing lines beginning with a specific character?

That I don’t know. I’ve been considering adding the CR/LF line ending type to the GCode saved to files, and stripping comments, or at least making it an option, for this offline controller.

Thanks Oz!

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