How to clear buffer with ZPL II [Zebra GK420d]

Wiktor picture Wiktor · Apr 27, 2015 · Viewed 7.3k times · Source

In documentation of ZPL II language there is command "~JA" which allow to clear all jobs in buffer.

Unfortunately it seems to not working on Zebra GK420d ( but I can't also find any word about it in printer specification ).

I can print labels with sending for example this string to printer :

PUT 
"^XA" SKIP
"^MMT" SKIP
"^LL1279" SKIP
"^PW799" SKIP
"^LS0" SKIP
"^BY5,3,387^FT633,947^B2B,400,Y,N,Y" SKIP
"^FD>:" v_value FORMAT 'x(8)' "^FS" SKIP
"^FT133,707^A0B,56,81^FH\^FD" v_value "^FS" SKIP
"^FT131,1100^A0B,56,81^FH\^FDVALUE:^FS" SKIP
"^PQ1,0,1,Y^XZ" 
SKIP.

Then if there is more than 2 labels in buffer i try to clear buffer with :

PUT 
"^XA" SKIP
"~JA" SKIP
"^XZ" SKIP
.

Without result.

I tried also only PUT "~JA" SKIP .

Again without result.

I cannot find any information why it's not working or how to make this working with Zebra GX420d.

Can You help me? Maybe this is not possible with this printer.

Thank You for all help.

Best Regards, Wiktor

Answer

Jensd picture Jensd · Apr 27, 2015

Tilde (~) is Progress default escape character. Use two tildes to bypass that:

PUT "~~JA" SKIP.

You can also look at the CONTROL option for the PUT statement.

CONTROL expression

The expression specifies a control sequence that you want to send without affecting the current line, page counters, and positions maintained within ABL. Following CONTROL, expression can be a character-string expression or a RAW variable. It can include null character constants of the form NULL or NULL( expression ), where expression specifies the number of NULLs to send.

Example:

PUT STREAM A CONTROL "~033A" NULL.