Printer
Printer
TSPL Label Printer
Introduction
TSPL label printer protocol supports following models.
- SPRT TL21: https://www.sprinter.com.cn/show-60-62-1.html
- DL-888D: https://www.deliworld.com/product/detail/7624
Setting Step
Select the protocol
- Create a new project, select the TSPL label printer protocol as shown below.
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.
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 |
- Set paper size:
- TSPL_SP0: width of paper, unit: mm.
- TSPL_SP1: height of paper, unit: mm.
- 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 | Ycoordinate | 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
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 | Ycoordinate | 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.
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 | Ycoordinate | 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.
Print offset:
- TSPL_PR0: X coordinate offset, unit: mm;
- TSPL_PR1: Y coordinate offset, unit: mm.
Trigger printing:
- TSPL_PN0 = 1: trigger the printer to start printing.
Printing status:
- TSPL_PS0 = 1: The printing is normal.
- TSPL_PS0 = 1: The printing is abnormal.
Print picture
- For the function of printing pictures, please refer to the configuration of [Printer object].
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.
EpsonTM Series
HMI Settings
Item | Settings | Note |
Protocol | EPSON-TM-T82II/TM-XXX | |
Connection | RS232 | |
Baud rate | 9600~115200 | |
Data bit | 8 | |
Parity | None | |
Stop bit | 1 | |
PLC station No. | 1 |
Each printer protocol has default parameter. These parameters could be configured by addresses. Error parameters may cause print failure.
Printer Settings
Address | Description | Value |
HSW10603 | Print direction (only valid for print function) | 1 |
HSW10604 | Dot Matrix Type | 1 |
HSW10605 | Print width (depending on printer and paper) | 384 |
HSW10606 | Printer instruction type | 1 |
HSW10607 | Paper cut | 2 |
HSW10608 | Alignment (only valid for print function) | 1 |
Cable Wiring
✎Note: COM3 only available in PI8000/PI9000 series.