There is a cancel all command that you could try. You can use the ZPL version of the command, ~JA, or the SGD command:
! U1 setvar "formats.cancel_all" ""
These commands can be found on pages 220 and 734 of the ZPL Programming Guide. They should clear out everything in the printer's internal buffer.
Thank you for the response.
How would I go about using the ZPL version when paper/ribbon has run out?
I have come across this ZPL
^XA ^DFE:AUTOEXEC.ZPL^FS ^JZN^XZ
If I add this to a file and FTP it to the printer, every time an error occurs it stops re-printing the last label.
If I could make it so it clears the internal buffer instead on error then this might suffice the requirement.
I have tried
^XA ^DFE:AUTOEXEC.ZPL^FS ~JA^XZ
but the printer doesn't seem to accept the file on FTP transfer
Commands that begin with ~ are immediate commands and don't need to be nested in ^XA and ^XZ. You could try moving the ~JA command to after the ^XZ, but then I don't think it would be included in the AUTOEXEC.ZPL. The AUTOEXEC.ZPL file is only run at power up, though, so a different solution may be to send the ~JA before sending a print job if the printers may be left on after the media runs out.