Is it possible to define parameter values globally?
-
I have spent hours with my homebuilt toolchanger by tuning tpre#.g and tfree#.g files . Is it possible to define a parameter like _T0_X_collect=-147.1 ? For example:
G1 X-147.1 Y234 F2000 -> G1 X_T0_X_collect Y234 F2000.
That would ease tuning since one value must be changed in many lines.
Thanks for Your interest! -
@pertti yes. They're called global variables
https://duet3d.dozuki.com/Wiki/GCode_Meta_Commands#Section_Global_variable_declaration -
@jay_s_uk Many thanks
-
@pertti By the way, I could not figure out in which file these global declarations should exist in order to function in tpre#.g and tfree#.g files? Perhaps config.g?
-
@pertti I have my globals in a file called variables, and I call that as a macro from config.g before using the first one. There is a bit of an issue with globals in that you can't define one that already exists, so you may need to wrap them in an existence check to set rather than define if you want to reload config.g without restarting the printer.