^FN Field Number

Tags a field as a variable with a number, enabling dynamic data substitution at print time.

Supported in ZPL Preview

^FN assigns a number to a field, making it a variable field whose data can be supplied at print time (rather than being hardcoded into the format). This is the foundation of Zebra's stored-format / variable-data printing model.

The workflow: store a format on the printer once (using ~DY or ^DF), mark variable fields with ^FN, then send only the variable data with each print job (using the ^FN numbers as references). This dramatically reduces data transfer — you only send what changes, not the entire label layout on every print.

^FN values range from 1 to 9999. The number must be unique within a format. At print time, data for field N is supplied by sending a format recall command with the variable values in order.

In template-style ZPL, ^FN fields display a default value from ^FD (shown when the format is recalled without variable data). For example, `^FO50,50^A0N,28,28^FN1^FD<name>^FS` shows "<name>" as placeholder text and accepts actual data when recalled.

^FN is also used in host-controlled variable printing via ZPL job streams — the host sends the stored format identifier then the variable data packets.

Syntax

^FNa[,b]

Parameters

ParameterTypeDefaultDescription
ainteger (1–9999)optionalField number. Used to reference this variable field when supplying data at print time.
bstring""Optional field name (prompt text shown on printer display for operator-filled fields).

Examples

Variable text field with placeholder

Try in Viewer
^XA
^FO50,50^A0N,36,36^FN1^FDProduct Name Here^FS
^FO50,100^A0N,28,28^FN2^FDSKU: 00000^FS
^XZ

Variable barcode field

Try in Viewer
^XA
^FO50,50^BY2,3,80^BCN,80,Y,N,N^FN1^FD000000000000^FS
^FO50,145^A0N,24,24^FN2^FDDescription^FS
^XZ

Common Mistakes

  • !Using duplicate ^FN numbers in the same format — only the last definition is used.
  • !Forgetting that ^FN fields require a ^FD default value — without it, the field renders as empty in preview and template modes.
  • !Confusing ^FN (field number for variable printing) with ^SF (serialized field increment) — they serve different purposes.
^FN Field Number — ZPL Command Reference | Prynta Co | Prynta Co