<h2>TL;DR</h2>
<p><strong>Short answer</strong>: &quot;There is no difference!&quot;.</p>
<hr />
<p><strong>Long answer</strong></p>
<p>G-code is parsed line by line. The parser in the firmware reads the command and the options (also called parameters) following it, comments are discarded.</p>
<p>Therefore, option <code>S</code> should be followed by a Boolean value <code>0</code> for False or <code>1</code> for True. Without a value it is undefined and should be reported as incorrect or treated as false (in my opinion). But, the developers have chosen differently. If a Boolean value is expected and the value is not given, the parameter is parsed as <code>true</code>. This has analogy with other software options or switches like e.g. used by Linux commands.</p>
<p>This means that for Marlin  the G-code <code>M420 S</code> is exactly the same as <code>M420 S1</code>.</p>
<p><em>I've checked this with another command (this is not depending on the G-code command as there is a single parser processiong the G-codes and the following parameters); <code>M211</code> where <code>M211 S</code> is exactly the same as <code>M211 S1</code></em>.</p>

CC BY-SA 4.0
2020-04-13T21:59:51.813Z
2020-04-14T11:04:35.640Z
2020-06-18T08:29:41.667Z
0scar
<p>I have been reading through the Marlin website about ABL (Auto Bed Leveling)  and I see what appears to be conflicting information.</p>
<p>The <a href="https://marlinfw.org/docs/features/auto_bed_leveling.html" rel="nofollow noreferrer">Marlin docs on &quot;Automatic Bed Leveling&quot;</a> state that running <code>G28</code> (Auto Home) will turn off ABL and that to reactivate it you need to insert the code <code>M420 S1</code>.</p>
<blockquote>
<p>After a <code>G29</code> bed leveling is automatically enabled, but in all other situations you must use <code>M420 S1</code> to enable bed leveling.</p>
</blockquote>
<p>However at <a href="https://marlinfw.org/docs/gcode/G029-mbl.html" rel="nofollow noreferrer">G29 - Bed Leveling (Manual) of the Marlin G-code manual)</a> it states:</p>
<blockquote>
<p><code>G28</code> disables bed leveling. Follow with <code>M420 S</code> to turn leveling on, or
use <code>RESTORE_LEVELING_AFTER_G28</code> to automatically keep leveling on after
<code>G28</code></p>
</blockquote>
<p>The latter is referring mostly to manual bed leveling, but in this section is referring to ABL.</p>
<p>So what is the difference between the <code>S</code> and the <code>S1</code> options?</p>

<marlin><g-code><bed-leveling>
What is the difference between M420 S and M420 S1?
Steve061
# What is the difference between M420 S and M420 S1?

(Asked by: username_0 on 2019-12-24)

I have been reading through the Marlin website about ABL (Auto Bed Leveling) and I see what appears to be conflicting information.

The [Marlin docs on "Automatic Bed Leveling"](https://marlinfw.org/docs/features/auto_bed_leveling.html) state that running `G28` (Auto Home) will turn off ABL and that to reactivate it you need to insert the code `M420 S1`.

> After a `G29` bed leveling is automatically enabled, but in all other situations you must use `M420 S1` to enable bed leveling.

However at [G29 - Bed Leveling (Manual) of the Marlin G-code manual)](https://marlinfw.org/docs/gcode/G029-mbl.html) it states:

> `G28` disables bed leveling. Follow with `M420 S` to turn leveling on, or
> use `RESTORE_LEVELING_AFTER_G28` to automatically keep leveling on after
> `G28`

The latter is referring mostly to manual bed leveling, but in this section is referring to ABL.

So what is the difference between the `S` and the `S1` options?

**Tags:** marlin, g-code, bed-leveling


---

## 1 answers

### Answer by username_1 on 2020-04-13. Score: 10 | Accepted answer

## TL;DR

**Short answer**: "There is no difference!".

---

**Long answer**

G-code is parsed line by line. The parser in the firmware reads the command and the options (also called parameters) following it, comments are discarded.

Therefore, option `S` should be followed by a Boolean value `0` for False or `1` for True. Without a value it is undefined and should be reported as incorrect or treated as false (in my opinion). But, the developers have chosen differently. If a Boolean value is expected and the value is not given, the parameter is parsed as `true`. This has analogy with other software options or switches like e.g. used by Linux commands.

This means that for Marlin the G-code `M420 S` is exactly the same as `M420 S1`.

*I've checked this with another command (this is not depending on the G-code command as there is a single parser processiong the G-codes and the following parameters); `M211` where `M211 S` is exactly the same as `M211 S1`*.


---

