zpl.tools
Bar Code Commands

^BY - Change Narrow Bar Width

Sets default width and ratio for bar codes

^BY - Change Narrow Bar Width

Overview

The ^BY command sets the default narrow bar width and the ratio between narrow and wide bars for all subsequent barcode commands.

Syntax

^BYw,r,h

Parameters

  • w = Narrow bar width in dots (module width)
  • r = Wide:narrow ratio
    • Typical: 2.0-4.0
    • 2.0 = 1D codes with 2:1 ratio
    • 3.0 = 1D codes with 3:1 ratio
  • h = Default bar code height in dots

Description

  • Affects all subsequent barcode commands
  • Controls barcode size and proportions
  • Applied until changed or format ends
  • Impacts barcode readability

Usage Notes

  • Set once at beginning for consistency
  • Affects width and height of all following barcodes
  • Typical narrow width: 2-4 dots
  • Ratio determines bar thickness variation
  • Persists through format

Example

^XA ^BY2,3,50 ^FO50,50 ^BCN,100,Y,N,N ^FDCode 128 with defaults^FS ^FO50,160 ^BCN,100,Y,N,N ^FDAnotherCode128^FS ^XZ

Module Width Reference

WidthDensityPrint Quality
1-2Very HighHigher resolution needed
2-3HighGood for small items
3-4MediumStandard (recommended)
4-6LowLarge items/distance

Ratio Reference

RatioTypeUsage
2.0Narrow barsSmall labels
2.5StandardMost applications
3.0Wide barsLarge items
4.0Very wideLong distance

Common Configurations

^BY2,3,50 # Small, ^BY3,2.5,60 # Standard barcode ^BY4,3,80 # Large barcode
  • ^BC - Code 128
  • ^B3 - Code 39
  • ^BQ - QR Code
  • ^BX - Data Matrix

See Also