<p>I am trying to add the line</p>

<blockquote>
  <p>G4 P4000 G1 F4000 E-50</p>
</blockquote>

<p>to pause and retract the print in order for the printed line to dry (printing in mid air vertically). Does the above code work or should i skip lines or does it not matter at all?</p>

<blockquote>
  <p>G4 P4000<br>
  G1 F4000 E-50</p>
</blockquote>

<p>Would the following line do the exact same thing?</p>

<blockquote>
  <p>G4 P5000 E-50</p>
</blockquote>

[{'answer_id': 7418, 'author': 'Davo', 'author_id': 4922, 'author_profile': 'https://3dprinting.stackexchange.com/users/4922', 'pm_score': 2, 'selected': False, 'text': '<p>This needs to be on two lines like in your second example:</p>\n\n<blockquote>\n  <p>G4 P4000<br>\n  G1 F4000 E-50</p>\n</blockquote>\n\n<p>See the RepRap Gcode Wiki for more info. <a href="https://reprap.org/wiki/G-code" rel="nofollow noreferrer">https://reprap.org/wiki/G-code</a></p>\n\n<p>EDIT: if you actually want to retract and THEN pause, reverse it:</p>\n\n<blockquote>\n  <p>G1 F4000 E-50<br>\n  G4 P4000<br></p>\n</blockquote>\n'}, {'answer_id': 7419, 'author': '0scar', 'author_id': 5740, 'author_profile': 'https://3dprinting.stackexchange.com/users/5740', 'pm_score': 4, 'selected': True, 'text': '<p>Yes, G-code is read line by line. G-code is a numerical control programming language. It basically instructs the machine sequentially line by line to do a specific task. The printer than executes the lines one by one until it reaches the end.</p>\n\n<p>If you instruct the printer to wait (<code>G4</code> dwell), it will do the wait/dwell first and than will execute the next command to retract the filament. As such, your examples will not work if you want to retract the filament during the pause, you reversed the process if you want to achieve that.</p>\n\n<p>To add a pause (simple) for e.g. filament changing, you should instruct the head to go to a certain position, extract the filament, and now insert the pause/dwell command. Give yourself enough time to insert and prime the nozzle and go back to the last location to continue printing. </p>\n\n<p>You could insert something like (e.g. in between layer change, before <code>G1 Zx.xx</code>):</p>\n\n<pre><code>...\nG1 X0 Y0 F2000 ; Relocate the print head\nG1 F4000 E-50 ; Retract filament\nG4 P40000 ; Wait for 40 seconds\nG92 E50 ; The new filament should continue at this value\n...\nG1 Zx.xx\n</code></pre>\n\n<p>Depending on what happens after <code>G1 Zx.xx</code>, you may need to set the head back to the location prior to where it was before <code>G1 X0 Y0 F2000</code>.</p>\n\n<p>Do note that there are pausing scripts/plugins available for e.g. Ultimaker Cura, and there is also a filament changing command <a href="https://reprap.org/wiki/G-code#M600:_Filament_change_pause" rel="nofollow noreferrer"><code>M600</code></a> that can be enabled for certain firmware (if this is your ultimate goal).</p>\n\n<p>Using a post processing plugin of Ultimaker Cura, a pausing script looks like:</p>\n\n<pre>\n...\nG0 X137.692 Y105\n;TIME_ELAPSED:707.873599\n;TYPE:CUSTOM;added code by post processing\n;script: PauseAtHeight.py\n;current z: 5\n;current height: 5.0\nM83\nG1 F300 Z6\nG1 F9000 X190 Y190\nG1 F300 Z15\nM104 S0; standby temperature\nM0;Do the actual pause\nM109 S200; resume temperature\nG1 F300 Z6\nG1 F9000 X133.423 Y105\nG1 F9000\nM82\nG92 E911.50045\n;LAYER:24\nG0 X137.692 Y105 Z5\n...\n</pre>\n\n<p>Note that <code>G0</code> and <code>G1</code> are <em>"move to"</em> location instructions (albeit through a different way, fast move and linear move respectively). If you look closely, you see that after the pause, the printer returns to the X-Y position where it left prior to the pause (<code>X137.692 Y105</code>).</p>\n\n<hr>\n\n<p><em>Side note:<br>\nSome firmware flavors allow <a href="https://reprap.org/wiki/G-code#Buffering" rel="nofollow noreferrer">buffering</a>, but each statement is executed sequentially.</em></p>\n'}]
['https://3dprinting.stackexchange.com/questions/7417', 'https://3dprinting.stackexchange.com', 'https://3dprinting.stackexchange.com/users/12999/']