What is the difference between M420 S and M420 S1?
I have been reading through the Marlin website about ABL (Auto Bed Leveling) and I see what appears to be conflicting information.
At https://marlinfw.org/docs/features/auto_bed_leveling.html it states that running
G28(Auto Home) will turn off ABL and that to reactivate it you need to insert the code
However at https://marlinfw.org/docs/gcode/G029-mbl.html it states:
G28disables bed leveling. Follow with
M420 Sto turn leveling on, or
RESTORE_LEVELING_AFTER_G28to automatically keep leveling on after
The latter is referring mostly to manual bed leveling, but in this section is referring to ABL.
So what is the difference between the
Short answer: "There is no difference!".
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.
Sshould be followed by a Boolean value
0for False or
1for 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 Sis exactly the same as
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 Sis exactly the same as