Conditional gcode
-
My sand table is running a macro that calls out a long sequences of gcode files to run on the table. The macro is very tediously assembled manually and subject to errors. I recently discovered that the sequence currently running must have a typo in one of the gcode file names that make up part of the sequence. When the macro gets to that point, the whole thing just stops. There's no UI on the table, so I don't know exactly where the error occurred, so I will have to manually go into the macro and hunt for the typo.
Is there some conditional gcode that can be included in a macro that will just skip a file in the sequence when the controller can't locate that file because of a typo or other problem?
Thanks!
-
@mrehorstdmd you could use the fileexists() function to confirm if the requested file is on the SD card, and then if it is process it?
https://docs.duet3d.com/en/User_manual/Reference/Gcode_meta_commands#functions
however you probably want to assign the file to a variable and then check that otherwise you would be typing it twice, which defeats the point. -
@T3P3Tony Thanks! I wasn't aware all these commands existed. I'll give it a go.