How to use global variables in config.g?
-
Hi,
I would like to separate some core values from the direct commands using them, such as Z probe offsets.Very early in my config.g, I set
global probe_z_offset=2.105
and a bit later I set
M558 P5 C"!^e0stop" H5 F300 T6000 ; set Z probe type to switch and the dive height + speeds G31 P500 X-30 Y-15 Z{global.probe_z_offset} ; set Z probe trigger value, offset and trigger height
After rebooting the machine
echo sensors.probes[0].offset[2]
reports
0.00
(i.e. Z offset is not set to the variable value).I also tried
...Z(global.probe_z_offset)
, andZ^{global.probe_z_offset}
andZ^(global.probe_z_offset)
.None of these seem to work.
What's the correct syntax?
-
Turns out, I was fooled by the ObjectModel. Z offset is not set, but triggerHeight is ...