<p>The constant <code>EMERGENCY_PARSER</code> is located in the advanced printer configuration file <a href="https://github.com/MarlinFirmware/Marlin/blob/1.1.x/Marlin/Configuration_adv.h" rel="noreferrer">Marlin/Configuration_adv.h</a>:</p>

<pre>
// Enable an emergency-command parser to intercept certain commands as they
// enter the serial receive buffer, so they cannot be blocked.
// Currently handles M108, M112, M410
// Does not work on boards using AT90USB (USBCON) processors!
//#define EMERGENCY_PARSER
</pre>

<p>To enable the <code>EMERGENCY_PARSER</code>, you need to remove the <code>//</code> before <code>#define EMERGENCY_PARSER</code> and recompile the sources.</p>

<p>Normally your printer will execute a command until it is ready to accept a next instruction. Without the <code>EMERGENCY_PARSER</code> set, the printer finishes the instruction that it is executing at the moment, if set, the execution is interrupted and immediately sent and thus not waiting for a clear space in the buffer.</p>

CC BY-SA 4.0
2018-11-23T13:58:41.233Z
Is there a way to know if `EMERGENCY_PARSER` is set without looking at the printer configuration file (for example, sending a command or checking the first responses when you connect via serial port)? Was this feature added on Marlin 1.1.0?
fsinisi90
CC BY-SA 4.0
2018-11-23T14:25:32.537Z
@fsinisi90 I don't know if you could try that out. You do need to somehow inject the `M112` in the midst of operation, usually that is done by the code as an emergency response on certain limit checks, I do not know how to insert that manually from outside.
0scar
CC BY-SA 4.0
2018-11-23T14:57:20.943Z
Well, I've already tried with `M190` (wait for bed temperature) and then `M108` and it's not working, but my firmware is Marlin 1.0.3 and I guess the `EMERGENCY_PARSER` was added on 1.1.0, so I don't even have the possibility to enable it. Anyway, I was looking for a way to check it on any printer from my source code (I'm connecting through pyserial), without human intervention.
fsinisi90
CC BY-SA 4.0
2018-11-23T13:44:20.667Z
2018-11-23T13:49:33.133Z
2018-11-23T13:49:33.133Z
0scar
<p>In the documentation of some commands of the Marlin firmware (like <a href="http://marlinfw.org/docs/gcode/M112.html" rel="nofollow noreferrer">M112 - Emergency Stop</a>), it says that the <code>EMERGENCY_PARSER</code> should be enabled to execute them instantaneously.</p>

<p>The thing is, I didn't find any information there of <strong>how to enable</strong> that <code>EMERGENCY_PARSER</code> or how it works.</p>

<p>Any help will be appreciated.</p>

<marlin>
How to enable EMERGENCY_PARSER in Marlin firmware?
fsinisi90
# How to enable EMERGENCY_PARSER in Marlin firmware?

(Asked by: username_0 on 2018-11-23)

In the documentation of some commands of the Marlin firmware (like [M112 - Emergency Stop](http://marlinfw.org/docs/gcode/M112.html)), it says that the `EMERGENCY_PARSER` should be enabled to execute them instantaneously.

The thing is, I didn't find any information there of **how to enable** that `EMERGENCY_PARSER` or how it works.

Any help will be appreciated.

**Tags:** marlin

---

## 1 answers

### Answer by username_1 on 2018-11-23. Score: 6 | Accepted answer

The constant EMERGENCY_PARSER is located in the advanced printer configuration file Marlin/Configuration_adv.h:

// Enable an emergency-command parser to intercept certain commands as they
// enter the serial receive buffer, so they cannot be blocked.
// Currently handles M108, M112, M410
// Does not work on boards using AT90USB (USBCON) processors!
//#define EMERGENCY_PARSER

To enable the EMERGENCY_PARSER, you need to remove the // before #define EMERGENCY_PARSER and recompile the sources.
Normally your printer will execute a command until it is ready to accept a next instruction. Without the EMERGENCY_PARSER set, the printer finishes the instruction that it is executing at the moment, if set, the execution is interrupted and immediately sent and thus not waiting for a clear space in the buffer.

> **Comments:**
> **username_0**: Is there a way to know if `EMERGENCY_PARSER` is set without looking at the printer configuration file (for example, sending a command or checking the first responses when you connect via serial port)? Was this feature added on Marlin 1.1.0?  
> **username_1**: @fsinisi90 I don't know if you could try that out. You do need to somehow inject the `M112` in the midst of operation, usually that is done by the code as an emergency response on certain limit checks, I do not know how to insert that manually from outside.  
> **username_0**: Well, I've already tried with `M190` (wait for bed temperature) and then `M108` and it's not working, but my firmware is Marlin 1.0.3 and I guess the `EMERGENCY_PARSER` was added on 1.1.0, so I don't even have the possibility to enable it. Anyway, I was looking for a way to check it on any printer from my source code (I'm connecting through pyserial), without human intervention.  

---

