^CV - Code Validation
Asks the printer to validate bar code data strictly instead of printing whatever it is given.
^CV turns on the printer's bar code data checks. Without it, ZPL is permissive.
The printer pads a field too short for its symbology, truncates one too long, and
prints a scannable symbol whose interpretation line differs from the data sent.
^CV makes that a visible failure. The guide specifies that the
printer replaces the symbol with the message INVALID - X in reverse image, where
X is a letter that names the fault.
Syntax
^CVaSupport
Recognised as valid ZPL and not implemented, with no plan to.
The parser stores the argument in CvCommand.validation and reads it nowhere, so the setting has no effect. On a printer it does change the label: the printer prints INVALID - X in reverse image where a symbol with invalid data belongs. It never alters a symbol whose data is valid. Labelary does not implement it either, so no compatibility gap exists. We measured this on 2026-07-30: ^CVY renders byte-identically to the same format without it. For data problems here, read the diagnostics returned with the render. — not pinned by a test
Labelary does not implement it either, so there is no parity reference.
Parameters
aValidateoptional · Y or Nnot honoured by zpl.toolsWhether the printer checks bar code data against the symbology's rules before it encodes. Y makes the printer print an error message instead of any symbol whose data it would otherwise encode loosely.
- Default
- N
- Invalid value
- not possible — any value is accepted. The parser takes the whole command remainder as one unchecked raw string, so it accepts
^CVZand stores "Z". The renderer then discards the value. - Test coverage
- No documented value is exercised by a test (Y, N).
Y- Validate bar code data strictly
N- Accept data as given (default)
Behavior
The error codes are:
Cfor a character outside the symbology's character setEfor an incorrect check digitLfor a field that is too longSfor one that is too shortPfor a bad parameter string, which only a few symbologies report
The switch is not scoped to a format. ^CVY stays on from format to format until
another ^CV turns it off or the printer loses power. The printer does not write it
to non-volatile memory, so a job that turns validation on and never turns it off
leaves the next job validated too.
Neither the renderer nor Labelary implements any of this. Both accept the command
and encode the data as they do without it. The diagnostic channel replaces it: a
field that prints INVALID - S on a printer with ^CVY returns an
ARGUMENT_INVALID warning of
EAN-13 needs 12 digits, got 5; padded on the left with zeros. Read the
diagnostics, not the symbol.
Differences from the specification
zpl.tools against the ZPL II guide
Where our renderer behaves differently from the specification.
- The parser stores the argument in
CvCommand.validation, andzplprocessornever reads it, so^CVYand^CVNbehave identically. — not pinned by a test
zpl.tools against Labelary
Where our output differs from Labelary for the same input. These are the differences that break a migration.
- Labelary marks the command unsupported, and the renderer does not implement it either, so no gap exists. We measured this on 2026-07-29:
^XA^CVY…^XZreturns exactly the same page as the same format without it. The renderer parses the argument before it discards it, so^CVreports no unsupported-command warning while its device-oriented neighbors do. — not pinned by a test
Example
Five digits given to ^BE, which needs twelve plus a check digit. On a printer with ^CVY active this prints INVALID - S:
^XA
^CVY
^FO50,50^BY3
^BEN,80,Y,N
^FD12345^FS
^XZ
Related commands
^BYBar Code Field DefaultSets the module width, wide-to-narrow ratio and height that every later bar code inherits.^BCCode 128 Bar CodeThe most common symbology for shipping and GS1 application identifiers, with four data-encoding modes.^BQQR Code Bar CodeThe common two-dimensional matrix symbology. A prefix on the field data sets its error correction and input mode. The command does not set them.^FDField DataSupplies the text or barcode content of the field.