<p>"#define" is a feature of the compiler preprocessor and isn't a feature of Marlin. So there is no general way to recover the value of a "#define variable" (which isn't actually a variable at all) unless Marlin explicitly provides the option.</p>

<p>In the current version of Marlin M851 will report the X and Y offsets. It appears you have an older version which does not do this. In older versions there appears to be no option to recover the value.</p>

CC BY-SA 4.0
2020-04-26T10:47:01.307Z
2020-04-26T10:47:01.307Z
Tom van der Zanden
<p>I previously set up my Ender 3 with a precompiled binary of Marlin that already had the correct X and Y offsets for the attached BLTouch. Now I'm compiling my own, and rather than measure for myself I'd like to just use the same numbers.</p>

<p>When I send <code>M851</code> through the terminal, it gives me the current value for the probe's Z offset from the extruder. I know I can also use <code>M851</code> to <em>set</em> the X and Y offset, but there doesn't seem to be a way to <em>read</em> the current values.</p>

<p>Is there any way to query the printer for the current values of <code>X_PROBE_OFFSET_FROM_EXTRUDER</code> and <code>Y_PROBE_OFFSET_FROM_EXTRUDER</code>? Or, ideally, for any other arbitrary variable?</p>

<marlin><g-code><bltouch>
How can I determine the current value of a #defined variable?
Robert
# How can I determine the current value of a #defined variable?

(Asked by: username_0 on 2020-04-26)

I previously set up my Ender 3 with a precompiled binary of Marlin that already had the correct X and Y offsets for the attached BLTouch. Now I'm compiling my own, and rather than measure for myself I'd like to just use the same numbers.

When I send `M851` through the terminal, it gives me the current value for the probe's Z offset from the extruder. I know I can also use `M851` to *set* the X and Y offset, but there doesn't seem to be a way to *read* the current values.

Is there any way to query the printer for the current values of `X_PROBE_OFFSET_FROM_EXTRUDER` and `Y_PROBE_OFFSET_FROM_EXTRUDER`? Or, ideally, for any other arbitrary variable?

**Tags:** marlin, g-code, bltouch


---

## 1 answers

### Answer by username_1 on 2020-04-26. Score: 1 | Accepted answer

"#define" is a feature of the compiler preprocessor and isn't a feature of Marlin. So there is no general way to recover the value of a "#define variable" (which isn't actually a variable at all) unless Marlin explicitly provides the option.

In the current version of Marlin M851 will report the X and Y offsets. It appears you have an older version which does not do this. In older versions there appears to be no option to recover the value.


---

