<p>I haven't used every flavor of gcode or firmware, but I've never seen the parameter order be important, provided that:</p>
<ol>
<li><p>The <strong>G</strong> or <strong>M</strong> code was the initial entry; and</p>
</li>
<li><p>Each parameter was clearly listed with one or more spaces between parameters; and</p>
</li>
<li><p>No spaces were in between the parameter letter and the value.</p>
</li>
</ol>
<p>We use a custom version of Repetier firmware to run 3D printers and Fadal CNC machines, and in every use <code> G1 F1200 X188 Y92 E0.01</code> would be evaluated and executed completely identically to <code>G1 X188 Y92 F1200 E0.01</code></p>
<p>Nearly all gocde variable values are persistent, so if Z remains unchanged because it is only specified once per layer, or if Z remains unchanged because it is explicitly specified (with the same value) on every line, there should be no difference in the behavior of the printer.</p>

CC BY-SA 4.0
2020-10-13T20:27:57.860Z
To expand a little on @Davo's answer. Any parameter that is omitted but required for movement is assumed by the g-code interpreter to have the same value in the state machine as when it was last provided. This is true for F, X, Y and Z. If the op wants to go hardcore though: https://www.nist.gov/publications/nist-rs274ngc-interpreter-version-3
user77232
CC BY-SA 4.0
2020-10-15T06:02:09.120Z
@user77232 And E! (then it will be a move without extrusion) See [the G0-G1 sources](https://github.com/MarlinFirmware/Marlin/blob/2.0.x/Marlin/src/gcode/motion/G0_G1.cpp). A parser is used to parse the arguments of a command, the `seen` method is used to determine if a parameter is specified in the G-code command (whatever the position is), if not, the already set one from previous commands is used.
0scar
CC BY-SA 4.0
2020-10-13T20:05:33.200Z
2020-10-13T20:33:34.680Z
2020-10-13T20:33:34.680Z
Davo
<p>I've started learning G-code for 3D printing and I'm quite confused.</p>
<p>I'm using an Ultimaker S5 printer and the firmware is : 5.5.12 - 20200226-UltiBot</p>
<ol>
<li>Is there a difference between <code>G1 F1200 X188 Y92 E0.01</code> and <code>G1 X188 Y92 F1200 E0.01</code>?</li>
<li>Most of my code looks like: <code>G1 X[coordinate] Y[coordinate] E[num]</code> without Z!
How is this possible?! My model is a 3D-model so how come the letter Z appears about 5 times in tens of papers?</li>
</ol>
<p>Any help would be greatly appreciated!</p>

<g-code><3d-printerworks>
Order in a line command in G-code
זהר מרום
# Order in a line command in G-code

(Asked by: username_0 on 2020-10-13)

I've started learning G-code for 3D printing and I'm quite confused.

I'm using an Ultimaker S5 printer and the firmware is : 5.5.12 - 20200226-UltiBot

1. Is there a difference between `G1 F1200 X188 Y92 E0.01` and `G1 X188 Y92 F1200 E0.01`?
2. Most of my code looks like: `G1 X[coordinate] Y[coordinate] E[num]` without Z!
   How is this possible?! My model is a 3D-model so how come the letter Z appears about 5 times in tens of papers?

Any help would be greatly appreciated!

**Tags:** g-code, 3d-printerworks

---

## 1 answers

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

I haven't used every flavor of gcode or firmware, but I've never seen the parameter order be important, provided that:

1. The **G** or **M** code was the initial entry; and
2. Each parameter was clearly listed with one or more spaces between parameters; and
3. No spaces were in between the parameter letter and the value.

We use a custom version of Repetier firmware to run 3D printers and Fadal CNC machines, and in every use  `G1 F1200 X188 Y92 E0.01` would be evaluated and executed completely identically to `G1 X188 Y92 F1200 E0.01`

Nearly all gocde variable values are persistent, so if Z remains unchanged because it is only specified once per layer, or if Z remains unchanged because it is explicitly specified (with the same value) on every line, there should be no difference in the behavior of the printer.

> **Comments:**
> **username_2**: To expand a little on @Davo's answer. Any parameter that is omitted but required for movement is assumed by the g-code interpreter to have the same value in the state machine as when it was last provided. This is true for F, X, Y and Z. If the op wants to go hardcore though: https://www.nist.gov/publications/nist-rs274ngc-interpreter-version-3  
> **username_3**: @user77232 And E! (then it will be a move without extrusion) See [the G0-G1 sources](https://github.com/MarlinFirmware/Marlin/blob/2.0.x/Marlin/src/gcode/motion/G0_G1.cpp). A parser is used to parse the arguments of a command, the `seen` method is used to determine if a parameter is specified in the G-code command (whatever the position is), if not, the already set one from previous commands is used.  

---

