23 of 67 commands supported in the playground 34%

Control

CLSSupported
Clear Image Buffer

Clears the image buffer before drawing a new label. Think of it as pressing "New Document" — it erases any previous content so you start fresh. Every label should begin with CLS after SIZE and GAP.

PRINTSupported
Print Label

Triggers printing of the label. The first parameter sets the number of label sets; the optional second sets the number of copies per set. This is always the last command in a TSPL label — like pressing "Print".

FEEDSupported
Feed Label

Feeds the label stock forward by the specified number of dots. Useful for advancing past a label without printing, or for calibration.

BACKFEEDUnsupported
Backfeed Label

Feeds the media backward by `n` dots (TSPL2 PG §BACKFEED p22–23). Range 1–9999. Used to retract the label after printing so the tear-off or cutter position is correct. TSPL printers use the alias `BACKUP n` for the same semantic (BACKFEED is the TSPL2 spelling; BACKUP is the older TSPL one). Conversion: at 200 DPI, 1 mm = 8 dots; at 300 DPI, 1 mm = 12 dots. ⚠️ Inappropriate values can cause paper jam or media wrinkle.

FORMFEEDUnsupported
Form Feed

Advances the media to the start of the next label (TSPL2 PG §FORMFEED p24). The printer uses the GAP or BLINE sensor to detect the boundary and stops there. Takes no parameters. Runtime hardware behaviour; no SVG rendering effect.

HOMEUnsupported
Home Position

Feeds the media until the internal sensor finds the next label origin (TSPL2 PG §HOME p25–26). Whether the printer back-feeds or feed-forwards to home depends on the per-model behaviour table on PG p25. Takes no parameters. ⚠️ `SIZE` and `GAP` (or `BLINE`) must have been issued first — HOME without prior geometry definition produces undefined behaviour. Runtime hardware behaviour; no SVG rendering effect.

SELFTESTUnsupported
Self-Test Page

Triggers the printer to print a diagnostic page covering its current configuration, firmware version, dot/line counters, and sensor state (TSPL2 PG §SELFTEST p31). Takes no parameters. Per-printer support table on PG p31 lists which TTP / TDP / M23 series models honour the command. Runtime hardware behaviour; the playground can't simulate a real self-test page (output depends on live printer state and counters).

INITIALPRINTERUnsupported
Factory Reset

⚠️ Factory-reset opcode — clears all `SET *` settings, downloaded fonts/images, and stored programs. Takes no parameters. Not in the 2009 TSPL2 PG; appears in later TSC firmware addenda for the TX/TE/MH-series. On models that don't expose the opcode, the equivalent recovery procedure is "hold FEED during power-on" (per the DOWNLOAD section's AUTO.BAS-disable note on PG p81). Runtime hardware behaviour; no SVG rendering effect. Use with care — this is destructive and irreversible.

EOPUnsupported
End of Program

Marks the end of a stored program. When downloading label templates to the printer's memory, EOP signals where the program ends.

SOUNDUnsupported
Printer Beeper

Triggers the printer's beeper for a tone at the specified level and duration. TSPL2 PG §SOUND p28. `level` is the sound level / tone (0–9, 10 discrete steps), `interval` is the timing control (1–4095). Chain multiple SOUND lines to play a tune. No visual rendering effect — runtime hardware behaviour. Useful for signalling end-of-batch or alerting the operator.

Label Setup

SIZESupported
Label Size

Sets the width and height of the label. You can specify the dimensions in mm (millimetres) or inch. This must be the first configuration command — it tells the printer how big the label is.

GAPSupported
Gap Distance

Sets the gap distance between labels and the offset from the gap to the start of the printable area. The gap is the transparent space between die-cut labels on a roll.

BLINEUnsupported
Black-Mark Media Mode

Configures black-mark media mode and extra-feeding offset (TSPL2 PG §BLINE p8). Used instead of GAP for continuous media with black registration marks printed on the backing. `m` is the height of the black mark (0–1 inch, or 0–25.4 mm). `n` is extra label-feeding length after the mark (0 to label-length; `0,0` = continuous label). Two forms: bare numbers = inches; numbers followed by ` mm` (with a leading space) = millimetres. ⚠️ When changing the sensor type from "GAP" to "Black Mark", BLINE **must** be sent to the printer first — before SIZE / GAP / TEXT. Engine-recognised but no visible SVG effect today (the playground treats labels as already-isolated).

REFERENCESupported
Reference Point

Sets the reference origin point for all coordinates on the label. All subsequent X,Y positions are relative to this point. It is like setting page margins — shifting the entire design.

DIRECTIONSupported
Print Direction

Sets the print direction. 0 = head moves forward (default), 1 = head moves backward. The optional second parameter mirrors the output.

OFFSETUnsupported
Form-Feed Offset

⚠️ Despite the historical 'OFFSET' name, this is NOT a horizontal coordinate offset — for that, use REFERENCE (origin shift) or SHIFT (vertical translate). TSPL2 §OFFSET p9 defines it as the **selective extra label-feeding length** the printer takes on each form-feed, used in peel-off and cutter modes to adjust where the label stops. The printer back-tracks this extra length before the next print run. Range −1 ≤ m ≤ 1 (inch). Two forms: bare number = inches; followed by ` mm` (with leading space) = millimetres. ⚠️ An out-of-range or otherwise inappropriate value may cause a paper jam. Engine-recognised but no SVG effect today (playground does not simulate the feed/back-feed cycle).

SHIFTSupported
Vertical Label Shift

Shifts the entire imaged label vertically by `n` dots (positive or negative). Used to align with pre-printed stock, correct registration drift, or fine-tune the print position without re-issuing every coordinate. TSPL2 PG §SHIFT p15–16: range is ±203 dots on 200 DPI printers, ±300 on 300 DPI printers (max 1 inch absolute). A positive value moves the label further from the printing direction; negative moves it toward.

Text

Graphics

BOXSupported
Rectangle / Box

Draws a rectangle (box) from the top-left corner (x1,y1) to the bottom-right corner (x2,y2) with the specified line thickness. An optional radius parameter rounds the corners.

BARSupported
Filled Bar

Draws a filled rectangular bar (solid black) at the specified position with the given width and height. Use this for solid divider lines, section fills, or thick separators.

REVERSESupported
Reverse Block

Inverts the specified rectangular area on the label — black becomes white and white becomes black. Use it over text to create white-on-black reversed text blocks.

ERASESupported
Erase Area

Erases (clears to white) the specified rectangular area in the image buffer. Anything previously drawn in that area is removed. Per TSPL2 PG §ERASE (p43); the PG's canonical example draws BAR 100,100,300,300 then ERASE 150,150,200,200 to carve a hole out of the centre — document order matters, since ERASE paints over earlier draw commands.

DIAGONALSupported
Diagonal Line

Draws a straight line from (x1,y1) to (x2,y2) with the given stroke thickness. Useful for crosses, voided-label diagonals, and quick separator strokes.

BLOCKSupported
Text Block (auto-wrap)

Draws a multi-line text block with automatic word-wrap inside a width × height bounding box. Like TEXT but words break at whitespace once they would exceed `width`, and the engine clips at `height` once `floor(height / fontHeight)` lines have been laid out. BLOCK is a TSPL2 firmware addendum (TX/TE/MH-series) — not in the 2009 PG.

CIRCLESupported
Circle

Draws a circle. (x,y) anchors the upper-left corner of the bounding box — not the centre — so the rendered centre lands at (x + diameter/2, y + diameter/2). Per TSPL2 PG §CIRCLE (p41).

ELLIPSESupported
Ellipse

Draws an ellipse inside a width × height bounding box. Like CIRCLE, (x,y) anchors the upper-left corner of the bounding box — not the centre — so the rendered centre lands at (x + width/2, y + height/2). ELLIPSE is a TSC firmware addendum (TX/TE/MH-series) — not in the 2009 TSPL2 PG.

Barcodes & 2D Codes

RFID

RFIDSupported
RFID Gen2 Operation

Dispatches an RFID Gen2 tag operation. The first word after RFID picks the action — READ pulls data out of a memory bank, WRITE encodes data into a bank, LOCK applies a Gen2 lock policy, KILL irreversibly disables the tag, and PERMALOCK irreversibly locks a bank. The bank selector (in quotes) is one of "EPC", "USER", "TID", or "RESERVED". This command only works on TSPL2 printers with an RFID head fitted (e.g. TSC TTP-247R, TTP-2410MT, MH-241).

RFID READUnsupported
RFID Read Bank

Reads `<length>` bytes from `<bank>` starting at byte `<offset>` (TSPL2 PG §RFID READ p113). Offset and length are byte counts, not word counts. The read result is returned to the host as a hex string over the back-channel and may be displayed on the printer LCD on firmware that supports it. Engine-recognised but no SVG output — RFID operations don't produce label content.

RFID WRITEUnsupported
RFID Write Bank

Encodes `<hex-data>` into `<bank>` starting at byte `<offset>` (TSPL2 PG §RFID WRITE p114). `<hex-data>` is a hex-character string — each pair of hex chars = 1 byte. EPC bank typically takes 24 hex chars for the 96-bit SGTIN-96 encoding. If `<data>` length doesn't match the bank's word boundary, the write is padded or truncated per the Gen2 spec. Note: the TID bank is factory-locked and not writable — the engine emits a warning when targeting it.

RFID LOCKUnsupported
RFID Lock Bank

Applies a Gen2 access-policy lock to `<bank>` using the 32-bit access password (TSPL2 PG §RFID LOCK p116). `<password>` is 8 hex characters. `<policy>` is the Gen2 lock-action enum (0–3). Policy 3 is irreversible (use `RFID PERMALOCK` as the convenience wrapper). Note: the RESERVED bank exposes two named partitions on some firmware — `"KILL"` for the kill-password area and `"ACCESS"` for the access-password area.

RFID KILLUnsupported
RFID Kill (Permanent Disable)

⚠️ **Permanently and irreversibly disables the tag — cannot be undone.** Issues the Gen2 Kill command using the tag's 32-bit kill password (TSPL2 PG §RFID KILL p118). `<kill-password>` is 8 hex characters. A non-zero kill password is required by the Gen2 spec — the tag will reject KILL if its kill-password is all-zero (the engine surfaces this as a diagnostic). The kill password must have been previously written into the RESERVED bank (bytes 0–3) and is typically locked at the same time. Once successfully killed, the tag is permanently silent — no further reads or writes are possible. Used at end-of-life destruction stations for items leaving the supply chain.

RFID PERMALOCKUnsupported
RFID Permanent Lock

⚠️ **Irreversibly locks `<bank>` — the bank cannot be unlocked again.** Convenience wrapper for `RFID LOCK "<bank>", "<password>", 3` (Gen2 policy 3 = permanently-locked). `<password>` is the 8-hex-character (32-bit) access password. After successful execution, the bank's lock state cannot be changed — subsequent `RFID LOCK` or `RFID PERMALOCK` calls against that bank will fail.

Configuration

DENSITYSupported
Print Density

Sets the print darkness (density). Higher values produce darker output. The range is 0-15. Start at 8 and adjust up or down based on scan results and visual quality.

SPEEDSupported
Print Speed

Sets the print speed in inches per second. Higher speeds are faster but may reduce print quality. Available speeds depend on your printer model.

CODEPAGEUnsupported
Character Code Page

Selects the character encoding for TEXT data (TSPL2 PG §CODEPAGE p18–19). Different code pages support different glyph sets — critical for international characters. Default at power-on is `437` (US OEM). The PG enumerates four families: 7-bit national variants (USA / BRI / GER / FRE / DAN / ITA / SPA / SWE / SWI), 8-bit DOS codepages (437 / 850 / 852 / 860 / 863 / 865 / 857), Windows codepages (1250 / 1252 / 1253 / 1254 / WPC1251 / WPC1255 / WPC1257 / 866), plus per-model UTF-8 / CJK additions in the model-specific appendix. Engine-recognised but doesn't currently apply byte→glyph mapping in TEXT (always passes through UTF-8/ASCII). Follow-up tracked for the mapping work.

SETUnsupported
Printer Configuration Dispatcher

Generic printer-configuration dispatcher (TSPL2 PG §SET p132–148). The first word after SET picks the setting being changed. Engine-recognised sub-actions cover the full PG-documented set except GAP, which requires lexer-mode disambiguation (tracked separately). All SET settings are persistent across power cycles unless the sub-page says otherwise (RIBBON is non-persistent). Engine-recognised but not rendered — labels with SET configure the printer hardware rather than producing label content.

SET PEELUnsupported
Peel-off Mode

Toggles the printer's peel-off mode (TSPL2 PG §SET p142). When ON, the printer waits for the operator to remove each label from the liner before printing the next; when OFF, labels print continuously. Persistent across power cycles.

SET TEARUnsupported
Tear-off Mode

Toggles the printer's tear-off behaviour (TSPL2 PG §SET p143–144; alias STRIPER on some models). When ON, the printer advances each label past the tear bar after printing so the operator can tear it off cleanly; when OFF, the label stops at the print head. Persistent across power cycles.

SET CUTTERUnsupported
Auto-Cutter Mode

Configures the optional auto-cutter (TSPL2 PG §SET p133). OFF disables the cutter; BATCH cuts once at the end of a print batch; a numeric argument cuts every N labels. Persistent across power cycles. Only effective on cutter-equipped printers — sending this to a non-cutter model is a recognised no-op.

SET HEADUnsupported
Head-Open Sensor Mode

Toggles the head-open sensor (TSPL2 PG §SET p147). When ON (the safe default), the printer halts printing if the print head is opened mid-job; when OFF, the sensor is ignored. Persistent across power cycles. **Do not disable in production** — head-open during printing can damage the print head or smear ink/ribbon.

SET RIBBONUnsupported
Ribbon-Detect Mode

Toggles the ribbon-detect sensor (TSPL2 PG §SET p148). When ON, the printer halts if it doesn't detect a thermal-transfer ribbon (i.e. assumes thermal-transfer mode); when OFF, the printer assumes direct-thermal media and ignores the ribbon sensor. **Non-persistent — reverts on power cycle.** This is the only SET sub-action whose value isn't kept across reboots.

SET COUNTERUnsupported
Counter Variable

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.

SET PARTIAL_CUTTERUnsupported
Partial-Cut Mode

Configures the partial-cutter accessory (TSPL2 PG §SET PARTIAL_CUTTER p134). Sibling of `SET CUTTER` — partial cut leaves a small tab so the next label hangs from the previous, useful for catalog/peel-off workflows. OFF disables the partial cutter; BATCH cuts once at the end of a print batch; a numeric argument cuts every N labels. Persistent across power cycles. Only effective on partial-cutter-equipped hardware — sending this to a non-cutter model is a recognised no-op.

SET BACKUnsupported
Back-Feed Toggle

Toggles automatic back-feed after each print (TSPL2 PG §SET BACK p135). When ON, the printer retracts to its print-start position after each label — useful for peel-off and tear-off workflows where the label needs to be repositioned before the next print. Persistent across power cycles. Distinct from the top-level `BACKFEED n` command, which is a one-shot retract by N dots.

SET KEY1Unsupported
Front-Panel KEY1 Remap

Remaps the printer's front-panel KEY1 to a chosen action (TSPL2 PG §SET KEY1 p136–137). Useful for tuning printer behaviour to a specific deployment — e.g. mapping KEY1 to PAUSE for an interactive workflow, or to CALIBRATION for a maintenance role. Persistent across power cycles.

SET KEY2Unsupported
Front-Panel KEY2 Remap

Remaps the printer's front-panel KEY2 to a chosen action (TSPL2 PG §SET KEY2 p137–138). Identical action enum to `SET KEY1`. Persistent across power cycles. Useful for printers with a two-key front panel where each key gets a distinct workflow role (e.g. KEY1 = PAUSE, KEY2 = FEED).

SET REWINDUnsupported
External-Rewinder Toggle

Toggles external-rewinder support (TSPL2 PG §SET REWIND p139). When ON, the printer drives an attached external-rewinder accessory; when OFF, no rewinder signalling is generated. Persistent across power cycles. Only effective on rewinder-equipped deployments — sending this to a printer without the accessory is a recognised no-op.

SET PRINTKEYUnsupported
Print-Key Behaviour

Configures the front-panel print-key behaviour (TSPL2 PG §SET PRINTKEY p140). OFF disables the print key; ON makes a single press print one label; AUTO triggers auto-repeat printing while the key is held; a numeric value `<n>` prints N labels per press. Persistent across power cycles.

SET STRIPERUnsupported
Striper (alias of SET TEAR)

Alias of `SET TEAR` on some firmware revisions (TSPL2 PG §SET STRIPER p143–144). Same semantics, alternate keyword surfaced for models that ship with a "striper" label on the front panel. See `SET TEAR` for the canonical documentation — anything you can do with one, you can do with the other. Persistent across power cycles.

LIMITFEEDUnsupported
Calibration Feed Limit

Caps the distance the printer feeds while searching for the next label gap during calibration / HOME. TSPL2 PG §LIMITFEED p30. Prevents runaway feeds on mis-cut or misaligned stock. Default 10 inches at boot. Two forms: `LIMITFEED n` (inches, English system) or `LIMITFEED n mm` (metric — must have a space before `mm`). Resident in memory across the session. No visual rendering effect — runtime hardware behaviour.

COUNTRYUnsupported
Country / Language Code

Selects the country / language code that orients the KP-200-series LCD keyboard and affects special-character mapping for built-in fonts. TSPL2 PG §COUNTRY p17. `n` is a 3-digit code: 001 USA, 002 Canadian-French, 003 Spanish (Latin America), 031 Dutch, 032 Belgian, 033 French, 034 Spanish (Spain), 036 Hungarian, 038 Yugoslavian, 039 Italian, 041 Switzerland, 042 Slovak, 044 United Kingdom, 045 Danish, 046 Swedish, 047 Norwegian, 048 Polish, 049 German, 055 Brazil, 061 English (International), 351 Portuguese, 358 Finnish. Engine accepts the code but doesn't currently apply locale-specific TEXT formatting — flagged as supported:false until the date-placeholder feature lands.

DOWNLOADUnsupported
Download File

Begins downloading a file (program, font, or image) to the printer's internal flash memory. The data follows on subsequent lines until EOP.

BTUnsupported
Bluetooth Configuration Dispatcher

Generic Bluetooth configuration dispatcher. The first word after BT picks the sub-action — NAME sets the device name visible to pairing hosts, PIN sets the legacy-pairing PIN. Not in the 2009 TSPL2 PG: Bluetooth is an optional module on later TSC models (TX/TE/MH-series and Alpha-series with optional BT) and the commands are documented in per-model BT setup addenda. Engine-recognised but not rendered — labels with BT configure the printer hardware rather than producing label content.

BT NAMEUnsupported
Bluetooth Device Name

Sets the Bluetooth friendly-name the printer advertises over GAP, visible to pairing hosts during device discovery. Not in the 2009 TSPL2 PG — refer to the target model's BT setup addendum for the supported character set and maximum length on that firmware.

BT PINUnsupported
Bluetooth Pairing PIN

⚠️ Credential — appears in label source; do NOT commit to public repositories. Sets the Bluetooth legacy-pairing PIN (BT 2.1+EDR), typically a 4-digit numeric string. Modern Bluetooth SSP (Simple Secure Pairing) doesn't use a static PIN — on SSP-only firmware this command may document as a no-op. Not in the 2009 TSPL2 PG; refer to the target model's BT setup addendum.

WLANUnsupported
Wi-Fi Configuration Dispatcher

Generic Wi-Fi configuration dispatcher. The first word after WLAN picks the sub-action — SSID sets the network name, PSK sets the WPA passphrase, ENCRYPTION picks the security mode, IP/GATEWAY/NETMASK/DNS configure a static-IP profile, and DHCP toggles automatic addressing (which overrides the static-IP commands). Not in the 2009 TSPL2 PG: Wi-Fi is an optional module on later TSC models (TX/TE/MH-series and Alpha-series with optional Wi-Fi) and the commands are documented in per-model WLAN setup addenda. Engine-recognised but not rendered — labels with WLAN configure the printer hardware rather than producing label content.

WLAN SSIDUnsupported
Wi-Fi Network Name

Sets the Wi-Fi network name (ESSID) the printer joins. Verify any length limits and allowed characters against the target model's WLAN setup addendum.

WLAN PSKUnsupported
Wi-Fi Pre-Shared Key

⚠️ Credential — appears in label source; do NOT commit to public repositories. Sets the WPA/WPA2/WPA3 pre-shared key passphrase (8–63 ASCII characters per IEEE 802.11i, or a 64-hex-char raw PSK). Effective only when `WLAN ENCRYPTION` is set to a WPA-family mode.

WLAN ENCRYPTIONUnsupported
Wi-Fi Security Mode

Selects the Wi-Fi security mode the printer uses to associate. OPEN is unencrypted; WEP is legacy and insecure; WPA / WPA2 / WPA3 are the modern pre-shared-key modes (PSK comes from `WLAN PSK`). Enterprise-capable firmware may also accept WPA2-ENTERPRISE / WPA-EAP, which require certificate-handling sibling commands per the model's addendum. Verify exact spelling against the target model's WLAN setup addendum.

WLAN IPUnsupported
Wi-Fi Static IP Address

Sets the static IPv4 address the Wi-Fi interface uses when DHCP is off. Ignored at boot when `WLAN DHCP ON` has been issued in the same profile.

WLAN DHCPUnsupported
Wi-Fi DHCP Toggle

Toggles DHCP client mode on the Wi-Fi interface. When ON, the printer obtains an IP/gateway/netmask/DNS automatically and the static-IP commands (`WLAN IP`, `WLAN GATEWAY`, `WLAN NETMASK`, `WLAN DNS`) are ignored at boot. When OFF, the static-IP commands take effect.

WLAN GATEWAYUnsupported
Wi-Fi Default Gateway

Sets the default-gateway IPv4 address the Wi-Fi interface routes traffic through when DHCP is off. Ignored at boot when `WLAN DHCP ON` has been issued.

WLAN NETMASKUnsupported
Wi-Fi Subnet Mask

Sets the IPv4 subnet mask the Wi-Fi interface uses when DHCP is off. Ignored at boot when `WLAN DHCP ON` has been issued.

WLAN DNSUnsupported
Wi-Fi DNS Server

Sets the primary DNS server IPv4 address the Wi-Fi interface uses for hostname resolution when DHCP is off. Ignored at boot when `WLAN DHCP ON` has been issued.

Try these commands live

The TSPL Playground lets you write TSPL and see labels render in real time - with syntax highlighting, autocomplete, and the full command reference built in.