What Are the M117 and M300 G-Codes? (How to Use?)

Even though 3D printer software allows us to enjoy 3D printing without having to delve into G-codes, we can’t deny that knowing about them comes with quite a few benefits, especially considering that they aren’t as scary as they look from the outside.

As there is a G-code for every action your 3D printer can perform, it’s possible to fine-tune everything ranging from temperatures to offsets with them, making them a brilliant addition to any 3D printing enthusiast’s toolkit.

While we have talked about plenty of G-codes that directly impact the printing process in our articles before, today’s G-codes will be slightly different, leaning towards quality-of-life improvements rather than tweaking the printing process.

So, what are the M117 and M300 G-codes?

The M117 (Set LCD Message) G-code allows you to display the text of your choice on the LCD panel of the 3D printer.

The M300 (Play Tone) G-code allows you to play tones through the speaker of your 3D printer.

While both of these commands are extremely simple to use, they can be a great addition to your 3D printing experience if you use them in the right scenarios.

What Is the M117 (Set LCD Message) G-Code?

M117 is one of the least technically complex G-codes you can use, but its functionality is a vital one without a doubt.

The M117 G-Code allows you to specify a text the printer will display on the LCD screen, which you can utilize in plenty of different ways.

Before we go further into use cases, let’s take a quick look at the syntax:

M117 [string]

As you can see, it’s a very simple G-code that only takes one parameter, which is the text that the printer will display.

An example would be:

M117 Starting the printing process.

Running the command above would display the text “Starting the printing process.” on the LCD panel until you issue M117 again with a different message.

Now, let’s take a look at possible use cases for the M117 G-code and how you can incorporate it into your 3D printing processes.

  • Track the progress of a print. By adding the M117 G-code at points of your choice, such as certain heights or layers, you can see the progress of the printing process by simply looking at the LCD panel.
  • Notify that the printing process is over. You can add M117 as the last G-code the printer will invoke with a message that will let you know that the printing process is over.
  • Track certain events. You can use M117 to let you know about events, such as when the printer is leveling the bed, turning the cooling fan on or off, enabling or disabling the motors, and many more.

While you can perform a successful print without using the M117 G-code at all, we highly recommend using it if you are a beginner, as the text will help you understand what your printer is doing at any time.

What Is the M300 (Play Tone) G-Code?

Another simple G-code to use – M300 offers a great deal of functionality in the quality of life department.

The M300 G-code causes the printer to play a tone through its speaker, which you can customize by passing frequency and duration parameters.

Let’s take a quick look at how you can use the M300 G-code:

M300 P<ms> S<Hz>

The syntax above shows us that this G-code accepts two parameters; P for the duration (in milliseconds) and S for the frequency (in hertz).

Here is an example:

M300 S300 P2000

Running the command above would play a sound with a frequency of 300 Hz for 2000 milliseconds (2 seconds).

So, what are the use cases for the M300 G-code?

  • Track the print progress. You can use the M300 G-code to play certain sounds at points (such as after every layer) of the printing process, which will quickly allow you to track the progress of your print.
  • Send notifications. If you add the M300 G-code before and after actions that require your attention, such as a filament change, the printer will play a tone to notify you and capture your attention.
  • Track printer actions. Another use case for the M300 G-code is to follow the actions of your printer, such as a change in the nozzle or bed temperature.
  • Play music. While this is more of a fun one, you can use the M300 G-code to play music with the speaker of your printer. If you are interested, check out the next section, where we will go into this in greater detail!

Playing Music with the M300 G-Code

If you’re looking to have a bit of fun with your 3D printer’s speaker, you will enjoy this section, where we will talk about how you can play music with the M300 G-code.

To put it simply, playing music with G-code is as simple as lining the correct tones up one after the other.

While finding the correct tones to play a song is quite challenging, some community-made scripts convert MIDI files to G-code, such as this one.

We have found out that music that isn’t too complex works the best in general, such as theme songs to unforgettable games like Super Mario and Tetris.

Even though the range of tones your 3D printer’s speaker can produce is limited, those who enjoy chiptunes will definitely get a kick out of this one!

Wrapping Up

Despite being two of the lesser-known G-codes in the 3D printing space, both M117 and M300 can quickly improve your 3D printer experience with the functionality they offer.

As 3D printing is a process that can take a decent amount of time, we believe that using these G-codes to track the progress of your print comes in extremely handy, especially if you are attending to something else while your 3D printer is operating.

We hope you found these G-codes valuable, and we will see you next time with more G-codes we think are handy to know about in the upcoming articles!