Plain English

Initialises or increments a printer-side counter variable (TSPL2 PG §SET COUNTER p132). `@n` is the counter index (typically `@0`–`@9`); `step` is the increment applied between labels in a print batch. Counter values are referenced from TEXT/BARCODE payloads via the `@n` placeholder. Useful for serialised label batches without round-tripping to the host for each value. Engine recognises the command but doesn't currently model the `@n` placeholder substitution in TEXT/BARCODE — placeholder rendering is a separate feature.

When to use

For serialised batches (e.g. consecutive part numbers) when the host wants to send one label template and let the printer increment internally.

Syntax

SET COUNTER @n step

Parameters

ParameterDescription
@n
Counter variable name (e.g. `@0`, `@1`).
step
Increment applied between labels (integer; negative permitted to count down).

Example

SET COUNTER @0 1
SIZE 100 mm, 50 mm
CLS
TEXT 50,30,"3",0,1,1,"Serial: @0"
PRINT 10

Initialise counter @0 with step 1, then print 10 labels with auto-incrementing serial numbers

Try it in the playground View all TSPL commands