TSPL2
TAIWAN SEMICONDUCTOR BAR CODE
PRINTER SERIES
PROGRAMMING
MANUAL
Revise History
Date
Description
2003/09/19 1. BASIC functions are added to TSPL2
2. Supported code page update
2004/5/21 QR code is supported
2004/9/7 Modify PDF417 example
2004/9/21 Page 49, DOWNLOAD commend.
Add procedures to disable “AUTO.BAS” auto
execution.
Remark
Michelle Su
Michelle Su
Michelle Su
TABLE OF CONTENTS
DOCUMENT CONVENTIONS ............................................................ I
SETUP AND SYSTEM COMMANDS ........................................................................ 1
SIZE ........................................................................................................................... 1
BLINE ........................................................................................................................ 5
OFFSET ..................................................................................................................... 7
SPEED....................................................................................................................... 8
DENSITY.................................................................................................................... 9
DIRECTION AND MIRROR IMAGE......................................................................... 10
REFERENCE ........................................................................................................... 11
COUNTRY ............................................................................................................... 12
CODEPAGE............................................................................................................. 13
CLS.......................................................................................................................... 14
FEED........................................................................................................................ 15
BACKFEED ............................................................................................................. 16
FORMFEED ............................................................................................................. 17
HOME ...................................................................................................................... 18
PRINT ...................................................................................................................... 19
CUT.......................................................................................................................... 20
CUT.......................................................................................................................... 21
LIMITFEED .............................................................................................................. 22
SELFTEST............................................................................................................... 23
CONFIG ................................................................................................................... 24
LABEL FORMATTING COMMANDS...................................................................... 25
BAR ......................................................................................................................... 25
BARCODE ............................................................................................................... 26
BITMAP ................................................................................................................... 30
BOX ......................................................................................................................... 32
DMATRIX................................................................................................................. 33
ERASE..................................................................................................................... 34
MAXICODE.............................................................................................................. 35
PDF417.................................................................................................................... 37
PUTBMP .................................................................................................................. 41
PUTPCX................................................................................................................... 42
QRCODE ................................................................................................................. 43
REVERSE ................................................................................................................ 47
TEXT........................................................................................................................ 48
STATUS POLLING COMMANDS (RS-232) ............................................................ 49
!? .................................................................................................................. 49
!R.................................................................................................................. 50
~!@ .......................................................................................................................... 51
~!A ........................................................................................................................... 52
~!C ........................................................................................................................... 53
~!D ........................................................................................................................... 54
~!F............................................................................................................................ 55
~!I............................................................................................................................. 56
~!T............................................................................................................................ 57
MESSAGE TRANSLATION PROTOCOLS ............................................................. 58
~# ............................................................................................................................. 58
COMMANDS FOR WINDOWS DRIVER.................................................................. 59
!B ............................................................................................................................. 59
!J.............................................................................................................................. 60
!N ............................................................................................................................. 61
FILE MANAGEMENT COMMANDS........................................................................ 62
DOWNLOAD............................................................................................................ 62
EOP.......................................................................................................................... 65
FILES....................................................................................................................... 66
KILL ......................................................................................................................... 67
MOVE....................................................................................................................... 68
RUN ......................................................................................................................... 69
BASIC COMMANDS AND FUNCTIONS................................................................. 70
ABS( ) ...................................................................................................................... 70
ASC( ) ...................................................................................................................... 71
CHR$( ).................................................................................................................... 72
END.......................................................................................................................... 73
EOF( ) ...................................................................................................................... 74
OPEN....................................................................................................................... 75
READ....................................................................................................................... 77
SEEK ....................................................................................................................... 79
LOF( )....................................................................................................................... 80
FREAD$( ) ............................................................................................................... 81
FOR…NEXT ............................................................................................................ 82
IF…THEN…ELSE…ENDIF ..................................................................................... 83
GOSUB…RETURN.................................................................................................. 87
GOTO....................................................................................................................... 88
INP$( )...................................................................................................................... 89
INPUT ...................................................................................................................... 90
REM ......................................................................................................................... 91
OUT.......................................................................................................................... 92
GETKEY( ) ............................................................................................................... 93
INT( )........................................................................................................................ 94
LEFT$( )................................................................................................................... 95
LEN( )....................................................................................................................... 96
MID$( ) ..................................................................................................................... 97
RIGHT$( )................................................................................................................. 98
STR$( )..................................................................................................................... 99
VAL( )..................................................................................................................... 100
BEEP ..................................................................................................................... 101
DEVICE RECONFIGURATION COMMANDS ....................................................... 102
SET COUNTER ..................................................................................................... 102
SET CUTTER......................................................................................................... 103
SET PARTIAL_CUTTER ....................................................................................... 104
SET BACK............................................................................................................. 105
SET KEY1, SET KEY2, SET KEY3 ....................................................................... 106
SET LED1, SET LED2, SET LED3........................................................................ 108
SET PEEL.............................................................................................................. 109
SET TEAR ............................................................................................................. 110
SET GAP ............................................................................................................... 111
SET HEAD ............................................................................................................. 113
SET RIBBON ......................................................................................................... 114
SET COM1............................................................................................................. 115
SET PRINTKEY ..................................................................................................... 116
SET REPRINT ....................................................................................................... 118
PEEL...................................................................................................................... 119
LED1, LED2, LED3................................................................................................ 121
KEY1, KEY2, KEY3 ............................................................................................... 122
PRINTER GLOBAL VARIABLES.......................................................................... 123
@LABEL................................................................................................................ 123
YEAR ..................................................................................................................... 124
MONTH.................................................................................................................. 125
DATE ..................................................................................................................... 126
WEEK .................................................................................................................... 127
HOUR..................................................................................................................... 128
MINUTE ................................................................................................................. 129
SECOND................................................................................................................ 130
@YEAR.................................................................................................................. 131
@MONTH............................................................................................................... 132
@DATE.................................................................................................................. 133
@DAY .................................................................................................................... 134
@HOUR ................................................................................................................. 135
@MINUTE.............................................................................................................. 136
@SECOND ............................................................................................................ 137
Document Conventions
This manual uses the following typographic conventions.
Convention
[expression list]
Description
Items inside square brackets are optional, expression
maximum length 2*1024 bytes;
~
Space
“
CR,LF
NULL
Note:
200 DPI: 1 mm = 8 dots
ESCAPE (ASCII 27), control code of status
polling command, which returns the printer
status immediately, no matter the printer is
ready or not.
(ASCII 126), control code of status polling
command, which returns the printer status
only when the printer is ready.
(ASCII 32) characters will be ignored in the
command line.
(ASCII 34), beginning and ending of expression
(ASCII 13),(ASCII 10) is placed at the
end of command line.
(ASCII 0) is not supported in the expression,
except the 2D bar code commands.
Arial font in bold and italic type is used for
note.
TAIWAN SEMICONDUCTOR CO., LTD. I Copyright 2001 All Rights Reserved.
Setup and System Commands
SIZE
Description
This command defines the label width and length.
Syntax
(1) English system (inch)
SIZE m, n
(2) Metric system (mm)
SIZE m mm, n mm
Parameter
m
n
Description
Label width (inch or mm)
Label length (inch or mm)
Note:
200 DPI: 1 mm = 8 dots
300 DPI: 1mm = 12 dots
For metric system, there must be a space between parameter and
“mm”.
102mm 104mm 106mm 108mm
Max. width
TTP-2410M
TTP-248M
TTP-246M
TTP-246G
TTP-344M
TTP-245
TDP-245
TTP-245G
TDP-245G
TTP-343
X
X
x
x
x
x
x
x
x
x
Example
(1) English system (inch)
SIZE 3.5, 3.00
(2) Metric system (mm)
SIZE 100 mm, 100 mm
TAIWAN SEMICONDUCTOR CO., LTD. 1 Copyright 2001 All Rights Reserved.
See Also
GAP, BLINE
TAIWAN SEMICONDUCTOR CO., LTD. 2 Copyright 2001 All Rights Reserved.