Printer name as global variable used with M550
-
hi, does anyone know how i can use multiple global variables into one string with the M550 (printername)?
global AccName="Myprinter"
global serial="467"How to combine these two behind the: M550 P.....
Thanks!
-
@Yao Have a look at string concatenation operator here:
https://docs.duet3d.com/en/User_manual/Reference/Gcode_meta_commands#binary-infix-operators
e.g.
M550 P{global.AccName^global.serial} -
@T3P3Tony it just returns the name to : My Duet...
I cant even get
M550 P{global.AccName}
to work...
i dont get it. -
my bad.
line was before global !!!! -
@Yao i tend to use echo to test stuff from the console before trying it in an actual macro which helps debug.
-
@T3P3Tony the echo worked... but in the config.g that M550 was in the wrong location...
I use an external file with all globals, this was loaded after the M550 command,
...I was not paying attention... -
-