TSPL printer protocol user manual
I.Introduction
TSPL label printer protocol supports DL-888D, SPRT TL21 series printers
II. Setting step
1.Select protocol
Create a new project, select the TSPL label printer protocol as shown below.
2.Set parameters
The connection between the TSPL label printer and the HMI is via the USB-A interface, no need to configure serial port parameters.
3.Printer register
Register | System | Range | Function |
TSPL_SP | decimal | 0 - 1 | Set the paper size |
TSPL_PT | decimal | 0 - 1999 | Print text |
TSPL_PQ | decimal | 0 - 999 | Print QR code |
TSPL_PB | decimal | 0 - 999 | Print barcode |
TSPL_PR | decimal | 0 - 1 | Print offset |
TSPL_PN | decimal | 0 - 0 | Trigger printing |
TSPL_PS | decimal | 0 - 0 | Print status |
(1) Set paper size:
TSPL_SP0: width of paper, unit: mm.
TSPL_SP1: height of paper, unit: mm.
(2) Print text:
TSPL_PT can print up to 20 texts. TSPL_PT0-TSPL_PT99 is the first text; TSPL_PT100-TSPL_PT199 is the second text; … TSPL_PT1000-TSPL_PT1999 is the 20th text.
Detailed parameter settings of each text is shown as below table.for example,first text,TSPL_PT0-TSPL_PT99.
Register | Function | Description |
TSPL_PT0 | X coordinate | Unit: dot |
TSPL_PT1 | Y coordinate | Unit: dot |
TSPL_PT2 | Rotation angle | 0: 0 degrees 1: 90 degrees 2: 180 degrees 3: 270 degrees |
TSPL_PT3 | Size | Range: 0-3 |
TSPL_PT4 - TSPL_PT99 | QR code content(text content) | Use character input device to configure |
By analogy, we can know the text information configuration of the 2nd to 20th QR codes
(3) Print QR code:
TSPL_PQ can print up to 10 QR codes. TSPL_PQ0-TSPL_PQ99 is the first QR code; TSPL_PQ100-TSPL_PQ199 is the second QR code; ...., TSPL_PQ900-TSPL_PQ999 is the tenth QR code.
Specific parameter description of each item: for example, the first QR code, TSPL_PQ0-TSPL_PQ99:
Register | Function | Description |
TSPL_PQ0 | X coordinate | Unit: dot |
TSPL_PQ1 | Y coordinate | Unit: dot |
TSPL_PQ2 | Rotation angle | 0: 0 degrees 1: 90 degrees 2: 180 degrees 3: 270 degrees |
TSPL_PQ3 | Size | Range: 0-5 |
TSPL_PQ4 - TSPL_PQ99 | QR code content | Use character input device to configure |
By analogy, we can know the text information configuration of the 2nd to 20th QR codes.
(4) Print bar code:
TSPL_PB can print up to 10 barcodes. TSPL_PB0-TSPL_PB99 is the first bar code; TSPL_PB100-TSPL_PB199 is the second bar code; ..., TSPL_PB900-TSPL_PB999 is the tenth bar code.
Specific parameter description of each item: for example, the first barcode, TSPL_PB0-TSPL_PB99:
Register | Function | Description |
TSPL_PB0 | X coordinate | Unit: dot |
TSPL_PB1 | Y coordinate | Unit: dot |
TSPL_PB2 | Rotation angle | 0: 0 degrees 1: 90 degrees 2: 180 degrees 3: 270 degrees |
TSPL_PB3 | height | Unit: dot |
TSPL_PB4 | width | Range:0-2 |
TSPL_PB5- TSPL_PB99 | Bar code content | Use character input device to configure |
By analogy, we can know the text information configuration of the 2nd to 20th bar codes.
(5) Print offset:
TSPL_PR0: X coordinate offset, unit: mm;
TSPL_PR1: Y coordinate offset, unit: mm.
(6) Trigger printing:
TSPL_PN0 = 1: trigger the printer to start printing.
(7) Printing status:
TSPL_PS0 = 1: The printing is normal.
TSPL_PS0 = 1: The printing is abnormal.
4. Print picture
For the function of printing pictures, please refer to the configuration of [Printer object].
5. Conversion between dot and mm
Dot is the meaning of pixels. For the conversion between dot and mm, please refer to the printer manual or consult the customer service of the corresponding printer manufacturer. For example, SPRT TL21: 8 dots / mm, that is, 1mm = 8 dot.
Last updated