TSPL TSPL2 Programming
TSPL TSPL2 Programming
PROGRAMMING MANUAL
Update History
Date
2007/07/13
2007/12/25
2008/04/10
2009/01/17
2009/05/18
2009/06/24
2010/07/06
2010/10/25
2011/01/06
2011/01/06
2011/01/06
2011/01/10
2011/01/10
2011/01/10
2011/01/10
2011/01/10
2011/01/10
2011/01/10
2010/01/10
2010/01/10
2011/01/25
2011/03/04
2011/03/04
2011/12/09
2012/11/20
2012/11/20
2012/11/20
2012/11/20
2012/11/20
2012/11/20
2012/11/20
2012/11/20
2012/11/20
2012/11/20
2012/11/21
2012/11/21
2012/11/21
2012/11/21
2012/11/21
2012/11/21
2012/11/21
2012/11/22
2012/11/22
2012/11/23
2012/11/23
2012/11/23
2012/11/23
2012/11/23
2012/11/26
2012/11/26
2012/11/26
2012/11/26
2012/11/26
2012/11/26
2012/11/26
2012/11/26
2012/11/26
2012/11/26
2012/11/26
2012/11/26
2012/11/27
Content
Revise some typos
Revise FREAD$() example
Add update history list
Add GAPDETECT command
Add CIRCLE command
Add RSS command
Revise bar command section
Revise some sections
Add CODE 11 barcode
Add AZTEC barcode
Revise sensor intension table in SET GAP command
Add BLINEDETECT command
Add AUTODETECT command
Add BASIC function FORMAT$()
Add BASIC function NOW$()
Add BASIC function TRIM$()
Add BASIC function LTRIM$()
Add BASIC function RTRIM$()
Add BASIC function STRCOMP()
Add BASIC function INSTR()
Modify TSC address
Revise, TTP-248M doesn't support mirror function
Add sensor range of TTP-225/ TDP-225 in command SET GAP
Add some command spec in RSS barcode.
Add command SET USBHOST KEYBOARD/SCANNER
Revise STRCOMP() example
Revise TRIM$(), LTRIM$(), RTRIM$() example.
Add <ESC>!P command.
Add <ESC>!O command.
Revise OUT command.
Add SET BLINE command.
Add ELLIPSE command.
Add SET RIBBONEND command.
Add SET ENCODER command.
Revise TEXT command.
Revise speed table of SPEED command.
Revise AZTEC command.
Add BLOCK command.
Add PUT command.
Add GET command.
Add INP() command.
Revise PUTBMP command. Support grayscale printing in direct thermal printing.
Revise BARCODE command. New support barcode TELEPEN, TELEPENN, PLANET, CODE49, DPI, DPL.
Add TLC39 barcode.
Add CODABLOCK command (F mode only).
Add SELFTEST PATTERN command.
Revise the supported CODEPAGE table and example.
Add global variable NOW.
Add DATEADD() command.
Add SET AUTORUN command.
Add LOC() command.
Add NOW$() command.
Revise SET RIBBON command.
Revise SET COUNTER command.
Add <ESC>!C command.
Add <ESC>!Q command.
Add <ESC>!S command.
Add OUTR command.
Add <ESC>!D command.
Add ~!E command.
Add LOB() command.
Editor
Phil
Camille
Camille
Ken
Phil
Phil
Camille
Camille
Ernest
Ernest
Ernest
Ernest
Ernest
Ernest
Ernest
Ernest
Ernest
Ernest
Ernest
Ernest
Camille
Ernest
Ernest
Ernest
Ernest
Ernest
Ernest
Ernest
Ernest
Ernest
Ernest
Ernest
Ernest
Ernest
Ernest
Ernest
Ernest
Ernest
Ernest
Ernest
Ernest
Ernest
Ernest
Ernest
Ernest
Ernest
Ernest
Ernest
Ernest
Ernest
Ernest
Ernest
Ernest
Ernest
Ernest
Ernest
Ernest
Ernest
Ernest
Ernest
Ernest
2012/11/27
2012/11/27
2012/11/27
2012/11/27
2012/11/27
2012/11/27
2012/11/28
2012/11/28
2012/11/28
2012/11/28
2012/11/28
2012/11/28
2012/11/30
2012/11/30
2012/11/30
2012/11/30
2012/11/30
2012/11/30
2012/11/30
2012/11/30
2012/11/30
2012/11/30
2012/12/20
2012/12/20
2012/12/24
2012/12/24
2012/12/24
2013/2/5
2013/2/6
2013/2/26
2013/2/26
2013/6/25
2013/12/13
2014/1/22
Ernest
Ernest
Ernest
Ernest
Ernest
Ernest
Ernest
Ernest
Ernest
Ernest
Ernest
Ernest
Ernest
Ernest
Ernest
Ernest
Ernest
Ernest
Ernest
Ernest
Ernest
Ernest
Ernest
Ernest
Ernest
Ernest
Camille
Camille
Camille
Camille
Camille
Camille
Camille
Camille
TABLE OF CONTENTS
How to Ready ......................................................................................................................................... V
Document Conventions.......................................................................................................................... VI
Object Position Calculation ................................................................................................................... VII
Printer Model List .................................................................................................................................. IX
Setup and System Commands ................................................................................................................. 1
SIZE....................................................................................................................................................... 1
GAP ...................................................................................................................................................... 2
GAPDETECT .......................................................................................................................................... 4
BLINEDETECT........................................................................................................................................ 5
AUTODETECT ........................................................................................................................................ 6
BLINE .................................................................................................................................................... 7
OFFSET ................................................................................................................................................. 8
SPEED ................................................................................................................................................... 9
DENSITY.............................................................................................................................................. 10
DIRECTION AND MIRROR IMAGE ............................................................................................................. 11
REFERENCE ......................................................................................................................................... 13
SHIFT .................................................................................................................................................. 14
COUNTRY ........................................................................................................................................... 16
CODEPAGE .......................................................................................................................................... 17
CLS...................................................................................................................................................... 19
FEED ................................................................................................................................................... 20
BACKFEED & BACKUP ......................................................................................................................... 21
FORMFEED ......................................................................................................................................... 23
HOME ................................................................................................................................................. 24
PRINT ................................................................................................................................................. 25
SOUND ............................................................................................................................................... 26
CUT..................................................................................................................................................... 27
LIMITFEED .......................................................................................................................................... 28
SELFTEST ............................................................................................................................................ 29
EOJ ..................................................................................................................................................... 31
DELAY ................................................................................................................................................. 32
DISPLAY .............................................................................................................................................. 33
INITIALPRINTER .................................................................................................................................. 34
TEXT ................................................................................................................................................... 73
BLOCK ................................................................................................................................................. 76
II
PEEL.................................................................................................................................................. 205
LED1, LED2, LED3.............................................................................................................................. 206
KEY1, KEY2, KEY3 .............................................................................................................................. 208
IV
How to Ready
The command name
Document Conventions
This manual uses the following typographic conventions.
Convention
Description
[expression list]
Items inside square brackets are optional, expression maximum length 2*1024
bytes.
ASCII 27, control code of status polling command returns/runs the printer
status immediately.
ASCII 126, control code of status polling command 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, denotes end of command line.
ASCII 0, supported in the expression.
The font in bold and italic type is used for note.
<ESC>
~
Space
"
CR, LF
NULL
Note:
203 DPI: 1 mm = 8 dots
VI
X=7mm
Y=3mm
X
DIRECTION 0
CLS
TEXT 56,24,"3",0,1,1,"ABC"
PRINT 1
Note :
1. 203 DPI, 1mm=8 dots ; 300 DPI, 1mm=11.8 dots
2. Only integer portion will be used. Ex. 2 mm = 23.6 dots then 23 dots will be used.
VII
X=7mm
DIRECTION 1
Y=3mm
DIRECTION 1
CLS
TEXT 56,24,"3",0,1,1,"ABC"
PRINT 1
VIII
Models
M23
TDP-643 Plus
TTP-243, TTP-243E, TTP-342
TTP-243M, TTP-244ME, TTP-342M
TTP-245, TTP-245G, TTP-343, TDP-245, TDP-245G
TTP-246M, TTP-246G, TTP-344M
TTP-248M
TDP-643R Plus
TTP-243 Plus, TTP-243E Plus, TTP-342 Plus
TTP-244ME Plus, TTP-342M Plus
TTP-244
Alpha-3R
TTP-243 Pro, TTP-243E Pro, TTP-342 Pro
TTP-244ME Pro, TTP-342M Pro
TTP-245 Plus, TTP-343 Plus, TDP-245 Plus
F/W maintainability
No
No
No
No
No
No
No
No
No
No
No
Yes
Yes
Yes
Yes
TTP-244 Plus
TTp-245C, TTP-343C, TTP-244CE
TTP-247, TTP-345, TDP-244, TDP-247, TDP-345
TTP-225, TTP-323, TDP-225, TDP-225W
TA200, TA300
TTP-2410M, TTP-346M, TTP-644M
TTP-246M Plus, TTP-344M Plus
TTP-384M
TTP-268M, TTP-366M
TTP-2410M Pro, TTP-346M Pro, TTP-644M Pro
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
IX
Syntax
SIZE m,n
SIZE m mm,n mm
SIZE m dot,n dot
Parameter
M
N
Description
Label width (inch/ mm/ dot)
Label length (inch/ mm/ dot)
Note :
For metric and dot systems, there must be a space between parameter and mm or dot.
Example
Sample Code
Result
See Also
GAP, BLINE
GAP
Description
Defines the gap distance between two labels.
Syntax
GAP m,n
GAP m mm,n mm
GAP m dot,n dot
Parameter
M
N
0, 0
Description
The gap distance between two labels
0 m 1 (inch), 0 m 25.4 (mm)
0 m 5 (inch), 0 m 127 (mm) / since V6.21 EZ and later firmware
The offset distance of the gap
n label length (inch or mm)
Continuous label
Note :
For metric and dot systems, there must be a space between parameter and mm.
When the sensor type is changed from Black Mark to GAP, please send the GAP
command to the printer first.
Example
Sample Code
Normal gap
Continuous label:
GAP 0,0
Result
Normal gap
Special gap
Special gap
See Also
SIZE, BLINE
GAPDETECT
Description
This command feeds the paper through the gap sensor in an effort to determine the paper and gap
sizes, respectively. This command references the users approximate measurements. If the
measurements conflict with the actual size, the GAPDETECT command will not work properly. This
calibration method can be applied to the labels with pre-printed logos or texts.
Syntax
GAPDETECT [x,y]
Parameter
X
Y
Description
Paper length (in dots)
Gap length (in dots)
Note:
If the x, y parameters are ignored then the printer will calibrate and determine the paper length
and gap size automatically.
See Also
GAP, SIZE, BLINEDETECT, AUTODETECT
BLINEDETECT
Description
This command feeds the paper through the black mark sensor in an effort to determine the paper and
black mark sizes, respectively. This command references the users approximate measurements. If the
measurements conflict with the actual size, the BLINEDETECT command will not work properly. This
calibration method can be applied to the labels with pre-printed logos or texts.
Syntax
BLINEDETECT [x,y]
Parameter
x
y
Description
Paper length (in dots)
Gap length (in dots)
Note:
If the x, y parameters are ignored then the printer will calibrate and determine the paper length
and gap size automatically.
See Also
GAP, SIZE, GAPDETECT, AUTODETECT
AUTODETECT
Description
This command feeds the paper through the gap/black mark sensor in an effort to determine the paper
and gap/black mark sizes, respectively. This command references the users approximate
measurements. If the measurements conflict with the actual size, the AUTODETECT command will not
work properly. This calibration method can be applied to the labels with pre-printed logos or texts.
Syntax
AUTODETECT [x,y]
Parameter
x
y
Description
Paper length (in dots)
Gap length (in dots)
Note:
If the x, y parameters are ignored then the printer will calibrate and determine the paper
length and gap/black mark size automatically.
When using this command, the printer will detect the label by the proper sensor type so
please dont set the command GAP or BLINE in your program.
See Also
GAP, SIZE, GAPDETECT, BLINEDETECT
BLINE
Description
This command sets the height of the black line and the user-defined extra label feeding length each
form feed takes.
Syntax
BLINE m,n
BLINE m mm,n mm
BLINE m dot,n dot
Parameter
m
n
0,0
Description
The height of black line either in inch or mm
0 m 1 (inch), 0 m 25.4 (mm)
0 m 5 (inch), 0 m 127 (mm) / since V6.21 EZ and later firmware
The extra label feeding length
0 n label length
Continuous label
Note:
For metric system, there must be a space between parameter and mm.
When the sensor type is changed from GAP to Black Mark, please send the BLINE
command to the printer first.
Example
Sample Code
See Also
SIZE, GAP
TSC AUTO ID Technology Co., Ltd.
OFFSET
Description
This command defines the selective, extra label feeding length each form feed takes, which, especially
in peel-off mode and cutter mode, is used to adjust label stop position, so as for label to register at
proper places for the intended purposes. The printer back tracks the extra feeding length before the
next run of printing.
Syntax
OFFSET m
OFFSET m mm
OFFSET m dot,n dot
Parameter
m
Description
The offset distance (inch or mm)
-1 m 1 (inch)
CAUTION:
Impropriety offset value may cause paper jam.
For metric system, there must be a space between parameter and mm.
200 DPI : 1 mm = 8 dots
300 DPI : 1mm = 12 dots
Example
Sample Code
See Also
SIZE, GAP, SET PEEL, SET CUTTER
SPEED
Description
This command defines the print speed.
Syntax
SPEED n
Parameter
n
Description
Printing speed in inch per second
Model / IPS
TTP-243 series
TTP-243 Plus series
TTP-244ME series
TTP-244ME Plus series
TTP-244 series
TTP-244CE series
TTP-245 series
TTP-245C series
TDP-245 series
TTP-246M series
TTP-246M Plus series
TTP-248M series
TTP-2410M series
TDP-643 Plus series
TDP-643R Plus series
TTP-342 series
TTP-342 Plus series
TTP-342M series
TTP-342M Plus series
TTP-343 series
TTP-343C series
TTP-344M series
TTP-344M Plus series
TTP-346M series
TTP-384M series
TTP-644M series
M23 series
TDP-225 series
TTP-225 series
1.5
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
2
V
V
V
V
V
V
V
V
V
V
V
2.5
V
V
V
V
V
V
V
V
V
V
3
V
V
V
V
V
V
V
V
V
V
V
3.5
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
10
12
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
Example
Sample code
SPEED 10
See Also
DENSITY
DENSITY
Description
This command sets the printing darkness.
Syntax
DENSITY n
Parameter
n
Description
0~15
0: specifies the lightest level
15: specifies the darkest level
Note:
Default DENSITY setting is 8.
Example
Sample code
DENSITY 7
10
Syntax
DIRECTION n[,m]
Parameter
n
m
Description
0 or 1. Please refer to the illustrations below
0: Print normal image
1: Print mirror image
Support
Model
DIRECTION
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
TTP-243 series
TTP-243 Plus series
TTP-244ME series
TTP-244ME Plus series
TTP-244 series
TTP-244CE series
TTP-245 series
TTP-245C series
TDP-245 series
TTP-246M series
TTP-248M series
TTP-2410M series
TDP-643 Plus series
TDP-643R Plus series
TTP-342 series
TTP-342 Plus series
TTP-342M series
TTP-342M Plus series
11
MIRROR
V
V
V
V
V
V
V
V
V
V
V
V
TTP-343 series
TTP-343C series
TTP-344M series
TTP-346M series
TTP-384M series
TTP-644M series
M23 series
V
V
V
V
V
V
V
V
V
V
V
V
V
V
Example
Sample code
DIRECTION 0
DIRECTION 0,1
See Also
REFERENCE
12
REFERENCE
Description
This command defines the reference point of the label. The reference (origin) point varies with the
print direction, as shown:
Syntax
REFERENCE x, y
Parameter
x
y
Description
Horizontal coordinate (in dots)
Vertical coordinate (in dots)
Note:
200 DPI: 1 mm = 8 dots
300 DPI: 1 mm = 12 dots
Example
Sample code
REFERENCE 10,10
See Also
DIRECTION
13
SHIFT
Description
This command moves the labels vertical position. A positive value moves the label further from the
printing direction; a negative value moves the label towards the printing direction. For a visual
representation, see next page.
Syntax
SHIFT n
Parameter
n
Description
The maximum value is 1 inch. For 200 dpi printers, the range is 203 to 203; for
300 dpi printers, the range is 300 to 300. The unit is dot.
Model
TTP-243 series
TTP-243 Plus series
TTP-244ME series
TTP-244ME Plus series
TTP-244 series
TTP-244CE series
TTP-245 series
TTP-245C series
TDP-245 series
TTP-246M series
TTP-248M series
TTP-2410M series
TDP-643 Plus series
TDP-643R Plus series
TTP-342 series
TTP-342 Plus series
TTP-342M series
TTP-342M Plus series
TTP-343 series
TTP-343C series
TTP-344M series
TTP-346M series
TTP-384M series
TTP-644M series
M23 series
Support
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
14
Example
Sample Code
SIZE 4,2.5
GAP 2 mm,0
DIRECTION 0
SHIFT 36
OFFSET 0
CLS
TEXT 400,200,"3",0,1,1,"DIRECTION 0"
TEXT 400,250,"3",0,1,1,"SHIFT 36"
BOX 10,0,780,490,8
PRINT 3,1
Result
See Also
OFFSET, REFERENCE
15
COUNTRY
Description
This command orients the keyboard for use in different countries via defining special characters on the
KP-200 series portable LCD keyboard (option).
Syntax
COUNTRY n
Parameter
n
Description
001: USA
002: Canadian-French
003: Spanish (Latin America)
031: Dutch
032: Belgian
033: French (France)
034: Spanish (Spain)
036: Hungarian
038: Yugoslavian
039: Italian
041: Switzerland
042: Slovak
044: United Kingdom
045: Danish
046: Swedish
047: Norwegian
048: Polish
049: German
055: Brazil
061: English (International)
351: Portuguese
358: Finnish
Example
Sample Code
COUNTRY 001
See Also
CODEPAGE, ~!I
16
CODEPAGE
Description
This command defines the code page of international character set.
Syntax
CODEPAGE n
Parameter
n
Description
Name or number of code page, which can be divided into 7-bit code
page and 8-bit code page.
8-bit code page
n
Name
437 United States
737 Greek
850 Multilingual
851 Greek 1
852 Slavic
855 Cyrillic
857 Turkish
860 Portuguese
861 Icelandic
862 Hebrew
863
Canadian/French
864
865
Arabic
Nordic
866
869
Russian
Greek 2
Latin 9
Note:
DATA LENGTH determines 7-bit or 8-bit communications parameter.
Example
Download the COUR.TTF into printer by DiagTool
17
Sample Code
Result
DOWNLOAD "TEST.BAS"
str1$ = ""
J=0
y = 50
CODEPAGE 1252
SIZE 4,3
GAP 0,0
DIRECTION 1
CLS
TEXT 10,10,"COUR.TTF",0,12,12,"CODEPAGE 1252"
FOR I=32 TO 255
str1$=str1$+CHR$(I) + " "
J=J+1
IF J=16 THEN GOSUB drawTEXT
NEXT
PRINT 1
END
drawTEXT:
TEXT 10,y,"COUR.TTF",0,12,12,str1$
str1$=""
J=0
y=y+40
RETURN
EOP
TEST
See Also
COUNTRY, ~!I
18
CLS
Description
This command clears the image buffer.
Syntax
CLS
Parameter
None
Description
N/A
Note:
This command must be placed after SIZE command.
Example
Sample code
CLS
See Also
SIZE, GAP, BLINE
19
FEED
Description
This command feeds label with the specified length. The length is specified by dot.
Syntax
FEED n
Parameter
n
Description
unit: dot
1 n 9999
Note:
200 DPI: 1 mm = 8 dots
300 DPI: 1 mm = 12 dots
Example
Sample code
FEED 40
See Also
BACKFEED, SIZE, GAP, BLINE, HOME, FORMFEED
20
Syntax
BACKUP n
BACKFEED n
Parameter
n
Model
BACKUP
V
V
V
V
V
TTP-243 series
TTP-243 Plus series
TTP-244ME series
TTP-244ME Plus series
TTP-244 series
TTP-244CE series
TTP-245 series
TTP-245C series
TDP-245 series
TTP-246M series
TTP-248M series
TTP-2410M series
TDP-643 Plus series
TDP-643R Plus series
TTP-342 series
TTP-342 Plus series
TTP-342M series
TTP-342M Plus series
TTP-343 series
TTP-343C series
TTP-344M series
TTP-346M series
TTP-384M series
TTP-644M series
M23 series
BACKFEED
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
Note:
200 DPI: 1 mm = 8 dots
300 DPI: 1 mm = 12 dots
CAUTION:
Impropriety back feed value may cause paper jam or wrinkle.
Example
Sample code
TSPL printers
BACKUP 40
TSPL2 printers
BACKFEED 40
TSC AUTO ID Technology Co., Ltd.
21
See Also
FEED, SIZE, GAP, BLINE, HOME, FORMFEED
22
FORMFEED
Description
This command feeds label to the beginning of next label.
Syntax
FORMFEED
Parameter
None
Description
N/A
Note:
This command must be placed after SIZE command.
Example
Sample code
Result
SIZE 4,2.5
GAP 2 mm,0
DIRECTION 1
FORMFEED
CLS
TEXT 25,25,"3",0,1,1,"FORMFEED COMMAND TEST"
PRINT 1,1
See Also
FEED, SIZE, GAP, BLINE, HOME, BACKFEED
23
HOME
Description
This command will feed label until the internal sensor has determined the origin. Size and gap of the
label should be defined before using this command.
Syntax
HOME
Parameter
None
Description
N/A
HOME
Model
Back Label
V
TTP-243 series
TTP-243 Plus series
TTP-244ME series
TTP-244ME Plus series
TTP-244 series
TTP-244CE series
TTP-245 series
TTP-245C series
TDP-245 series
TTP-246M series
TTP-248M series
TTP-2410M series
TDP-643 Plus series
TDP-643R Plus series
TTP-342 series
TTP-342 Plus series
TTP-342M series
TTP-342M Plus series
TTP-343 series
TTP-343C series
TTP-344M series
TTP-346M series
TTP-384M series
TTP-644M series
M23 series
Feed Label
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
Example
Sample code
SIZE 4,2.5
GAP 2 mm,0
SET COUNTER @0+1
@0="000001"
HOME
CLS
BOX 1,1,360,65,12
TEXT 25,25,"3",0,1,1,"HOME COMMAND TEST"
TEXT 25,80,"3",0,1,1,@0
PRINT 3,1
See Also
FEED, SIZE, GAP, BLINE, FORMFEED
TSC AUTO ID Technology Co., Ltd.
24
PRINT
Description
This command prints the label format currently stored in the image buffer.
Syntax
PRINT m[,n]
Parameter
m
Description
Specifies how many sets of labels will be printed.
1 m 999999999
Specifies how many copies should be printed for each particular label set.
1 n 999999999
Example
Sample code
Result
SIZE 50 mm,25 mm
GAP 3 mm,0
DIRECTION 1
SET COUNTER @1 1
@1="0001"
CLS
TEXT 10,10,"3",0,1,1,@1
PRINT 3,2
1 set, 2 copies
See Also
SET COUNTER, INPUT, DOWNLOAD
TSC AUTO ID Technology Co., Ltd.
25
SOUND
Description
This command controls the sound frequency of the beeper. There are 10 levels of sounds. The timing
control can be set by the "interval" parameter.
Syntax
SOUND level,interval
Parameter
level
interval
Description
Sound level: 0~9
Sound interval: 1~4095
Example
Sample code
SOUND 5,200
SOUND 3,200
SOUND 3,200
SOUND 4,200
SOUND 2,200
SOUND 2,200
SOUND 1,200
SOUND 2,200
SOUND 3,200
SOUND 4,200
SOUND 5,200
26
CUT
Description
This command activates the cutter to immediately cut the labels without back feeding the label.
Syntax
CUT
Parameter
None
Description
N/A
Example
Sample code
SIZE 3,3
GAP 0,0
CLS
BOX 0,0,866,866,5
TEXT 100,100,"5",0,1,1,"FEED & CUT"
TEXT 100,200,"5",0,1,1,"300 DPI"
PRINT 1,1
FEED 260
CUT
See Also
SET CUTTER, SET BACK, SET PARTITAL_CUTTER
27
LIMITFEED
Description
If the gap sensor is not set to a suitable sensitivity while feeding labels, the printer will not be able to
locate the correct position of the gap. This command stops label feeding and makes the red LED flash if
the printer does not locate gap after feeding the length of one label plus one preset value.
Syntax
LIMITFEED n[,minpaper,maxgap]
LIMITFEED n mm[,minpaper
mm,maxgap mm]
LIMITFEED n dot[,minpaper
dot,maxgap dot]
Parameter
N
Minpaper
Maxgap
Description
The maximum length for sensor detecting
The minimum length of paper
The maximum length of gap
Note:
For metric system, there must be a space between parameter n and mm.
Since V6.76 EZ, the default value for TDP-225 series printer is 14 inches when printer
initializes.
The setting of parameters mimpaper and maxgap are using for calibrating the
preprinted label. This parameter has been supported since V6.98.7 EZ.
Example
Sample code
28
SELFTEST
Description
At this command, the printer will print out the printer information.
Syntax
SELFTEST [page]
Parameter
page
Description
omitted: Print a self-test page with whole printer information.
PATTERN: Print a pattern to check the status of print head heat line.
ETHERNET: Print a self-test page with Ethernet settings.
WLAN: Print a self-test page with Wi-Fi settings.
RS232: Print a self-test page with RS-232 settings.
SYSTEM: Print a self-test page with printer settings.
Z: Print a self-test page with emulated language settings.
Example
Sample code
SELFTEST
Result
29
SELFTEST PATTERN
SELFTEST ETHERNET
SELFTEST WLAN
SELFTEST RS232
SELFTEST SYSTEM
SELFTEST PRINTER
SELFTEST Z
30
EOJ
Description
Let the printer wait until process of commands (before EOJ) be finished then go on the next command.
Syntax
EOJ
Note:
This command has been supported since V6.39 EZ and later firmware.
Example
Sample Code
SIZE 4,0.2
GAP 0,0
DIRECTION 1
CLS
TEXT 10,10,"3",0,1,1,"Two labels are printed without stop."
PRINT 1
PRINT 1
SIZE 4,0.2
GAP 0,0
CLS
TEXT 10,10,"3",0,1,1,"Printer stops before next printing."
PRINT 1
EOJ
PRINT 1
Result
Paper feed direction
without stop
31
DELAY
Description
Let the printer wait specific period of time then go on next command.
Syntax
DELAY ms
Parameter
ms
Description
The specific period of time. Unit is millisecond. 1000 ms = 1 second.
Note:
This command has been supported since V6.34 EZ and later firmware.
Example
Sample Code
SIZE 4,0.7
GAP 0,0
DIRECTION 1
CLS
TEXT 10,10,"3",0,1,1,"The delay time between two labels is 3 seconds."
TEXT 10,60,"3",0,1,1,"Now second:"+@SECOND
PRINT 1
DELAY 3000
PRINT 1
Result
32
DISPLAY
Description
This command can show the image, which is in printers image buffer, on LCD panel.
Syntax
DISPLAY IMAGE/OFF
Parameter
IMAGE
OFF
Description
Show the image in printers image buffer on LCD panel.
Disable this function.
Note:
This command has been supported since V6.39 EZ and later firmware.
This command only can be performed on the printer with LCD display.
Example
Sample code
Result
CLS
TEXT 1,10,"1",0,1,1,"Image on LCD"
TEXT 1,30,"1",0,1,1,"1234567890"
DISPLAY IMAGE
DELAY 5000
DISPLAY OFF
33
INITIALPRINTER
Description
This command can restore printer settings to defaults.
Syntax
INITIALPRINTER
Parameter
None
Description
N/A
Example
Sample code
INITIALPRINTER
34
Syntax
BAR x,y,width,height
Parameter
x
y
width
height
Description
The upper left corner x-coordinate (in dots)
The upper left corner y-coordinate (in dots)
Bar width (in dots)
Bar height (in dots)
Note:
Recommended max. bar height is 12 mm at 4 width. Bar height over 12 mm may damage
the power supply and affect the print quality.
Max. print ratio is different for each printer model. Desktop and industrial printer print
ratio is limited to 20% and 30% respectively.
Example
Sample code
Result
SIZE 50 mm,25 mm
GAP 3 mm,0
DIRECTION 1
CLS
BAR 80,80,300,100
PRINT 1,1
80
80
100
300
See Also
BOX
35
BARCODE
Description
This command prints 1D barcodes. The available barcodes are listed below:
Code Type
128
128M
EAN128
25
25C
39
39C
93
EAN13
EAN13+2
EAN13+5
EAN8
EAN8+2
EAN8+5
CODA
POST
UPCA
UPCA+2
UPA+5
UPCE
UPCE+2
UPE+5
MSI
MSIC
PLESSEY
CPOST
ITF14
EAN14
11
TELEPEN
TELEPENN
PLANET
CODE49
DPI
DPL
LOGMARS
Description
Code 128, switching code subset automatically.
Code 128, switching code subset manually.
EAN128, switching code subset automatically.
Interleaved 2 of 5.
Interleaved 2 of 5 with check digit.
Code 39, switching standard and full ASCII mode
automatically.
Code 39 with check digit.
Code 93.
EAN 13.
EAN 13 with 2 digits add-on.
EAN 13 with 5 digits add-on.
EAN 8.
EAN 8 with 2 digits add-on.
EAN 8 with 5 digits add-on.
Codabar.
Postnet.
UPC-A.
UPC-A with 2 digits add-on.
UPC-A with 5 digits add-on.
UPC-E.
UPC-E with 2 digits add-on.
UPC-E with 5 digits add-on.
MSI.
MSI with check digit.
PLESSEY.
China post.
ITF14.
EAN14.
Code 11.
Telepen. *Since V6.89EZ.
Telepen number. *Since V6.89EZ.
Planet. *Since V6.89EZ.
Code 49. *Since V6.89EZ.
Deutsche Post Identcode. *Since V6.91EZ.
Deutsche Post Leitcode. *Since V6.91EZ.
A special use of Code 39. *Since V6.88EZ.
36
1:1
V
V
V
Narrow : Width
1:2
1:3
2:5
V
V
V
V
V
V
V
V
3:7
Length is even
Length is odd
V
V
V
V
V
V
12
14
17
7
9
12
V
V
V
V
V
V
V
V
5, 9, 11
11
13
16
6
8
11
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
13
13
V
V
11
13
Syntax
BARCODE X,Y,"code type",height,human readable,rotation,narrow,wide,[alignment,]"content "
Parameter
X
Y
code type
Description
Specify the x-coordinate bar code on the label
Specify the y-coordinate bar code on the label
128
128M
EAN128
25
Interleaved 2 of 5
25C
39
39S
93
Code 93
EAN13
EAN 13
EAN13+2
EAN13+5
EAN8
EAN 8
EAN8+2
EAN8+5
CODA
Codabar
POST
Postnet
UPCA
UPC-A
UPCA+2
UPCA+5
UPCE
UPC-E
UPCE+2
UPCE+5
CPOST
MSI
MSI code
MSIC
PLESSEY
PLESSEY code
ITF14
ITF 14 code
EAN14
EAN 14 code
11
Code 11
39C
37
TELEPEN
Telepen code
TELEPENN
PLANET
Planet code
CODE49
Code 49
DPI
DPL
height
human readable
rotation
narrow
wide
narrow : wide narrow : wide narrow : wide narrow : wide narrow : wide
1:1
1:2
1:3
2:5
3:7
10x
10x
10x
10x
5x
10x
10x
5x
10x
10x
5x
10x
10x
5x
10x
8x
8x
8x
8x
8x
8x
10x
10x
5x
1x
8x
8x
8x
8x
8x
8x
1x
10x
10x
10x
10x
10x
5x
8x
10x
10x
5x
-
alignment
content
Content of barcode
Please note that the maximum number of digits of bar code content.
38
Character sets
Code Type
128
128M
EAN128
25
25C
39 (C)
39 (C) Full ASCII
93
EAN13
EAN13+2
EAN13+5
EAN8
EAN8+2
EAN8+5
CODA
POST
UPCA
UPCA+2
UPA+5
UPCE
UPCE+2
UPE+5
MSI
MSIC
PLESSEY
CPOST
ITF14
EAN14
11
TELEPEN
TELEPENN
PLANET
CODE49
DPI
DPL
LOGMARS
Max. data
length
Length is even.
Length is odd.
-
12
14
17
7
9
12
5, 9, 11
11
13
16
6
8
11
13
13
30
60
38
81
11
13
-
Note:
Since V5.10EZ, \[R] means carriage return character 0x0D and \[L] means line feed character
0x0A.
39
Supported table
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
11
EAN14
ITF14
PLESSY
MSIC
MSI
CPOST
UPCE+5
UPCE+2
UPCE
UPCA+5
UPCA+2
UPCA
POST
CODA
EAN 8+5
EAN 8+2
EAN 8
EAN13+5
EAN13+2
EAN13
93
TTP-243 series
TTP-243 Plus series
TTP-244ME series
TTP-244ME Plus series
TTP-244 series
TTP-244CE series
TTP-245 series
TTP-245C series
TDP-245 series
TTP-246M series
TTP-248M series
TTP-2410M series
TDP-643 Plus series
TDP-643R Plus series
TTP-342 series
TTP-342 Plus series
TTP-342M series
TTP-342M Plus series
TTP-343 series
TTP-343C series
TTP-344M series
TTP-346M series
TTP-384M series
TTP-644M series
M23 series
39S
39C for PLUS
39C for TSPL
Model
39C for
TSPL2
39 for PLUS
39 for TSPL
39 for TSPL2
25C
25
EAN128
128
Barcode Type
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
128A
space
!
"
#
$
%
&
'
(
)
*
+
,
.
/
0
1
2
3
4
5
6
7
8
9
:
;
<
=
>
?
@
A
B
C
128B
space
!
"
#
$
%
&
'
(
)
*
+
,
.
/
0
1
2
3
4
5
6
7
8
9
:
;
<
=
>
?
@
A
B
C
128C
00
01
02
03
04
05
06
07
08
09
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
Value
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
128A
D
E
F
G
H
I
J
K
L
M
N
O
P
Q
R
S
T
U
V
W
X
Y
Z
[
\
]
^
_
NUL
SOH
STX
ETX
EOT
ENQ
ACK
BEL
128B
D
E
F
G
H
I
J
K
L
M
N
O
P
Q
R
S
T
U
V
W
X
Y
Z
[
\
]
^
_
`
a
b
c
d
e
f
g
40
128C
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
Value
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
128A
BS
HT
LF
VT
FF
CR
SO
SI
DLE
DC1
DC2
DC3
DC4
NAK
SYN
ETB
CAN
EM
SUB
ESC
FS
GS
RS
US
FNC 3
FNC 2
Shift B
Code C
Code B
FNC 4
FNC 1
128B
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
{
|
}
~
DEL
FNC 3
FNC 2
Shift A
Code C
FNC4
Code A
FNC 1
Start Code A
Start Code B
Start Code C
128C
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
Code B
Code A
FNC 1
Example
Sample Code
Result
SIZE 4,1
GAP 0,0
DIRECTION 1
CLS
TEXT 10,10,"2",0,1,1,"Human readable alignment"
BARCODE 10,50,"128",100,1,0,2,2,"left"
BARCODE 310,50,"128",100,2,0,2,2,"center"
BARCODE 610,50,"128",100,3,0,2,2,"right"
PRINT 1
SIZE 4,1
GAP 0,0
DIRECTION 1
CLS
TEXT 10,10,"2",0,1,1,"Code 128, switch code subset
automatically."
BARCODE 10,50,"128",100,1,0,2,2,"123456abcd123456"
PRINT 1
SIZE 4,1
GAP 0,0
DIRECTION 1
CLS
TEXT 10,10,"2",0,1,1,"Code 128, switch code subset manually."
BARCODE 10,50,"128M",100,1,0,2,2,"!104!096ABCD!101EFGH"
PRINT 1
Note:
The above example of code 128M encoded with CODE B start
character. The next character will be the code 128 function
character FNC3 which is then followed by the ABCD characters
and EFGH characters encoded as CODE A subset.
SIZE 4,1
GAP 0,0
DIRECTION 1
CLS
TEXT 10,10,"2",0,1,1,"TELEPEN"
BARCODE 10,50,"TELEPEN",100,1,0,2,6,"abcd1234ABCD"
PRINT 1
SIZE 4,4
GAP 0,0
DIRECTION 1
CLS
TEXT 400,26,"2",0,1,1,2,"TELEPEN Number"
BARCODE 400,50,"TELEPENN",60,2,0,2,6,2,"1234567890"
TEXT 400,136,"2",0,1,1,2,"Code 11"
BARCODE 400,160,"11",60,2,0,2,6,2,"1234567890"
TEXT 400,246,"2",0,1,1,2,"PLANET"
BARCODE 400,270,"PLANET",60,2,0,2,2,2,"12345678901"
TEXT 400,356,"2",0,1,1,2,"Deutsche Post Identcode."
BARCODE 400,380,"DPI",60,2,0,2,6,2,"12345678901"
TEXT 400,466,"2",0,1,1,2,"Deutsche Post Leitcode."
BARCODE 400,490,"DPL",60,2,0,2,6,2,"123456789012"
TEXT 400,576,"2",0,1,1,2,"Code 49"
BARCODE 400,600,"CODE49",60,2,0,2,2,2,"1234567890"
PRINT 1
41
TLC39
Description
This command draws TLC39, TCIF Linked Bar Code 3 of 9, barcode.
Syntax
TLC39 x,y,rotation,[height,]narrow,]wide,]cellwidth,]cellheight,]"ECI number,Serial number &
additional data"
Parameter
x
y
rotation
height
narrow
wide
cellwidth
cellheight
ECI number
Serial number & additional data
Description
Specify the x-coordinate
Specify the y-coordinate
0 : No rotation
90 : Rotate 90 degrees clockwise
180 : Rotate 180 degrees clockwise
270 : Rotate 270 degrees clockwise
Height of Code39 in dots (Default is 40)
Width of narrow element of Code39 in dots (Default is 2)
Width of wide element of Code39 in dots (Default is 4)
Width of cell of MicroPDF417 in dots (Default is 2)
Height of cell of MicroPDF417 in dots (Default is 4)
Must be 6 digits which is used to generate Code39
Alphanumeric is for Micro-PDF417
Note:
Comma (") is necessary between ECI number and Serial number & additional data.
This command has been supported since V6.89 EZ and later firmware.
Example
Sample Code
SIZE 4,1.2
GAP 0,0
DIRECTION 1
CLS
TEXT 10,10,"3",0,1,1,"TLC39 code"
TLC39 10,50,0,"123456,SN00000001,00601,01501"
TLC39 310,50,0,80,3,6,3,4,"123456,SN00000001,00601,01501"
PRINT 1
Result
42
BITMAP
Description
This command draws bitmap images (as opposed to BMP graphic files).
Syntax
BITMAP X,Y,width,height,mode,bitmap data
Parameter
X
Y
width
height
mode
Description
Specify the x-coordinate
Specify the y-coordinate
Image width (in bytes)
Image height (in dots)
Graphic modes listed below:
0: OVERWRITE
1: OR
2: XOR
Bitmap data
bitmap data
Example
X size
2 bytes
1-byte
2-byte
Y size
16 dots
TSC AUTO ID Technology Co., Ltd.
43
X - axis
Y- axis
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
1-byte
Binary
00000000
00000000
00000000
00000111
00000011
00010001
00011000
00011100
00011110
00011111
00011111
00011111
00011111
00011111
00011111
00011111
PRINT 1,1
2-byte
Hexadecimal
00
00
00
07
03
11
18
1C
1E
1F
1F
1F
1F
1F
1F
1F
Binary
00000000
00000000
00000000
11111111
11111111
11111111
11111111
01111111
00111111
00011111
10001111
11000111
11100011
11110111
11111111
11111111
Hexadecimal
00
00
00
FF
FF
FF
FF
7F
3F
1F
8F
C7
E3
F7
FF
FF
Hexadecimal
Result
53 49 5A 45 20 34 2C 32 0D
0A 47 41 50 20 30 2C 30 0D
0A 43 4C 53 0D 0A 42 49 54
4D 41 50 20 32 30 30 2C 32 30
-?- 30 2C 32 2C 31 36 2C 30 2C 00
00 00 00 00 00 07 FF 03 FF 11
FF 18 FF 1C 7F 1E 3F 1F 1F 1F
8F 1F C7 1F E3 1F E7 1F FF 1F
FF 0D 0A 50 52 49 4E 54 20 31
2C 31 0D 0A
See Also
PUTBMP, PUTPCX
44
BOX
Description
This command draws rectangles on the label.
Syntax
BOX x,y,x_end,y_end,line thickness[,radius]
Parameter
x
y
x_end
y_end
line thickness
radius
Description
Specify x-coordinate of upper left corner (in dots)
Specify y-coordinate of upper left corner (in dots)
Specify x-coordinate of lower right corner (in dots)
Specify y-coordinate of lower right corner (in dots)
Line thickness (in dots)
Optional. Specify the round corner. Default is 0.
*Since V5.28 EZ
Note:
Example
Sample code
Result
SIZE 4,1.1
CLS
BOX 60,60,610,210,4
BOX 80,80,590,190,4
BOX 100,100,570,170,4,20
BOX 120,120,550,150,4,20
PRINT 1
See Also
BAR
45
CIRCLE
Description
This command draws a circle on the label.
Syntax
CIRCLE X_start,Y_start,diameter,thickness
Parameter
X_start
Y_start
diameter
thickness
Description
Specify x-coordinate of upper left corner (in dots)
Specify y-coordinate of upper left corner (in dots)
Specify the diameter of the circle (in dots)
Thickness of the circle (in dots)
Example
Sample code
Result
SIZE 80 mm,30 mm
GAP 0,0
DIRECTION 1
CLS
BAR 250,20,100,1
BAR 250,20,1,100
CIRCLE 250,20,100,5
PRINT 1
46
ELLIPSE
Description
This command draws an ellipse on the label.
Syntax
ELLIPSE x,y,width,height,thickness
Parameter
x
y
width
height
thickness
Description
Specify x-coordinate of upper left corner (in dots)
Specify y-coordinate of upper left corner (in dots)
Specify the width of the ellipse (in dots)
Specify the height of the ellipse (in dots)
Thickness of the ellipse (in dots)
Note:
This command has been supported since V6.91 EZ and later firmware.
Example
Sample code
Result
SIZE 4,3
GAP 0,0
DIRECTION 1
CLS
BOX 10,10,410,110,1
ELLIPSE 10,10,400,100,2
BOX 10,120,110,520,1
ELLIPSE 10,120,100,400,5
PRINT 1
47
CODABLOCK F mode
Description
This command draws CODABLOCK F mode barcode.
Syntax
CODABLOCK x,y,rotation,[row height,]module width,]"content"
Parameter
x
y
rotation
row height
module width
content
Description
Specify the x-coordinate
Specify the y-coordinate
0 : No rotation
90 : Rotate 90 degrees clockwise
180 : Rotate 180 degrees clockwise
270 : Rotate 270 degrees clockwise
The height of individual row equals to row height x module width (Default is
8)
Width of narrow element of CODABLOCK in dots (Default is 2)
content of CODABLOCK bar code
Note:
This command has been supported since V6.89 EZ and later firmware.
Example
Sample Code
SIZE 4,1.5
GAP 0,0
DIRECTION 1
CLS
TEXT 10,10,"3",0,1,1,"Codablock F"
CODABLOCK 10,50,0,"We stand behind our products with one of the most comprehensive support programs in the Auto-ID
industry."
PRINT 1
CLS
TEXT 10,10,"3",0,1,1,"Codablock F"
CODABLOCK 10,50,0,16,1,"We stand behind our products with one of the most comprehensive support programs in the Auto-ID
industry."
PRINT 1
Result
48
DMATRIX
Description
This command defines a DataMatrix 2D bar code. Currently, only ECC200 error correction is supported.
Syntax
DMATRIX x,y,width,height,[c#,x#,r#,row,col,]"content"
Parameter
x
y
width
height
c#
Description
Horizontal start position (in dots)
Vertical start position (in dots)
The expected width of barcode area (in dots)
The expected height of barcode area (in dots)
Escape sequence control character (decimal digit)
Ex. c126 means ~
(1) ~X is shift character for control characters.
~X
~@
~A
~B
~C
~D
~E
~F
~G
x#
r#
row
col
content
Hex
00
01
02
03
04
05
06
07
ASCII
NUL
SOH
STX
ETX
EOT
ENQ
ACK
BEL
~X
~H
~I
~J
~K
~L
~M
~N
~O
HEX
08
09
0A
0B
0C
0D
0E
0F
ASCII
BS
HT
LF
VT
FF
CR
SO
SI
~X
~P
~Q
~R
~S
~T
~U
~V
~W
HEX
10
11
12
13
14
15
16
17
ASCII
DLE
DC1
DC2
DC3
DC4
NAK
SYN
ETB
~X
~X
~Y
~Z
~[
~\
~]
~^
~_
HEX
18
19
1A
1B
1C
1D
1E
1F
ASCII
CAN
EM
SUB
ESC
FS
GS
RS
US
Note:
This command has been supported since V6.89 EZ and later firmware.
Example
Sample code
Result
SIZE 4,3
GAP 0,0
DIRECTION 1
CLS
DMATRIX 10,110,400,400,"DMATRIX EXAMPLE 1"
DMATRIX 310,110,400,400,x6,"DMATRIX EXAMPLE 2"
DMATRIX 10,310,400,400,x8,18,18,"DMATRIX EXAMPLE 3"
PRINT 1,1
49
ERASE
Description
This command clears a specified region in the image buffer.
Syntax
ERASE x,y,x_width,y_height
Parameter
x
y
x_width
y_height
Description
The x-coordinate of the starting point (in dots)
The y-coordinate of the starting point (in dots)
The region width in x-axis direction (in dots)
The region height in y-axis direction (in dots)
Example
Sample code
Result
SIZE 4,2.5
GAP 0,0
DIRECTION 1
CLS
BAR 100,100,300,300
ERASE 150,150,200,200
PRINT 1,1
See Also
CLS
50
MAXICODE
Description
This command defines a 2D Maxicode.
Syntax
MAXICODE x,y,mode,[class,country,post,Lm,]"content"
MAXICODE x,y,mode,class,country,postal code,"content"
MAXICODE x,y,mode,[Lm,]"content"
Parameter
x
y
mode
class
country
post
Lm
content
For mode 2 or 3,
If country is 840, the postal code is in
99999,9999 format.
For other countries, the code is up to
6 alphanumeric characters.
For mode 4,5,6,
AIM special format is supported, see
page 23 in the spec.
Mode 6 is not supported in TSPL2
printer firmware.
Description
X-coordinate of the starting point (in dot)
Y-coordinate of the starting point (in dot)
2,3,4,5
Class of service, 3-digit number (for mode 2,3)
Country code, 3-digit number (for mode 2,3)
Post code (for mode 2,3)
Mode 2(USA): 5-digit + 4-digit number
Mode 3(Canada): 6 alphanumeric post code included by double quotes.
Expression length (double quote is ignored) , 1m138, (this parameter is
just for mode 4 and 5)
Content of 2D Maxicode
Note:
If parameter Lm is used, double quotes (") are unnecessary.
Example
Sample code
SIZE 4,2
GAP 0,0
DIRECTION 1
CLS
REM *****Mode 2 For USA*****
MAXICODE 110,100,2,300,840,06810,7317,"DEMO 2 FOR USA MAXICODE"
TEXT 100,50,"3",0,1,1,"Mode 2 For USA"
PRINT 1,1
TSC AUTO ID Technology Co., Ltd.
51
52
PDF417
Description
This command defines a PDF417 2D bar code.
Syntax
PDF417 x,y,width,height,rotate,[option],"content"
Parameter
x
y
width
height
rotate
Description
X-coordinate of starting point (in dot)
Y-coordinate of starting point (in dot)
Expected width (in dots)
Expected height (in dots)
Rotation counterclockwise
0 : No rotation
90 : Rotate 90 degrees
180 : Rotate 180 degrees
270 : Rotate 270 degrees
option
P
E
M
Ux,y,c
W
H
R
C
T
Lm
content
53
Example
Sample code
Result
SIZE 4,1
GAP 0,0
DIRECTION 1
REM *****WITHOUR OPTIONS*****
CLS
PDF417 50,50,400,200,0,"Without Options"
PRINT 1,1
SIZE 4,1.5
GAP 0,0
DIRECTION 1
REM *****OPTION:E3*****
CLS
PDF417 50,50,400,200,0,E3,"Error correction level:3"
PRINT 1,1
REM *****OPTION:E4*****
CLS
PDF417 50,50,400,200,0,E4,"Error correction level:4"
PRINT 1,1
SIZE 4,1.5
GAP 0,0
DIRECTION 1
REM *****OPTION:E4 W4*****
CLS
PDF417 50,50,600,600,0,E4,W4,"Error correction level:4 module
width 4 dots"
PRINT 1,1
REM *****OPTION:E4 W4 H4*****
CLS
PDF417 50,50,600,600,0,E4,W4,H4,"Error correction level:4 module
width 4 dots bar height 4 dots"
PRINT 1,1
SIZE 4,1.5
GAP 0,0
DIRECTION 1
REM *****OPTION:E4 W4 H4 R40 C4 T1*****
CLS
PDF417 50,50,800,800,0,E4,W4,H4,R40,C4,T1,"Error correction
level:4
Module Width 4 dots
Bar Height 4 dots
Maximum Number of Rows:5 Rows
Maximum number of columns:90 Cols
Truncation:1"
PRINT 1,1
54
SIZE 4,2.5
GAP 0,0
DIRECTION 1
REM *****OPTION:P1 E4 M1
U50,300,50,W4,H4,R60,C4,T0,L297*****
CLS
PDF417
50,50,900,600,0,P1,E4,M1,U50,300,50,W4,H4,R60,C4,
T0,L297,Data compression method: P1
Error correction level: E4
Center pattern in barcode area: M1
Human Readable: Yes: U50,300,50
Module Width 4 dots: W4
Bar Height 4 dots: H4
Maximum Number of Rows: 60 Rows: R60
Maximum number of columns: 4 Cols: C4
Truncation:1: T0
Expression length:297: L297
PRINT 1,1
55
AZTEC
Description
This command defines a AZTEC 2D bar code.
Syntax
AZTEC x,y,rotate,[size,]ecp,]flg,]menu,]multi,]rev,]"content"
AZTEC x,y,rotate,size,ecp,flg,menu,multi,rev,bytes,content
Parameter
x
y
rotate
size
ecp
flg
menu
multi
rev
bytes
content
Since V6.60EZ
Since V6.91EZ
Description
Horizontal start position (in dots)
Vertical start position (in dots)
Rotation
0 : No rotation
90 : Rotate 90 degrees
180 : Rotate 180 degrees
270 : Rotate 270 degrees
Element module size (1 to 20), default is 6
Error control (& symbol size/type) parameter
0
: default error correction level
1 to 99
: minimum error correction percentage
101 to 104
: 1 to 4-layer Compact symbol
201 to 232
: 1 to 32-layer Full-Range symbol
300
: a simple Aztec "Rune"
0 : input message is straight bytes
1 : input uses "<Esc>n" for FLG(n), "<Esc><Esc>" for "<Esc>"
Menu symbol (0 : no, 1 : yes), default is 0
Number of symbols (1 to 26), default is 6
Output to be reversed (0 : no, 1 : yes), default is 0
Length of content
Content of AZTEC 2D bar code
Note:
If parameter bytes is used, double quotes (") are unnecessary.
Example
Sample Code
Result
SIZE 4,2
GAP 0,0
CLS
AZTEC 10,10,0,"ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
AZTEC 210,10,0,4,"ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
AZTEC 410,10,0,4,1,"ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
AZTEC 610,10,0,4,1,0,"ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
AZTEC 10,310,0,4,1,0,0,"ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
AZTEC 210,310,0,4,1,0,0,1,"ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
AZTEC 410,310,0,4,1,0,0,1,1,"ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
AZTEC 610,310,0,4,1,0,0,1,1,10,1234567890
PRINT 1
56
MPDF417
Description
This command defines a Micro PDF 417 bar code.
Syntax
MPDF417 x,y,rotate,[Wn,][Hn,][Cn,]"content"
Parameter
x
y
rotate
Wn
Hn
Cn
content
Description
Horizontal start position (in dots)
Vertical start position (in dots)
Rotation
0 : No rotation
90 : Rotate 90 degrees
180 : Rotate 180 degrees
270 : Rotate 270 degrees
Optional. Module width in dot. Default is 1.
Optional. Module height in dot. Default is 10.
Optional. Number of columns. Once the parameter is set, the printer will
calculate the proper rows for the barcode base on the content
automatically.
0: Auto mode.
1: Column is 1 and the calculated suitable rows will be 11, 14, 17, 20, 24,
and 28.
2: Column is 2 and the calculated suitable rows will be 8, 11, 14, 17, 20, 23
and 26.
3: Column is 3 and the calculated suitable rows will be 6, 8, 10, 12, 15, 20,
26, 32, 38 and 44.
4: Column is 4 and the calculated suitable rows will be 4, 6, 8, 10, 12, 15,
20, 26, 32, 38 and 44.
Content of Micro PDF 417 bar code
Note:
This command has been supported since V6.61 EZ and later firmware.
Example
Sample Code
SIZE 4,1
GAP 0,0
CLS
MPDF417 10,10,0,"ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
MPDF417 110,10,0,W2,"ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
MPDF417 210,10,0,W2,H3,"ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
MPDF417 310,10,0,W2,H3,C3,"ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
PRINT 1
Result
57
PUTBMP
Description
This command prints BMP format images. The grayscale printing is for direct thermal mode only.
Support 1-bit (monochrome) and 8-bit (256-color) BMP graphic only.
Syntax
PUTBMP x,y,"filename"[, bpp][, contract]
Parameter
x
y
filename
bpp
contrast
Description
The x-coordinate of the BMP format image
The y-coordinate of the BMP format image
The downloaded BMP filename
Optional. Bits per pixel of grayscale graphic. Default is 1. *Since V6.91EZ.
1: 1-bit (monochrome) graphic
8: 8-bit (256-color) graphic
Optional. Contrast of grayscale graphic. Default is 80. Suggested range is
from 60 to 100. *Since V6.91EZ.
Model
TTP-243 series
TTP-243 Plus series
TTP-244ME series
TTP-244ME Plus series
TTP-244 series
TTP-244CE series
TTP-245 series
TTP-245C series
TDP-245 series
TTP-246M series
TTP-248M series
TTP-2410M series
TDP-643 Plus
TDP-643R Plus
TTP-342 series
TTP-342 Plus series
TTP-342M series
TTP-342M Plus series
TTP-343 series
TTP-343C series
TTP-344M series
TTP-346M series
TTP-384M series
TTP-644M series
M23 series
58
Example
Downloading BMP file into printer by DiagTool
Sample Code
SPEED 2
DENSITY 3
SIZE 4,1.5
GAP 0,0
DIRECTION 1
CLS
PUTBMP 10,10,"SAMPLE.BMP"
BLOCK 10,180,240,100,"2",0,1,1,"bpp and contrast are omitted."
PUTBMP 300,10," SAMPLE.BMP",1,80
BLOCK 300,180,240,100,"2",0,1,1,"bpp = 1
contrast = 80"
PUTBMP 590,10," SAMPLE.BMP",8,80
BLOCK 590,180,240,100,"2",0,1,1,"bpp = 8
contrast = 80"
PRINT 1
Result
59
See Also
DOWNLOAD, BITMAP, PUTPCX
60
PUTPCX
Description
This command prints PCX format images. TSPL language supports 2-color PCX format graphics. TSPL2
language supports 256-color PCX format graphics.
Syntax
PUTPCX x,y,"filename"
Parameter
x
y
filename
Description
The X-coordinate of the PCX format image
The Y-coordinate of the PCX format image
The downloaded PCX file name (Case sensitive)
Support
Model
2 color PCX
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
TTP-243 series
TTP-243 Plus series
TTP-244ME series
TTP-244ME Plus series
TTP-244 series
TTP-244CE series
TTP-245 series
TTP-245C series
TDP-245 series
TTP-246M series
TTP-248M series
TTP-2410M series
TDP-643 Plus
TDP-643R Plus
TTP-342 series
TTP-342 Plus series
TTP-342M series
TTP-342M Plus series
TTP-343 series
TTP-343C series
TTP-344M series
TTP-346M series
TTP-384M series
TTP-644M series
M23 series
61
Example
Downloading PCX file into printer by DiagTool
1
2
Sample Code
SPEED 2
DENSITY 3
SIZE 4,1.5
GAP 0,0
DIRECTION 1
CLS
PUTBMP 10,10,"SAMPLE.PCX"
PRINT 1
Result
See Also
DOWNLOAD, BITMAP, PUTPCX
62
QRCODE
Description
This command prints QR code.
Syntax
QRCODE x,y,ECC Level,cell width,mode,rotation,[model,mask,]"content"
Parameter
x
y
ECC level
cell width
mode
rotation
model
mask
content
Description
The upper left corner x-coordinate of the QR code
The upper left corner y-coordinate of the QR code
Error correction recovery level
L
: 7%
M : 15%
Q : 25%
H : 30%
1~10
Auto / manual encode
A : Auto
M : Manual
0
: 0 degree
90 : 90 degree
180 : 180 degree
270 : 270 degree
M1: (default), original version
M2: enhanced version (Almost smart phone is supported by this version.)
S0~S8, default is S7
The encodable character set is described as below,
Encodable character set:
1) Numeric data: (digits 0~9)
2) Alphanumeric data
Digits 0-9
Upper case letters A-Z
Nine other characters: space, $ % * + - . / : )
3) 8-bit byte data
JIS 8-bit character set (Latin and Kana) in accordance with JIS X 0201
4) Kanji characters
Shift JIS values 8140HEX 9FFCHEX and E040HEX EAA4 HEX. These are
values shifted from those of JIS X 0208. Refer to JIS X 0208 Annex 1
Shift Coded Representation for detail.
Data characters per symbol (for maximum symbol size):
Model 1 (Version 14-L)
Numeric data
1,167 characters
7,089 characters
Alphanumeric data 707 characters
4,296 characters
8-bit byte data
486 characters
2,953 characters
Kanji data
299 characters
1,817 characters
* If "A" is the first character in the data string, then the following data
after "A" is alphanumeric data.
*If "N" is the first character in the data string, then the following data
after "N" is numeric data.
*If "B" is the first character in the data string, then the following 4 digits
after "B" is used to specify numbers of data. After the 4 digits is the
TSC AUTO ID Technology Co., Ltd.
63
QR Code
TTP-243 series
TTP-243 Plus series
TTP-244ME series
TTP-244ME Plus series
TTP-244 series
TTP-244CE series
TTP-245 series
TTP-245C series
TDP-245 series
TTP-246M series
TTP-248M series
TTP-2410M series
TDP-643 Plus
TDP-643R Plus
TTP-342 series
TTP-342 Plus series
TTP-342M series
TTP-342M Plus series
TTP-343 series
TTP-343C series
TTP-344M series
TTP-346M series
TTP-384M series
TTP-644M series
M23 series
64
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
Example
Sample code
Auto mode example
General data string
Result
SIZE 4,2.5
GAP 0,0
DIRECTION 1
CLS
QRCODE 10,10,H,4,A,0,"ABCabc123"
QRCODE 160,160,H,4,A,0,"123ABCabc"
QRCODE 310,310,H,4,A,0," ABCabc123"
PRINT 1,1
Data string including <Enter> character (0Dh, 0Ah)
SIZE 4,2.5
GAP 0,0
DIRECTION 1
CLS
QRCODE 10,10,H,4,A,0,"ABC<Enter>
abc<Enter>
123"
QRCODE 160,160,H,4,A,0,"123<Enter>
ABC<Enter>
abc"
QRCODE 310,310,H,4,A,0,"<Enter>
ABC<Enter>
abc<Enter>
123"
PRINT 1,1
Data string concatenation (Must be used with DOWNLOAD ... EOP
command)
DOWNLOAD DEMO.BAS
SIZE 4,2.5
GAP 0,0
DIRECTION 1
CLS
QRCODE 10,10,H,4,A,0,"ABCabc123"+STR$(1234)
QRCODE 160,160,H,4,A,0,"123ABCabc"+"1234"
QRCODE 310,310,H,4,A,0," ABCabc123"+"1234"+"abcd"
PRINT 1,1
EOP
DEMO
65
Manual mode
General data string
SIZE 4,2.5
GAP 0,0
DIRECTION 1
CLS
QRCODE 10,10,H,4,M,0,"AABC!B0003abc!N123"
QRCODE 160,160,H,4,M,0,"N123!AABC!B0003abc"
QRCODE 310,310,H,4,M,0,"K !AABC!B0006abc123"
PRINT 1,1
66
67
RSS
Description
This command is used to draw a RSS bar code on the label format.
Syntax
RSS x,y,"sym",rotate,pixMult,sepHt,"content"
RSS x,y,"RSSEXP",rotate,pixMult,sepHt,segWidth,"content"
RSS x,y,"UCC128CCA",rotate,pixMult,sepHt,linHeight,"content"
RSS x,y,"UCC128CCC",rotate,pixMult,sepHt,linHeight,"content"
Parameter
x
y
sym
Description
X-coordinate
Y-coordinate
Symbology type:
RSS14
RSS14
RSS14T
RSS14 Truncated
RSS14S
RSS14 Stacked
RSS14SO
RSS14 Stacked Omnidirectional
RSSLIM
RSS Limited
RSSEXP
RSS Expanded
UPCA
UPC-A
UPCE
UPC-E
EAN13
EAN-13
EAN8
EAN-8
UCC128CCA UCC/EAN-128 & CC-A/B
UCC128CCC UCC/EAN-128 & CC-C
rotate
pixMult
sepHt
segWidth
linHeight
content
Note:
TSC AUTO ID Technology Co., Ltd.
68
Example
Sample code
SIZE 100 mm,100 mm
GAP 0,0
DIRECTION 1
CLS
RSS 300,300,"RSS14",0,2,2,"1234567890|ABCDEFG"
RSS 300,300,"RSS14T",90,2,2,"1234567890|ABCDEFG"
RSS
300,300,"RSS14S",180,2,2,"1234567890|ABCDEFG"
RSS
300,300,"RSS14SO",270,2,2,"1234567890|ABCDEFG"
PRINT 1,1
Result
69
RSS 410,10,"UPCE",0,2,2,"001220000456|ABCDEFG"
PRINT 1
SIZE 4,1
GAP 0,0
DIRECTION 1
CLS
REM UPCE Rule 2: 00abc00000ij = abcij3
RSS 10,10,"UPCE",0,2,2,"001230000045|ABCDEFG"
PRINT 1
SIZE 4,1
CLS
REM UPCE Rule 3: 00abcd00000j = abcdj4
RSS 10,10,"UPCE",0,2,2,"001234000005|ABCDEFG"
PRINT 1
SIZE 4,1
GAP 0,0
DIRECTION 1
CLS
REM UPCE Rule 4: 00abcde0000j = abcdej where j = 5-9
RSS 10,10,"UPCE",0,2,2,"001234500005|ABCDEFG"
RSS 160,10,"UPCE",0,2,2,"001234500006|ABCDEFG"
RSS 310,10,"UPCE",0,2,2,"001234500007|ABCDEFG"
RSS 460,10,"UPCE",0,2,2,"001234500008|ABCDEFG"
RSS 610,10,"UPCE",0,2,2,"001234500009|ABCDEFG"
PRINT 1
70
PRINT 1
SIZE 4,2
GAP 0,0
DIRECTION 1
CLS
RSS 10,10,"UPCE",0,1,1,"001200000456|ABCDEFG"
RSS 210,10,"UPCE",0,2,1,"001210000456|ABCDEFG"
RSS 410,10,"UPCE",0,3,1,"001220000456|ABCDEFG"
PRINT 1
71
REVERSE
Description
This command reverses a region in image buffer.
Syntax
REVERSE x_start,y_start,x_width,y_height
Parameter
x_start
y_start
x_width
y_height
Description
The x-coordinate of the starting point (in dots)
The y-coordinate of the starting point (in dots)
X-axis region width (in dots)
Y-axis region height (in dots)
Note:
Recommended max. height of reversed black area is 12mm at 4 width. Height of reversed
area that is larger than 12 mm may damage the power supply and affect the print quality.
Max. print ratio is different for each printer model. Desktop and industrial printer print ratio
is limited to 20% and 30% respectively.
Example
Sample code
Result
SIZE 4,2.5
GAP 0,0
DIRECTION 1
CLS
TEXT 100,100,"3",0,1,1,"REVERSE"
REVERSE 90,90,128,40
PRINT 1,1
72
TEXT
Description
This command prints text on label.
Syntax
TEXT x,y,"font",rotation,x-multiplication,y-multiplication,[alignment,]"content"
Parameter
x
y
font
Description
The x-coordinate of the text
The y-coordinate of the text
Font name
Monotye CG Triumvirate Bold Condensed, font
0
width and height is stretchable
1
8 x 12 fixed pitch dot font
2
12 x 20 fixed pitch dot font
3
16 x 24 fixed pitch dot font
4
24 x 32 fixed pitch dot font
5
32 x 48 dot fixed pitch font
6
14 x 19 dot fixed pitch font OCR-B
7
21 x 27 dot fixed pitch font OCR-B
8
14 x25 dot fixed pitch font OCR-A
Monotye CG Triumvirate Bold Condensed, font
ROMAN.TTF
width and height proportion is fixed.
Following fonts were supported since V6.80 EZ.
1.EFT
EPL2 font 1
2.EFT
EPL2 font 2
3.EFT
EPL2 font 3
4.EFT
EPL2 font 4
5.EFT
EPL2 font 5
A.FNT
ZPL2 font A
B.FNT
ZPL2 font B
D.FNT
ZPL2 font D
E8.FNT
ZPL2 font E8
F.FNT
ZPL2 font F
G.FNT
ZPL2 font G
H8.FNT
ZPL2 font H8
GS.FNT
ZPL2 font GS
rotation
x-multiplication
73
y-multiplication
alignment
content
Note:
The internal font (font #1~#5) pitch between TSPL and TSPL2 is different.
Font "0" and "ROMAN.TTF" internal True Type Fonts are available in TSPL2 language
printers, but not TSPL language printers.
If there is any double quote (") within the text, please change it to \["].
If font "0" is used, the font width and font height is stretchable by x-multiplication and
y-multiplication parameter. It is expressed by pt (point). 1 point=1/72inch.
EPL2 and ZPL2 are emulating for Eltron and Zebra languages.
MODEL
TTP-243 series
TTP-243 Plus series
TTP-244ME series
TTP-244ME Plus series
TTP-244 series
TTP-244CE series
TTP-245 series
TTP-245C series
TDP-245 series
TTP-246M series
TTP-248M series
TTP-2410M series
TDP-643 Plus
TDP-643R Plus
TTP-342 series
TTP-342 Plus series
TTP-342M series
TTP-342M Plus series
TTP-343 series
TTP-343C series
TTP-344M series
TTP-346M series
TTP-384M series
TTP-644M series
M23
V
V
V
V
V
V
V
V
V
V
V
V
V
V
1
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
2
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
74
3
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
4
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
Font Type
5
6
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
ROMAN.TTF
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
Example
Sample Code
SIZE 4,3
GAP 0,0
DIRECTION 1
CLS
TEXT 10,10,"0",0,12,12,"TSPL 2"
TEXT 10,40,"0",0,8,8,"align left"
BAR 0,70,800,4
TEXT 10,110,"0",0,12,12,"FONT 0"
TEXT 10,160,"1",0,1,1,"FONT 1"
TEXT 10,210,"2",0,1,1,"FONT 2"
TEXT 10,260,"3",0,1,1,0,"FONT 3"
TEXT 10,310,"4",0,1,1,0,"FONT 4"
TEXT 10,360,"5",0,1,1,0,"FONT 5"
TEXT 10,410,"6",0,1,1,1,"FONT 6"
TEXT 10,460,"7",0,1,1,1,"FONT 7"
TEXT 10,510,"8",0,1,1,1,"FONT 8"
TEXT 10,560,"ROMAN.TTF",0,12,12,"FONT ROMAN.TTF"
TEXT 400,10,"0",0,12,12,2,"EPL 2"
TEXT 400,40,"0",0,8,8,2,"align center"
TEXT 400,110,"1.EFT",0,1,1,2,"FONT 1"
TEXT 400,160,"2.EFT",0,1,1,2,"FONT 2"
TEXT 400,210,"3.EFT",0,1,1,2,"FONT 3"
TEXT 400,260,"4.EFT",0,1,1,2,"FONT 4"
TEXT 400,310,"5.EFT",0,1,1,2,"FONT 5"
TEXT 800,10,"0",0,12,12,3,"ZPL 2"
TEXT 800,40,"0",0,8,8,3,"align right"
TEXT 800,110,"A.FNT",0,1,1,3,"FONT A"
TEXT 800,160,"B.FNT",0,1,1,3,"FONT B"
TEXT 800,210,"D.FNT",0,1,1,3,"FONT D"
TEXT 800,260,"E8.FNT",0,1,1,3,"FONT E8"
TEXT 800,310,"F.FNT",0,1,1,3,"FONT F"
TEXT 800,360,"G.FNT",0,1,1,3,"FONT G"
TEXT 800,410,"H8.FNT",0,1,1,3,"FONT H8"
TEXT 800,460,"GS.FNT",0,1,1,3,"ABCDEF"
PRINT 1
Result
75
BLOCK
Description
This command prints paragraph on label.
Syntax
BLOCK x,y,width,height,"font",rotation,x-multiplication,y-multiplication,[space,]alignment,]
"content"
Parameter
x
y
width
height
font
Description
The x-coordinate of the text
The y-coordinate of the text
The width of block for the paragraph in dots
The height of block for the paragraph in dots
Font name
Monotye CG Triumvirate Bold Condensed, font
0
width and height is stretchable
1
8 x 12 fixed pitch dot font
2
12 x 20 fixed pitch dot font
3
16 x 24 fixed pitch dot font
4
24 x 32 fixed pitch dot font
5
32 x 48 dot fixed pitch font
6
14 x 19 dot fixed pitch font OCR-B
7
21 x 27 dot fixed pitch font OCR-B
8
14 x25 dot fixed pitch font OCR-A
Monotye CG Triumvirate Bold Condensed, font
ROMAN.TTF
width and height proportion is fixed.
Following fonts were supported since V6.80 EZ.
1.EFT
EPL2 font 1
2.EFT
EPL2 font 2
3.EFT
EPL2 font 3
4.EFT
EPL2 font 4
5.EFT
EPL2 font 5
A.FNT
ZPL2 font A
B.FNT
ZPL2 font B
D.FNT
ZPL2 font D
E8.FNT
ZPL2 font E8
F.FNT
ZPL2 font F
G.FNT
ZPL2 font G
H8.FNT
ZPL2 font H8
GS.FNT
ZPL2 font GS
rotation
x-multiplication
76
y-multiplication
space
alignment
content
For font "0", this parameter is used to specify the width (point) of true type
font. 1 point=1/72 inch.
Vertical multiplication, up to 10x
Available factors: 1~10
For true type font, this parameter is used to specify the height (point) of
true type font. 1 point=1/72 inch.
For *.TTF font, x-multiplication and y-multiplication support floating value.
(V6.91 EZ)
Add or delete the space between lines in dot.
Text alignment. (V6.73 EZ)
0 : default (Left)
1 : Left
2 : Center
3 : Right
Data in block. The maximum data length is 4092 bytes.
Note:
The internal font (font #1~#5) pitch between TSPL and TSPL2 is different.
Font 0 and ROMAN.TTF internal True Type Fonts are available in TSPL2 language
printers, but not TSPL language printers.
If there is any double quote (") within the text, please change it to \["].
If font "0" is used, the font width and font height is stretchable by x-multiplication and
y-multiplication parameter. It is expressed by pt (point). 1 point=1/72inch.
This command has been supported since V6.91 EZ and later firmware.
EPL2 and ZPL2 are for emulating Eltron and Zebra languages.
Example
Sample Code
SIZE 4,0.5
GAP 0,0
DIRECTION 1
CLS
BOX 10,10,800,100,2
BLOCK 15,15,790,90,"0",0,8,8,"We stand behind our products with one of the most comprehensive
support programs in the Auto-ID industry."
PRINT 1
CLS
BOX 10,10,800,100,2
BLOCK 15,15,790,90,"0",0,8,8,20,2,"We stand behind our products with one of the most
comprehensive support programs in the Auto-ID industry."
PRINT 1
Result
77
<ESC>!?
Description
This command obtains the printer status at any time, even in the event of printer error. An inquiry
request is solicited by sending an <ESC> (ASCII 27, escape character) as the beginning control character
to the printer. A one byte character is returned, flagging the printer status. A 0 signifies the printer is
ready to print labels.
Syntax
<ESC>!?
Hex Receive
00
01
02
03
04
05
08
09
0A
0B
0C
0D
10
20
80
Printer Status
Normal
Head opened
Paper Jam
Paper Jam and head opened
Out of paper
Out of paper and head opened
Out of ribbon
Out of ribbon and head opened
Out of ribbon and paper jam
Out of ribbon, paper jam and head opened
Out of ribbon and out of paper
Out of ribbon, out of paper and head opened
Pause
Printing
Other error
See Also
<ESC>!S
78
<ESC>!C
Description
This command restarts the printer and omits to run AUTO.BAS. The beginning of the command is an
ESCAPE character (ASCII 27).
Syntax
<ESC>!C
Note:
When printer receives this command, printer will restart itself no matter AUTO.BAS exists or not.
This command has been supported since V5.23 EZ and later firmware.
See Also
<ESC>!Q
79
<ESC>!D
Description
This command is used to disable immediate command, ex. <ESC>!R <RSC>!? <ESC>!C and so on, which
is starting by <ESC>!. The beginning of the command is an ESCAPE character (ASCII 27).
Syntax
<ESC>!D
Note:
This command has been supported since V6.61 EZ and later firmware.
See Also
~!D
80
<ESC>!O
Description
This command is using to cancel the PAUSE status of printer. The beginning of the command is an
ESCAPE character (ASCII 27).
Syntax
<ESC>!O
Note:
This command has been supported since V6.93 EZ and later firmware.
See Also
<ESC>!P
81
<ESC>!P
Description
This command is using to PAUSE the printer. The beginning of the command is an ESCAPE character
(ASCII 27).
Syntax
<ESC>!P
Note:
This command has been supported since V6.93 EZ and later firmware.
See Also
<ESC>!O
82
<ESC>!Q
Description
This command restarts the printer and omits to run AUTO.BAS. The beginning of the command is an
ESCAPE character (ASCII 27).
Syntax
<ESC>!Q
Note:
If there is no AUTO.BAS inside the printer, the printer will not restart itself.
This command has been supported since V6.72 EZ and later firmware.
See Also
<ESC>!C
83
<ESC>!R
Description
This command resets the printer. The beginning of the command is an ESCAPE character (ASCII 27).
The files downloaded in memory will be deleted. This command cannot be sent in dump mode.
Syntax
<ESC>!R
See Also
<ESC>!?
84
<ESC>!S
Description
This command obtains the printer status at any time, even in the event of printer error. An inquiry
request is solicited by sending an <ESC> (ASCII 27, escape character) as the beginning control character
to the printer. 8 bytes will be returned, flagging the printer status.
Syntax
<ESC>!S
Note:
This command has been supported since V6.29 EZ and later firmware.
Response Format
<STX>[4-byte status]<ETX><CR><LF>
Bit 7
0
0
0
0
0
0
0
0
0
0
Bit 6
1
1
1
1
1
1
1
1
1
1
Bit 5
0
1
0
0
0
0
0
0
0
0
Bit 4
0
0
0
0
0
0
0
0
1
1
Bit 3
0
0
0
0
0
0
1
1
0
0
Bit 7
0
0
0
0
0
0
Bit 6
1
1
1
1
1
1
Bit 5
0
0
0
0
0
1
Bit 4
0
0
0
0
0
0
Bit 3
0
0
0
0
1
0
Bit 2
0
0
0
1
0
0
ASCII
64
65
66
68
72
96
Char
@
A
B
D
H
`
Meaning
Normal
Reversed
Reversed
Reversed
Receive buffer bull
Reversed
ASCII
64
65
66
72
80
Char
@
A
B
H
P
Meaning
Normal
Print head overheat
Stepping motor overheat
Cutter jam
Insufficient memory
ASCII
64
65
66
68
72
96
Char
@
A
B
D
H
`
Meaning
Normal
Paper empty
Paper jam
Ribbon empty
Ribbon jam
Print head open
Bit 7
0
0
0
0
0
Bit 6
1
1
1
1
1
Bit 5
0
0
0
0
0
Bit 4
0
0
0
0
1
Bit 3
0
0
0
1
0
Bit 2
0
0
0
0
0
Bit 7
0
0
0
0
0
0
Bit 6
1
1
1
1
1
1
Bit 5
0
0
0
0
0
1
Bit 4
0
0
0
0
0
0
Bit 3
0
0
0
0
1
0
Bit 2
0
0
0
1
0
0
85
ASCII
64
96
66
67
69
70
75
76
80
87
Char
@
`
B
C
E
F
K
L
P
W
Meaning
Normal
Pause
Backing label
Cutting
Printer error
Form feed
Waiting to press print key
Waiting to take label
Printing batch
Imaging
Example
Test <ESC>!S by CommTool via RS-232 port.
Hex Data 1B 21 53
means <ESC>!S.
Click to send Hex
1b 21 53 to query
printer status.
Result
Item
Meaning
1
The start character of returned value.
2
The 4-byte status in Hex.
3
The end characters of returned value.
4-byte status in characters.
@@@@: The printer is normal for use.
F@@@: The printer is feeding label.
`@@@: Printer is in PAUSE mode.
4
B@@@: The printer is backing label.
E@@B: Printer is in error Paper Jam.
E@@b: Printer is in error Paper Jam & Head
open.
See Also
<ESC>!?
86
<ESC>!F
Description
This command is using to feed a label. This function is the same as to press the FEED button. The
beginning of the command is an ESCAPE character (ASCII 27).
Syntax
<ESC>!F
Note:
This command has been supported since V7.00 EZ and later firmware.
87
<ESC>!.
Description
This command can cancel all printing files. The beginning of the command is an ESCAPE character
(ASCII 27).
Syntax
<ESC>!.
Note:
This command has been supported since V7.00 EZ and later firmware.
88
~!@
Description
This command inquires the mileage of the printer. The integer part of mileage is returned (the decimal
part of mileage is not return) to the PC in ASCII characters. The ending character of mileage is 0x0D.
Syntax
~!@
Parameter
None
Description
N/A
Example
~!@
89
~!A
Description
This command inquires the free memory of the printer. The number of bytes of free memory is
returned in decimal digits, with 0x0d as ending code of PC.
Syntax
~!A
Parameter
None
Description
N/A
Example
~!A
See Also
FILES
90
~!C
Description
This command inquires the presence of Real Time Clock. One byte is return from the printer, indicating
whether or not the RTC is installed. This command is only for the firmware before V6.xx.
Syntax
~!C
Parameter
None
Description
N/A
Return value
0
1
Description
RTC is not installed.
RTC is installed.
Example
~!C
91
~!D
Description
This command enters the printer into DUMP mode. In DUMP mode, the printer outputs code directly
without interpretation.
Syntax
~!D
Parameter
None
Description
N/A
Example
~!D
92
~!E
Description
This command is used to enable immediate command, ex. <ESC>!R <RSC>!? <ESC>!C and so on, which
is starting by <ESC>!.
Syntax
~!E
Note:
This command has been supported since V6.61 EZ and later firmware.
Example
~!E
See also
<ESC>!D
93
~!F
Description
This command inquires all about files resident in the printer memory, and fonts installed in the
memory module. The filename are returned in ASCII characters. Each file name ends with 0x0D. The
ending character is 0x1A. Entering this command multiple times will cycle through the files resident on
memory.
Syntax
~!F
Parameter
None
Description
N/A
Example
~!F
See Also
FILES
94
~!I
Description
The command inquires the code page and country setting of the printer.
Syntax
~!I
Parameter
None
Description
N/A
Example
~!I
See Also
COUNTRY, CODEPAGE
95
~!T
Description
This command inquires the model name and number of the printer. This information is returned in
ASCII characters.
Syntax
~!T
Parameter
None
Description
N/A
Printer Type
TTP-243
TTP-243E
TTP-243 Plus
TTP-243E Plus
TTP-244ME
TTP-244ME Plus
TTP-245
TTP-245C
TDP-245
TTP-245G
TDP-245G
TTP-244
TTP-244 Plus
TTP-244CE
TTP-246M
TTP-246G
TTP-246M Plus
TTP-248M
TTP-2410M
TTP-342
TTP-342 Plus
TTP-342M
TTP-342M Plus
TTP-344M
TTP-344M Plus
TTP-346M
TTP-346M
TTP-384M
TTP-644M
TTP-343
TTP-343C
M23
Returned String
TTP/TDP 243
TTP/TDP 243E
TTP243P
TTP243EP
TTP/TDP 244ME
TTP244MEP
TTP245
TTP245C
TDP245
TTP245G
TDP245G
TTP244
TTP244Plus
TTP244CE
TTP246M
TTP246G
TTP246MP
TTP248M
TTP2410M
TTP/TDP 342
TTP342MP
TTP/TDP 342M
TTP342MP
TTP344M
TTP344MP
TTP346M
TTP346M
TTP384M
TTP644M
TTP343
TTP343C
M23
Example
~!T
96
Syntax
~#Prompt~&[@0]
~#Prompt~&[@1]
Parameter
None
Description
N/A
Example
Sample code
Result
DOWNLOAD "A.BAS"
OUT "~#KP-200~&@0"
OUT "~#Testing~&@1"
EOP
A
See Also
INPUT, OUT
97
Syntax
!Bnnn
Parameter
nnn
Description
The number of bytes of image data sent from PC to printer, expressed in 3
decimal digits.
Example
!B100
See Also
BITMAP
98
!J
Description
This command prints bitmap data at the specified position (in y-direction).
Syntax
!Jnnnn
Parameter
nnn
Description
Print image at the specified position in y-direction. The position is
expressed in 4 decimal digits.
Example
!J0100
See Also
FEED
99
!N
Description
This command prints a specified number of labels.
Syntax
!Nnnn
Parameter
nnn
Description
Specifies the number of copies to be printed.
Example
!N001
100
DRAM
50
50
50
50
50
50
50
50
50
50
50
50
50
50
50
50
50
50
50
50
50
50
50
50
50
50
50
50
50
50
50
Ext. FLASH
256
256
256
256
256
256
-Depends on SD card capacity
-256
Depends on SD card capacity
256
Depends on SD card capacity
256
256
256
256
Depends on SD card capacity
256
Depends on SD card capacity
--256
256
256
256
256
256
256
256
256
If "AUTO.BAS" exists in the printer memory, it will be automatically executed upon printer startup.
To disable the auto execution function, please follow the procedures below.
For TTP-245/TTP-343/TDP-245 series, 245C/343C/244CE series
Hold the FEED key and power on the switch. The LED color will be changed as following pattern.
Orange red (5 blinks) orange (5 blinks) green (5 blinks) solid green (for firmware version
before V3.37)
TSC AUTO ID Technology Co., Ltd.
101
Orange red (5 blinks) orange (5 blinks) green (5 blinks) green and orange (5 blinks) red
and orange (5 blinks) solid green (V3.37)
Release the FEED key while LED becomes solid green to prevent the printer from running AUTO.BAS.
For TTP-246M/TTP-344M series
Hold the FEED key and power on the switch. The ERROR LED will be on. Printer is now ready to use.
For TTP-2410M/TTP-246M PLUS series
Hold the PAUSE and FEED keys and power on the switch. AUTO.BAS will not be executed after printer
initialization, and will now be ready for use.
Alternatively, hold the PAUSE key and power on the switch. After sensor calibration, the AUTO.BAS
will not be executed. Printer is now ready for use.
Syntax
1. Download a program file:
DOWNLOAD [n,]"FILENAME.BAS"
Parameter
n
FILENAME.BAS
Description
Specify memory used to save downloaded files.
n is ignored: Download files to DRAM only. If you would like to save the
files from DRAM to Flash memory before turning off power, issue the
MOVE command to printer.
F: Download files to main board flash memory.
E: Download files to expansion memory module.
The filename resident in printer memory.
Note:
No Battery is used to back up files in DRAM. which will be lost in the event printer
power is lost.
Description
Specify the memory location to save downloaded files.
n is ignored: Download files to DRAM only. If you would like to save the
files from DRAM to Flash memory before turning off power, issue the
MOVE command to printer.
F: Download files to main board flash memory.
102
FILENAME
DATA SIZE
DATA CONTENT
Note:
For text data files, CR (carriage return) 0x0D and LF (Line Feed) 0x0A is the separator of
data.
No Battery is used to back up files in DRAM. which will be lost in the event printer
power is lost.
To run the program, call the main filename without BAS extension or use RUN command
to start the download program.
Model
TTP-243 series
TTP-243 Plus series
TTP-244ME series
TTP-244ME Plus series
TTP-244 series
TTP-244CE series
TTP-245 series
TTP-245C series
TDP-245 series
TTP-246M series
TTP-248M series
TTP-2410M series
TDP-643 Plus series
TDP-643R Plus series
TTP-342 series
TTP-342 Plus series
TTP-342M series
TTP-342M Plus series
TTP-343 series
TTP-343C series
TTP-344M series
TTP-346M series
TTP-384M series
TTP-644M series
M23 series
DOWNLOAD
"filename"
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
Support
DOWNLOAD
MOVE
F,"filename"
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
103
DOWNLOAD
E,"filename"
V
V
V
V
V
V
V
V
V
V
V
V
V
Example
Sample code (The example program listed below will download to printer SDRAM.)
DOWNLOAD "EXAMPLE.BAS"
SIZE 4,4
GAP 0,0
DIRECTION 1
SET TEAR ON
CLS
TEXT 100,100,"3",0,1,1,"EXAMPLE PROGRAM"
PRINT 1
EOP
See Also
EOP, RUN, PUTBMP, PUTPCX, INPUT, FILES, ~!F
104
EOP
Description
End of program. To declare the start and end of BASIC language commands used in a program,
DOWNLOAD "FILENAME.BAS " must be added in the first line of the program, and "EOP " statement at
the last line of program.
Syntax
EOP
Example
Sample code (The example program listed below will download to printer SDRAM.)
DOWNLOAD "DEMO.BAS"
SIZE 4,4
GAP 0,0
DIRECTION 1
SET TEAR ON
CLS
TEXT 100,100,"3",0,1,1,"DEMO PROGRAM"
PRINT 1
EOP
See Also
DOWNLOAD, INPUT, FILES, ~!F
105
FILES
Description
This command prints out the total memory size, available memory size and files lists (or lists the files
through RS-232) in the printer memory (both FLASH memory and DRAM).
Syntax
FILES
Example
Sample code
Result
FILES
See Also
~!F, KILL
106
KILL
Description
This command deletes a file in the printer memory. The wild card (*) will delete all files resident in
specified DRAM or FLASH memory.
Support
Model
KILL "*"
MOVE
V
KILL "*"
TTP-243 series
TTP-243 Plus series
TTP-244ME series
TTP-244ME Plus series
TTP-244 series
TTP-244CE series
TTP-245 series
TTP-245C series
TDP-245 series
TTP-246M series
TTP-248M series
TTP-2410M series
TDP-643 Plus series
TDP-643R Plus series
TTP-342 series
TTP-342 Plus series
TTP-342M series
TTP-342M Plus series
TTP-343 series
TTP-343C series
TTP-344M series
TTP-346M series
TTP-384M series
TTP-644M series
M23 series
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
KILL F,"*"
KILL E,"*"
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
Syntax
KILL [n],FILENAME
Parameter
n
FILENAME
Description
Specify the memory location that files will be deleted.
n is ignored: Kill files saved in DRAM.
F: Kill files from main board flash memory.
E: Kill files from expansion memory module.
The name of data file that will delete in the printer memory (case
sensitive)
Note:
If optional parameter n is not specified, firmware will delete the file in DRAM.
Syntax example
KILL "FILENAME "
: Delete the specify file in DRAM.
KILL "*.PCX "
: Delete all PCX files in DRAM.
KILL "* "
: Delete all files in DRAM.
TSC AUTO ID Technology Co., Ltd.
107
Example
Users can use printer SELFTEST utility to list printer configurations and files saved in the printer
memory, or use the FILES command to print the downloaded file list in printer. Follow the steps below
to delete files in the printer memory via parallel port connection.
C:\>COPY CON LPT1<ENTER>
FILES<ENTER>
<CTRL><Z><ENTER>
C:\>COPY CON LPT1<ENTER>
KILL "DEMO.BAS " <ENTER>
<CTRL><Z><ENTER>
C:\>COPY CON LPT1<ENTER>
FILES<ENTER>
<CTRL><Z><ENTER>
Note: <ENTER> stands for PC keyboard ENTER key. <CTRL><Z> means to hold PC keyboard CTRL
key then press the PC keyboard <Z> key
See Also
~!F, FILES
108
MOVE
Description
This command moves downloaded files from DRAM to FLASH memory.
Syntax
MOVE
Parameter
N/A
Description
N/A
See Also
DOWNLOAD, EOP
109
RUN
Description
This command executes a program resident in the printer memory. It is available for TSPL2 language
printers only.
Syntax
RUN "FILENAME.BAS"
Note: This command can be replaced to filename that without typing .BAS.
Model
TTP-243 series
TTP-243 Plus series
TTP-244ME series
TTP-244ME Plus series
TTP-244 series
TTP-244CE series
TTP-245 series
TTP-245C series
TDP-245 series
TTP-246M series
TTP-248M series
TTP-2410M series
TDP-643 Plus
TDP-643R Plus
TTP-342 series
TTP-342 Plus series
TTP-342M series
TTP-342M Plus series
TTP-343 series
TTP-343C series
TTP-344M series
TTP-346M series
TTP-384M series
TTP-644M series
M23 series
Support
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
110
Example
Sample code
DOWNLOAD "DEMO.BAS"
SIZE 4,4
GAP 0,0
DIRECTION 1
SET TEAR ON
CLS
TEXT 100,100,"3",0,1,1,"DEMO PROGRAM"
PRINT 1
EOP
RUN "DEMO.BAS"
Result
DOWNLOAD "DEMO.BAS"
SIZE 4,4
GAP 0,0
DIRECTION 1
SET TEAR ON
CLS
TEXT 100,100,"3",0,1,1,"DEMO PROGRAM"
PRINT 1
EOP
DEMO
See Also
DOWNLOAD, EOP
111
Syntax
ABS (VARIABLE)
Example
Sample code
Result
DOWNLOAD "TEST.BAS"
SIZE 4,4
GAP 0,0
DIRECTION 1
SET TEAR ON
CLS
A=ABS(-100)
B=ABS(-50.98)
C=-99.99
TEXT 100,100,"3",0,1,1,STR$(A)
TEXT 100,150,"3",0,1,1,STR$(B)
TEXT 100,200,"3",0,1,1,STR$(ABS(C))
PRINT 1
EOP
RUN "TEST.BAS"
See Also
DOWNLOAD, EOP
112
ASC( )
Description
This function returns the ASCII code of the character.
Syntax
ASC ("A")
Example
Sample code
Result
DOWNLOAD "TEST.BAS"
SIZE 4,4
GAP 0,0
DIRECTION 1
SET TEAR ON
CLS
CODE1=ASC("A")
TEXT 100,100,"3",0,1,1,STR$(CODE1)
PRINT 1
EOP
RUN "TEST.BAS"
See Also
DOWNLOAD, EOP, STR$()
113
CHR$( )
Description
This function returns the character with the specified ASCII code.
Syntax
CHR$(n)
Parameter
n
Description
The ASCII code
Example
Sample code
Result
DOWNLOAD "TEST.BAS"
SIZE 4,4
GAP 0,0
DIRECTION 1
SET TEAR ON
CLS
A=75
WORD$=CHR$(A)
TEXT 100,100,"3",0,1,1,WORD$
PRINT 1
EOP
RUN "TEST.BAS"
See Also
DOWNLOAD, EOP, STR$(), ASC$()
114
XOR$( )
Description
This command can encode the original data to a new data by logic XOR.
Syntax
XOR$(data$,password$)
Parameter
data$
password$
Description
The original data needs to be encoded by password$.
This parameter will be used to create the new data.
Note:
This command has been supported since V6.38 EZ and later firmware.
Example
Sample code
Result
data$="1234"
password$="ABCD"
encoded$=XOR$(data$,password$)
deconded$=XOR$(encoded$,password$)
SIZE 4,0.5
GAP 0,0
CLS
TEXT 10,10,"3",0,1,1,"Encoded data: "+encoded$
TEXT 10,60,"3",0,1,1,"Decoded data: "+deconded$
PRINT 1
115
END
Description
This command states the end of program.
Syntax
END
Example
Sample code
Result
DOWNLOAD "DEMO.BAS"
SIZE 4,2
GAP 0,0
DIRECTION 1
CLS
TEXT 200,60,"4",0,1,1,"END COMMAND TEST"
X=300
Y=200
X1=500
Y1=400
GOSUB DR_LINE
PRINT 1
END
:DR_LINE
FOR I=1 TO 100 STEP 10
BOX X+I,Y+I,X1-I,Y1-I,5
NEXT
RETURN
EOP
DEMO
See Also
DOWNLOAD, EOP, GOSUB
116
EOF( )
Description
This function is used to detect an opened download file to see whether it has reached the end of file.
Syntax
EOF (File Handle)
Parameter
File handle
Description
Either 0 or 1
Return value
None-zero
0
Description
End of file
Not end of file
Example
Sample code
DOWNLOAD "DATA",16,COMPUTER
2000
DOWNLOAD "DEMO.BAS"
SIZE 3,3
GAP 0.0,0
DIRECTION 1
CLS
OPEN "DATA",0
SEEK 0,0
Y=110
TEXT 10,10,"3",0,1,1,"*****EOF TEST*****"
:A
Temp$=""
READ 0,ITEM$,P
TEXT 10,Y,"2",0,1,1,ITEM$+"$"+STR$(P)+"[EOF(0)="+STR$(EOF(0))+"]"
BARCODE 10,Y+25,"39",40,1,0,2,4,"PRICE-"+STR$(P)
Y=Y+100
IF EOF(0)=0 THEN GOTO A
PRINT 1
EOP
DEMO
Result
See Also
DOWNLOAD, EOP, OPEN, READ, SEEK
TSC AUTO ID Technology Co., Ltd.
117
OPEN
Description
This command opens a downloaded file and establishes the file handle. Up to two file handles are
supported, thus only up to two files can be opened simultaneously. The file to be opened should be
downloaded prior to using this command. When opening a file, the firmware will search automatically
to see if the file exists in the on board flash memory or extended memory card. *Since V6.37 EZ, if the
file doesnt exist, the printer will create this file in the onboard FLASH.
Syntax
OPEN [memory ID,]"filename",file handle
Parameter
[memory ID]
Description
Optional. Open the file in specific memory device. *Since V6.68 EZ.
ID
Memory device
Omitted
DRAM
F
FLASH
E
CARD
filename
file handle
Example
Sample code
Result
118
See Also
DOWNLOAD, EOP, READ, WRITE, SEEK, CLOSE
119
CLOSE
Description
Close the file handle which is open by command OPEN.
Syntax
CLODE file handle
Parameter
file handle
Description
Either 0 or 1
Example
See the example in command OPEN.
120
WRITE
Description
This command writes data to a downloaded data file. Two files can be open simultaneously, by virtue
of printer support for two file handles.
Syntax
WRITE file handle,variables
Parameter
file handle
variables
Description
0 or 1
string, integer or float point variable
See Also
READ, DOWNLOAD, EOP, OPEN, EOF, LOF, SEEK, FREAD$()
121
READ
Description
This command reads data from downloaded data file.
Syntax
READ file handle,variables
Parameter
file handle
variables
Description
0 or 1
string, integer or float point variable
Example
Sample code
Result
DOWNLOAD "DATA1",20,COMPUTER
2000
12
DOWNLOAD "DATA2",16,Mouse
900
93
DOWNLOAD "DEMO.BAS"
SIZE 3,1
GAP 0,0
DIRECTION 1
I=0
Y=100
OPEN "DATA1",0
OPEN "DATA2",1
SEEK 0,0
SEEK 1,0
:Start
CLS
TEXT 10,10,"3",0,1,1,"*****READ COMMAND TEST*****"
TEXT 10,50,"3",0,1,1,"OPEN-READ DATA"+STR$(I+1)
ITEM$=""
READ I,ITEM$,P,Q
TEXT 10,Y,"2",0,1,1,ITEM$+"$"+STR$(P)
BARCODE 10,Y+25,"39",40,1,0,2,4,"PRICE*"+STR$(Q)+"="+STR$(P*Q)
Y=Y+100
PRINT 1
Y=100
IF I<=1 THEN
IF EOF(I)=1 THEN
I=I+1
GOTO Start
ELSE
GOTO Start
ENDIF
ELSE
END
ENDIF
EOP
DEMO
See Also
DOWNLOAD, EOP, OPEN, EOF, LOF, SEEK, FREAD$()
TSC AUTO ID Technology Co., Ltd.
122
SEEK
Description
This command shifts the specified file pointer to a certain position.
Syntax
SEEK file handle,offset
Parameter
file handle
offset
Description
0 or 1
the offset characters which are shifted to a new position
Example
Sample code
Result
DOWNLOAD "DATA",12,1234567890
DOWNLOAD "TEST.BAS"
SIZE 4,1.5
GAP 0,0
DIRECTION 1
REFERENCE 0,0
CLS
OPEN "DATA",0
SEEK 0,4
READ 0,Num$
TEXT 100,10,"3",0,1,1,"SEEK COMMAND TEST"
BAR 100,40,300,4
TEXT 100,60,"3",0,1,1,"SHIFT 4 CHARACTERS"
TEXT 100,110,"3",0,1,1,Num$
BAR 100,140,300,4
SEEK 0,0
READ 0,Num$
TEXT 100,160,"3",0,1,1,"SHIFT 0 CHARACTERS"
TEXT 100,210,"3",0,1,1,Num$
PRINT 1
EOP
TEST
See Also
DOWNLOAD, EOP, OPEN, READ, EOF, LOF, FREAD$()
123
LOF( )
Description
This function returns the size of the specified file.
Syntax
LOF("FILENAME")
Parameter
FILENAME
Description
The file downloaded in the printer memory.
Example
Sample code
Result
DOWNLOAD "DATA1",10,1234567890
DOWNLOAD "DATA2",15,ABCDEFGHIJKLMNO
DOWNLOAD "LofTest.BAS"
SIZE 4,1.5
GAP 0,0
DIRECTION 1
CLS
OPEN "DATA1",0
OPEN "DATA2",1
TEXT 10,20,"4",0,1,1,"LOF() FUNCTION TEST"
J=LOF("DATA1")
K=LOF("DATA2")
TEXT 10,140,"3",0,1,1,"DATA1 IS: "+STR$(J)+" Bytes"
TEXT 10,200,"3",0,1,1,"DATA2 IS: "+STR$(K)+" Bytes"
PRINT 1
EOP
LofTest
See Also
DOWNLOAD, EOP, OPEN, READ, EOF, SEEK, FREAD$()
124
LOC( )
Description
This function returns the current read/write position within an open file.
Syntax
LOC(file handle)
Parameter
file handle
Description
0 or 1
Note:
This command has been supported since V6.86 EZ and later firmware.
Example
Sample code
Result
DOWNLOAD "DATA.DAT",30,12345678
12345678
12345678
DOWNLOAD "TEST.BAS"
str1$ = ""
location = 0
OPEN "DATA.DAT",0
READ 0,str1$
location = LOC(0)
CLOSE 0
SIZE 4,1
GAP 0,0
CLS
TEXT 10,10,"3",0,1,1,"str1$:
"+str1$
TEXT 10,60,"3",0,1,1,"Location:"+STR$(location)
PRINT 1
EOP
TEST
125
FREAD$( )
Description
This function reads a specified number of bytes of data from a file.
Syntax
FREAD$ (file handle,byte)
Parameter
file handle
byte
Description
0 or 1
Number of bytes to be read
Example
Sample code
Result
DOWNLOAD "DATA1",10,1234567890
DOWNLOAD "DATA2",15,ABCDEFGHIJKLMNO
DOWNLOAD "OPEN2.BAS"
SIZE 4,1
GAP 0,0
DIRECTION 1
CLS
OPEN "DATA1",0
OPEN "DATA2",1
SEEK 0,0
SEEK 1,0
Y$=FREAD$(0,6)
Z$=FREAD$(1,6)
TEXT 10,100,"3",0,1,1,"FREAD$(0,6) IS: "+Y$
TEXT 10,150,"3",0,1,1,"FREAD$(1,6) IS: "+Z$
PRINT 1
EOP
OPEN2
See Also
DOWNLOAD, EOP, OPEN, READ, EOF, LOF(), SEEK
126
PUT
Description
One byte is appended into file.
Syntax
PUT file handle,var1$[, var2$][,var3$][, ]
PUT file handle,var1[, var2][,var3][, ]
PUT file handle,var1$[, var2$][,var3][, ]
Parameter
file handle
var$
var
Description
0 or 1
Data is a character
Data is ASCII value
Note:
This command has been supported since V6.91 EZ and later firmware.
Example
Sample code
DOWNLOAD "DATA1",10,1234567890
DOWNLOAD "TEST.BAS"
str1$ = ""
str2$ = ""
OPEN "DATA1",0
SEEK 0,0
READ 0,str1$
PUT 0,"a","B",49
SEEK 0,0
READ 0,str2$
CLOSE 0
SIZE 4,0.5
GAP 0,0
CLS
TEXT 10, 10,"3",0,1,1,"Original data in DATA1: "+str1$
TEXT 10, 60,"3",0,1,1,"New data in Data1: "+str2$
PRINT 1
EOP
TEST
Result
See Also
DOWNLOAD, EOP, OPEN, READ, EOF, LOF(), SEEK, GET
127
GET
Description
Get one byte from file.
Syntax
GET file handle,var1$[,var2$][,var3$][, ]
GET file handle,var1[,var2][,var3][, ]
GET file handle,var1$[,var2$][,var3][, ]
Parameter
file handle
var$
var
Description
0 or 1
Get a character
Get ASCII value
Note:
This command has been supported since V6.91 EZ and later firmware.
Example
Sample code
DOWNLOAD "DATA1",10,1234567890
DOWNLOAD "TEST.BAS"
a$=""
b$=""
c=0
d$=""
e$=""
OPEN "DATA1",0
SEEK 0,0
GET 0,a$,b$,c
SEEK 0,0
FOR I=1 TO 5
GET 0,d$
e$=e$+d$
NEXT
SIZE 4,0.5
GAP 0,0
CLS
TEXT 10,10,"3",0,1,1,"The first 3 characters in DATA1: "+ a$+b$+" ("+STR$(c)+")"
TEXT 10,60,"3",0,1,1,"The first 5 characters in DATA1: "+e$
PRINT 1
EOP
TEST
Result
See Also
DOWNLOAD, EOP, OPEN, READ, EOF, LOF(), SEEK, PUT
TSC AUTO ID Technology Co., Ltd.
128
COPY
Description
Copy the existed file from CARD to FLASH.
Syntax
COPY [memory ID of source,]"filename of source",[memory ID of new file,]"new filename"
Parameter
memory ID of source
Description
Optional.
ID
Omitted
F
E
source filename
memory ID of new file
new filename
Memory device
DRAM
FLASH
CARD
Memory device
DRAM
FLASH
Note: This command has been supported since V6.78 EZ and later firmware.
Example
Sample Code
DOWNLOAD "DATA_D.DAT",105,We stand behind our products with one of the most comprehensive support
programs in the Auto-ID industry.
DOWNLOAD "TEST.BAS"
KILL F,"*"
COPY "DATA_D.DAT",F,"DATA_F.DAT"
OPEN "DATA_F.DAT",0
SEEK 0,0
data$=FREAD$(0,LOF("DATA_F.DAT"))
CLOSE 0
SIZE 4,0.5
GAP 0,0
CLS
BOX 10,10,800,100,2
BLOCK 15,15,790,90,"0",0,8,8,20,2,data$
PRINT 1
EOP
TEST
Result
203 dpi
300 dpi
See Also
DOWNLOAD, EOP, OPEN, FREAD$(), EOF, LOF(), SEEK, CLOSE
TSC AUTO ID Technology Co., Ltd.
129
FORNEXT LOOP
Description
Loop is used to execute one or more lines of program repetitively. A loop counter value specifies the
number of executions. Nested loops are allowed (up to 39 nested loops) in this printer. Jumping out in
the middle of the FORNEXT loop is prohibited.
Syntax
FOR variable = start TO end STEP increment
statement; start < end
[EXITFOR]
NEXT
Parameter
variable
start
end
increment
EXITFOR
Description
The variable name is (up to 8 characters)
Integer or floating point numbers
Integer of floating point numbers
Integer or floating point, positive or negative
Exit for loop
Example
Sample code
Result
DOWNLOAD "TEST.BAS"
SIZE 4,2.5
GAP 0,0
CLS
FOR I=1 TO 10 STEP 1
TEXT 100,10+30*(I-1),"3",0,1,1,STR$(I)
NEXT
FOR I=1 TO 1000 STEP 100
TEXT 200,10+((I-1)/10)*3,"3",0,1,1,STR$(I)
NEXT
FOR I=110 TO 10 STEP -10
TEXT 300,10+(ABS(I-110))*3,"3",0,1,1,STR$(I)
NEXT
FOR I=1 TO 5 STEP 0.5
IF I-INT(I)=0 THEN Y=10+60*(I-1) ELSE Y=Y+30
TEXT 400,Y,"3",0,1,1,STR$(I)
NEXT
PRINT 1
EOP
TEST
See Also
DOWNLOAD, EOP
130
WHILEWEND
Description
Executes a series of statements as long as a given condition is True. Nested loops are allowed (up to 39
nested loops) in this printer.
Syntax
WHILE condition
[statement]
WEND
Parameter
condition
Description
Available relational operator: <, >, =, <=, >=, <>
*Relational operator <>, not equal, was supported since V5.10 EZ.
statement
Note:
This command has been supported since V5.10 EZ and later firmware.
Example
Sample Code
Result
DOWNLOAD "TEST.BAS"
I=0
TOTAL=0
WHILE I<100
I=I+1
TOTAL=TOTAL+I
WEND
SIZE 4,0.5
GAP 0,0
CLS
TEXT 10,10,"3",0,1,1,"1+2+3+ ... + 100 = " +STR$(TOTAL)
PRINT 1
EOP
TEST
DOWNLOAD "TEST.BAS"
data$ =""
SIZE 4,0.3
GAP 0,0
DIRECTION 1
INPUT "Data:",data$
WHILE data$ <> "Quit"
CLS
TEXT 10,10,"3",0,1,1,"Data: "+data$
PRINT 1
INPUT "Data:",data$
WEND
CLS
TEXT 10,10,"3",0,1,1,"Quit BAS"
PRINT 1
EOP
TEST
12345
67890
quit
Quit
TSC AUTO ID Technology Co., Ltd.
131
DOLOOP
Description
Repeats a block of statement while a condition is True.
Syntax
DO
[statement]
[EXITDO]
[statement]
LOOP
DO WHILE condition
[statement]
[EXITDO]
[statement]
LOOP
DO UNTIL condition
[statement]
[EXITDO]
[statement]
LOOP
DO
[statement]
[EXITDO]
[statement]
LOOP WHILE condition
DO
[statement]
[EXITDO]
[statement]
LOOP UNTIL condition
Parameter
condition
Description
Available relational operator: <, >, =, <=, >=, <>
*Relational operator <>, not equal, was supported since V5.10 EZ.
statement
EXITDO
Note:
This command has been supported since V5.10 EZ and later firmware.
132
Example
Sample Code
DOWNLOAD "TEST.BAS"
I=0
TOTAL=0
DO
I=I+1
TOTAL=TOTAL+I
IF I=100 THEN EXITDO
LOOP
SIZE 4,0.5
GAP 0,0
CLS
TEXT 10,10,"3",0,1,1,"1+2+3+ ... + 100 = " +
STR$(TOTAL)
PRINT 1
EOP
TEST
Result
DOWNLOAD "TEST.BAS"
I=0
TOTAL=0
DO WHILE I<=100
TOTAL=TOTAL+I
I=I+1
LOOP
SIZE 4,0.5
GAP 0,0
CLS
TEXT 10,10,"3",0,1,1,"1+2+3+ ... + 100 = " +
STR$(TOTAL)
PRINT 1
EOP
TEST
DOWNLOAD "TEST.BAS"
I=0
TOTAL=0
DO UNTIL I>100
TOTAL=TOTAL+I
I=I+1
LOOP
SIZE 4,0.5
GAP 0,0
CLS
TEXT 10,10,"3",0,1,1,"1+2+3+ ... + 100 = " +
STR$(TOTAL)
PRINT 1
EOP
TEST
133
DOWNLOAD "TEST.BAS"
I=0
TOTAL=0
DO
TOTAL=TOTAL+I
I=I+1
LOOP WHILE I<101
SIZE 4,0.5
GAP 0,0
CLS
TEXT 10,10,"3",0,1,1,"1+2+3+ ... + 100 = " +
STR$(TOTAL)
PRINT 1
EOP
TEST
DOWNLOAD "TEST.BAS"
I=0
TOTAL = 0
DO
TOTAL = TOTAL + I
I=I+1
LOOP UNTIL I>100
SIZE 4,0.5
GAP 0,0
CLS
TEXT 10,10,"3",0,1,1,"1+2+3+ ... + 100 = " +
STR$(TOTAL)
PRINT 1
EOP
TEST
134
IFTHENELSEENDIF
LOOP
Description
Use IFTHEN block to execute one or more statements conditionally. Either a single-line syntax or
multiple-line block syntax can be used:
Support
MODEL
single-line form
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
TTP-243 series
TTP-243 Plus series
TTP-244ME series
TTP-244ME Plus series
TTP-244 series
TTP-244CE series
TTP-245 series
TTP-245C series
TDP-245 series
TTP-246M series
TTP-248M series
TTP-342 series
TTP-342 Plus series
TTP-342M series
TTP-342M Plus series
TTP-343 series
TTP-343C series
TTP-344M series
TTP-346M series
TDP-643 Plus series
TDP-643R Plus series
TTP-2410M series
TTP-384M series
TTP-644M series
M23 series
multiple-line form
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
Syntax
IF condition THEN statement
Note the single-line form of IF THEN does not use an ENDIF statement.
Or
IF condition THEN
Statements
ENDIF
Or
IF condition THEN
Statements
ELSE
Statements
ENDIF
Or
IF condition 1 THEN
Statement block 1
ELSEIF condition 2 THEN
Statement block 2
135
ELSEIF condition n THEN
Statement block n
ENDIF
*The syntax of IFTHENELSE requires that the command be typed in one single line in less than 255
characters.
Parameter
condition
Description
Available relational operator: <, >, =, <=, >=, <>
*Relational operator <>, not equal, was supported since V5.10 EZ.
statement
Example
Sample Code
Result
DOWNLOAD "DEMO.BAS"
SIZE 4,4
GAP 0,0
DIRECTION 1
CLS
A=0
B=0
C=0
D=0
E=0
F=0
G=0
H=0
J=0
K=0
L=0
FOR I=1 TO 100
IF I-INT(I/1)*1=0 THEN A=A+I
IF I-INT(I/2)*2=1 THEN B=B+I ELSE C=C+I
IF I-INT(I/3)*3=0 THEN
D=D+I
ENDIF
IF I-INT(I/5)*5=0 THEN
E=E+I
ELSE
F=F+I
ENDIF
IF I-INT(I/7)*7=0 THEN
G=G+I
ELSEIF I-INT(I/17)*17=0 THEN
H=H+I
ELSEIF I-INT(I/27)*27=0 THEN
J=J+I
ELSEIF I-INT(I/37)*37=0 THEN
K=K+I
ELSE
L=L+I
ENDIF
TSC AUTO ID Technology Co., Ltd.
136
NEXT
TEXT 100,110,"3",0,1,1,"(1) 1+2+3+...+100="+STR$(A)
TEXT 100,160,"3",0,1,1,"(2) 1+3+5+...+99="+STR$(B)
TEXT 100,210,"3",0,1,1,"(3) 2+4+6+...+100="+STR$(C)
TEXT 100,260,"3",0,1,1,"(4) 3+6+9+...+99="+STR$(D)
TEXT 100,310,"3",0,1,1,"(5)
5+10+15+...+100="+STR$(E)
TEXT 100,360,"3",0,1,1,"
(1)-(5)="+STR$(F)
TEXT 100,410,"3",0,1,1,"(6) 7+14+21+...+98="+STR$(G)
TEXT 100,460,"3",0,1,1,"(7)
17+34+51+...+85="+STR$(H)
TEXT 100,510,"3",0,1,1,"(8) 27+54+...+81="+STR$(J)
TEXT 100,560,"3",0,1,1,"(9) 37+74="+STR$(K)
TEXT 100,610,"3",0,1,1,"
(1)-(6)-(7)-(8)-(9)="+STR$(L)
PRINT 1,1
EOP
DOWNLOAD F,"TEST.BAS"
SIZE 4,1
GAP 0,0
DIRECTION 1
CLS
A=85
B=10
:START
IF A<100 THEN GOTO L1 ELSE GOTO L2
:L1
CLS
TEXT 100,10,"3",0,1,1,STR$(A) + " IS SMALLER THEN
100"
PRINT 1
A=A+B
GOTO START
ENDIF
:L2
CLS
TEXT 100,10,"3",0,1,1,STR$(A) + " IS LAGER THEN 100"
PRINT 1
EOP
TEST
Note:
If the result of the expression is nonzero, the statement following THEN will be executed. If the result
of the expression is zero, and the statement following the ELSE
is present, it will be executed.
Otherwise the next line of statement is executed.
If there are block of statements in IFTHEN ELSE, ENDIF must be used at the end of the
IFTHEN ELSE statement.
Limitations:
The total numbers of nested IF THEN ELSE statement in a program cannot
TSC AUTO ID Technology Co., Ltd.
137
exceed 40.
The total numbers of nested IF THEN ELSE, FORNEXT, GOSUB RETURN in a program cannot
exceed 40 loops.
See Also
DOWNLOAD, EOP
138
GOSUBRETURN
Description
This command will branch to a subroutine, executing statements until RETURN is reached.
Syntax
GOSUB LABEL
statement
END
:LABEL
statement
RETURN
Parameter
LABEL
Description
Beginning of the subroutine. The maximum length of the label is 8
characters.
Example
Sample code
Result
DOWNLOAD "GOSUB1.BAS"
SIZE 4,3
GAP 0,0
DIRECTION 1
CLS
TEXT 10,10,"3",0,1,1,"GOSUB & RETURN COMMAND TEST"
GOSUB DR_BOX
PRINT 1
END
:DR_BOX
FOR I=21 TO 81 STEP 10
BOX 80+I,80+I,80+300-I,80+300-I,5
NEXT
RETURN
EOP
GOSUB1
See Also
DOWNLOAD, EOP, END, GOTO
139
GOTO
Description
This command is used to branch to a specified label. The label cannot exceed 8 characters in length.
Syntax
GOTO LABEL
:LABEL
Parameter
LABEL
Description
Beginning of the point. The maximum length of the label is 8 characters.
Example
Sample code
Result
DOWNLOAD "GOTO1.BAS"
SIZE 4,3
GAP 0,0
DIRECTION 1
CLS
A=0
TOTAL=0
:START
IF A<100 THEN
GOTO SUM
ELSE
GOTO PRTOUT
ENDIF
:SUM
A=A+1
TOTAL=TOTAL+A
GOTO START
:PRTOUT
B$="THE SUMMATION OF 1..100 IS
"+STR$(TOTAL)
TEXT 10,100,"3",0,1,1,B$
PRINT 1
END
EOP
See Also
DOWNLOAD, EOP, END, GOSUBRETURN
140
INP$( )
Description
One byte is received from communication port.
Syntax
INP$(n)
Parameter
N
Description
1: com1 port in printer
Example
Sample code
DOWNLOAD "TEST.BAS"
T$=""
FOR I=1 TO 5
T$=T$+INP$(1)
NEXT
SIZE 4,0.5
GAP 0,0
CLS
TEXT 10,10,"3",0,1,1,"The received data is: "+T$
PRINT 1
EOP
TEST
12345
Result
See Also
INP()
141
INP( )
Description
One byte (ASCII value) is received from communication port.
Syntax
INP(n)
Parameter
n
Description
1: com1 port in printer
Note:
This command has been supported since V6.91 EZ and later firmware.
Example
Sample code
DOWNLOAD "TEST.BAS"
ascii=0
str$=""
FOR I=1 TO 5
ascii=INP(1)
str$=str$+" "+STR$(ascii)
OUT ascii
NEXT
SIZE 4,0.5
GAP 0,0
CLS
TEXT 10,10,"3",0,1,1,"The received data is: "+str$
PRINT 1
EOP
TEST
12345
Result
See Also
INP$()
142
LOB( )
Description
This function returns the size of data in receiving buffer.
Syntax
LOB ()
Note:
This command has been supported since V6.78 EZ and later firmware.
Example
Sample Code
DOWNLOAD "TEST.BAS"
DATA$=""
WHILE LOB()<>0
DATA$=DATA$+INP$(1)
WEND
SIZE 4,0.5
GAP 0,0
CLS
BOX 10,10,800,100,2
BLOCK 15,15,790,90,"0",0,8,8,DATA$
PRINT 1
EOP
TEST
We stand behind our products with one of the most comprehensive support programs in the
Auto-ID industry.
Result
203 dpi:
300 dpi:
See Also
INP$(), WHILE WEND
143
INPUT
Description
This command receives data through specific port. This command is used with portable keyboard
KP-200.
Syntax
INPUT ["Prompt string", number of digits], variables
The comma also can be replaced by semicolon, such as:
INPUT ["Prompt string"; number of digits]; variables
Parameter
Prompt string
Number of digits
Variables
Description
The prompt string is shown on keyboard LCD screen. The maximum length
of prompt string is 20 characters
Maximum number of characters is 255
The variable to receive input data
Example
Sample code
Result
DOWNLOAD "TEXT.BAS"
SIZE 4,3
GAP 0,0
DIRECTION 1
:START
INPUT "CODE 39 :",C39$
INPUT "EAN 13:",12,E13$
CLS
TEXT 20,50,"3",0,1,1,"INPUT and KP-200 Test"
BARCODE 20,100,"39",48,1,0,2,5,C39$
BARCODE 20,200,"EAN13",48,1,0,4,4,E13$
PRINT 1
GOTO START
EOP
TEXT
123456
123456789012
See Also
DOWNLOAD, EOP, END, GOTO
144
PREINPUT
Description
This command can define the start character for command INPUT.
Syntax
PREINPUT var$
PREINPUT CHR$(n)
Parameter
var$
n
Description
The specific character or string in front of data.
n = 1 ~ 255
Note:
This command has been supported since V6.81 EZ and later firmware.
Example
PREINPUT "<"
PREINPUT CHR$(2)
See also
POSTINPUT, INPUT, SET FILTER
145
POSTINPUT
Description
This command can define the end character for command INPUT.
Syntax
POSTINPUT var$
POSTINPUT CHR$(n)
Parameter
var$
n
Description
The specific character or string in end of data.
n = 1 ~ 255
Note:
This command has been supported since V6.81 EZ and later firmware.
Example
POSTINPUT ">"
POSTINPUT CHR$(3)
See also
PREINPUT, INPUT, SET FILTER
146
Syntax
SET FILTER ON/OFF
Parameter
ON
OFF
Description
Enable PREINPUT and POSTINPUT
Disable PREINPUT and POSTINPUT
Note:
This command has been supported since V6.81 EZ and later firmware.
Example
Sample Code
Result
DOWNLOAD "TEST.BAS"
PREINPUT "<="
POSTINPUT "=>"
SET FILTER ON
START:
INPUT "DATA",data1$
SIZE 4,0.25
GAP 0,0
DIRECTION 1
CLS
TEXT 10,10,"3",0,1,1,"DATA = "+data1$
PRINT 1
GOTO START
EOP
TEST
<=1234=><=5678=><=9012=>
See also
PREINPUT, POSTINPUT, INPUT
147
REM
Description
Comment. Prefix is REM, which will be ignored by the printer.
Syntax
REM
Example
Sample code
REM ********************************
REM This is a demonstration program*
REM ********************************
DOWNLOAD "REMARK.BAS"
SIZE 4,3
GAP 0,0
DIRECTION 1
CLS
TEXT 50,50,"3",0,1,1,"REMARK DEMO PROGRAM"
REM TEXT 50,100,"3",0,1,1,"REMARK DEMO PROGRAM"
PRINT 1,1
EOP
REMARK
Result
See Also
DOWNLOAD, EOP, END
148
OUT
Description
This command returns data through the specific port.
Syntax
OUT [port] "prompt",variable
OUT [port] "prompt";variable
Parameter
port
prompt
variable
,
;
Description
Optional. Specified the port for returning data/string. Default is returning
the data/string from the port which is sending data to printer.
COM: Returning data/string from COM port.
USB: Returning data/string from USB port.
NET: Returning data/string from LAN port.
Prompt string.
The output message.
The "prompt" and "variable" are separated by <0x0D><0x0A>.
The "variable" comes behind "prompt" directly.
Note:
This command has been supported since V6.93 EZ and later firmware.
Example
Sample Code
OUT USB "USB: ";"This is returning data from USB."
OUT COM "COM";"This is returning data from COM."
OUT NET "NET:";"This is returning data from LAN."
Result
149
OUTR
Description
This command sends data through RS-232 port only.
Syntax
OUTR "prompt",variable
OUTR "prompt";variable
Parameter
prompt
variable
,
;
Description
Prompt string.
The output message.
The "prompt" and "variable" are separated by <0x0D><0x0A>.
The "variable" comes behinds "prompt" directly.
Note:
This command has been supported since V6.68 EZ and later firmware.
Example
Sample Code
OUTR "COM: ","This is returning data from RS-232 only."
Result
150
GETKEY( )
Description
This command is used to get the status of the PAUSE and FEED keys. This command waits until either
key is pressed, whereupon 0 is returned if PAUSE key is pressed and 1 is returned if FEED key is
pressed.
Syntax
GETKEY()
Model
TTP-2410M/TTP-346M Plus/TTP-248M/TTP-246M Plus/
TTP-344M Plus/TTP-384M /TTP-644M/TTP246M/344M/
TTP-244/TTP-244 Plus/TTP-243/TTP-342/TTP-243 PLUS/
TTP-342 PLUS/TTP-342M/TTP-244ME/TTP-342M PLUS/
TTP-244ME PLUS
TDP-643 PLUS/TDP-643R PLUS/TTP-245/343/TDP-245/
TTP-245C/343C/244CE
PAUSE
FEED
Example
Sample code
DOWNLOAD "DEMO4.BAS"
SIZE 4,3
GAP 0,0
CLS
:START
A=GETKEY()
IF A=0 THEN GOTO PAUSEB
IF A=1 THEN GOTO FEEDB
:PAUSEB
CLS
TEXT 50,10,"4",0,1,1,"PAUSE key is pressed !"
PRINT 1
GOTO START
:FEEDB
CLS
TEXT 50,10,"4",0,1,1,"FEED key is pressed !"
PRINT 1
EOP
See Also
DOWNLOAD, EOP, END, GOTO
151
INT( )
Description
This function truncates a floating point number.
Syntax
INT (n)
Parameter
n
Description
Positive or negative integer, floating point number or mathematical
expression
Example
Sample code
Result
DOWNLOAD "DEMO.BAS"
SIZE 4,1
GAP 0,0
DIRECTION 1
INPUT "Number:",Num
CLS
REM **** To round up or down****
N=INT(Num+0.5)
IF N>Num THEN
TEXT 50,100,"3",0,1,1,"To round up= "+STR$(N)
ELSE
TEXT 50,100,"3",0,1,1,"To round down= "+STR$(N)
ENDIF
PRINT 1
EOP
56.2
See Also
DOWNLOAD, EOP, END, ABS(), ASC(), STR$()
152
LEFT$( )
Description
This function returns the specified number of characters down from the initial character of a string.
Syntax
LEFT$ (X$, n)
Parameter
X$
n
Description
The string to be processed
The number of characters to be returned
Example
Sample code
Result
DOWNLOAD "TEST.BAS"
SIZE 4,1
GAP 0,0
DIRECTION 1
A$="BARCODE PRINTER DEMO PRINTING"
C$=LEFT$(A$,10)
CLS
TEXT 10,10,"3",0,1,1,A$
TEXT 10,100,"3",0,1,1,"10 LEFT 10 CHARS: "+C$
PRINT 1
EOP
TEST
See Also
DOWNLOAD, EOP, END, RIGHT$(), MID$(), LEN(), STR$()
153
LEN( )
Description
This function returns the length of a string.
Syntax
LEN (string)
Parameter
string
Description
The string whose length is to be measured.
Example
Sample Code
Result
DOWNLOAD "DEMO.BAS"
SIZE 4,1
GAP 0,0
DIRECTION 1
A$="ABCDEFGHIJKLMNOPQRSTUVWXYZ"
B=LEN(A$)
CLS
TEXT 10,10,"3",0,1,1,A$
TEXT 10,50,"3",0,1,1,"STRING LENGTH="+STR$(B)
PRINT 1
EOP
DEMO
See Also
DOWNLOAD, EOP, END, LEFT$(), LEN(), RIGHT$(), MID$(), STR$(), VAL()
154
MID$( )
Description
This function retrieves the specified number of characters down from the mth character of a string.
Syntax
MID$(string,m,n)
Parameter
string
m
n
Description
The string to be processed
The beginning of mth characters in the string
1 <= m <= string length
The number of characters to return
Example
Sample code
Result
DOWNLOAD "DEMO.BAS"
SIZE 4,1
GAP 0,0
DIRECTION 1
A$="ABCDEFGHIJKLMNOPQRSTUVWXYZ"
E$=MID$(A$,11,10)
CLS
TEXT 10,10,"3",0,1,1,A$
TEXT 10,200,"3",0,1,1,"10 MIDDLE CHARS: "+E$
PRINT 1
EOP
DEMO
See Also
DOWNLOAD, EOP, END, LEFT$(), LEN(), RIGHT$(), STR$(), VAL()
155
RIGHT$( )
Description
This function returns a specified number of characters up from the end of a string.
Syntax
RIGHT$ (X$,n)
Parameter
X$
n
Description
The string to be processed
The number of characters to be returned from the right side (end) of the
string
Example
Sample code
Result
DOWNLOAD "DEMO.BAS"
SIZE 4,1
GAP 0,0
DIRECTION 1
A$="ABCDEFGHIJKLMNOPQRSTUVWXYZ"
D$=RIGHT$(A$,10)
CLS
TEXT 10,10,"3",0,1,1,A$
TEXT 10,150,"3",0,1,1,"10 RIGHT CHARS: "+D$
PRINT 1
EOP
DEMO
See Also
DOWNLOAD, EOP, END, LEFT$(), LEN(), MID$(), STR$(), VAL()
156
STR$( )
Description
This function converts a specified value or expression into corresponding string of characters.
Syntax
STR$ (n)
Parameter
n
Description
An integer, floating point number or mathematical expression
Example
Sample code
Result
DOWNLOAD "DEMO.BAS"
SIZE 4,1
GAP 0,0
DIRECTION 1
A$="ABCDEFGHIJKLMNOPQRSTUVWXYZ"
F=100
G=500
H$=STR$(F+G)
CLS
TEXT 10,10,"3",0,1,1,A$
TEXT 10,60,"3",0,1,1,"F="+STR$(F)
TEXT 10,110,"3",0,1,1,"G="+STR$(G)
TEXT 10,160,"3",0,1,1,"F+G="+H$
PRINT 1
EOP
DEMO
See Also
DOWNLOAD, EOP, END, LEFT$(), LEN(), RIGHT$(), MID$(), VAL()
157
STRCOMP( )
Description
Returns -1, 0, or 1, based on the result of a string comparison.
Syntax
STRCOMP(str1$,str2$[,comp])
Parameter
str1$
str2$
comp
Description
Required. Any valid string expression.
Required. Any valid string expression.
Optional. Specifies the type of string comparison.
0: Binary comparison. Default.
1: Textual comparison. The comparison is case-insensitive.
Condition
str1$ sorts ahead of str2$
str1$ is equal to str2$
str1$ sorts after str2$
Return value
-1
0
1
Note:
This command has been supported since V6.81 EZ and later firmware.
Example
Sample Code
DOWNLOAD "TEST.BAS"
STR1$ = "ABCD"
STR2$ = "abcd"
result1 = STRCOMP(STR1$,STR2$)
result2 = STRCOMP(STR1$,STR2$,1)
result3 = STRCOMP(STR2$,STR1$)
SIZE 4,1
GAP 0,0
DIRECTION 1
CLS
TEXT 100,10,"3",0,1,1,STR$(result1)+": \["]"+STR1$+"\["] sorts ahead of \["]"+STR2$+"\["]"
TEXT 100,60,"3",0,1,1," "+STR$(result2)+": \["]"+STR1$+"\["] is equal to \["]"+STR2$+"\["]"
TEXT 100,110,"3",0,1,1," "+STR$(result3)+": \["]"+STR2$+"\["] sorts after \["]"+STR1$+"\["]"
PRINT 1
EOP
TEST
Result
See Also
INSTR()
TSC AUTO ID Technology Co., Ltd.
158
INSTR ( )
Description
Returns an integer specifying the start position of the first occurrence of one string within another.
Syntax
INSTR ([start,]str1$,str2$)
Parameter
start
str1$
str2$
Description
Optional. Numeric expression that sets the starting position for each search.
If omitted, search begins at the first character position. The stat index is 1 based.
Required. String expression being searched.
Required. String expression sought.
Note:
This command has been supported since V6.59 EZ and later firmware.
Example
Sample code
DOWNLOAD "DEMO.BAS"
string$="ABC123ABC123"
searchfor$="123"
starpos=8
temp1=INSTR(string$,searchfor$)
temp2=INSTR(starpos,string$,searchfor$)
str1$=searchfor$+" in "+string$+" is "+STR$(temp1)
str2$=searchfor$+" in "+string$+" after"+STR$(starpos)+" is "+STR$(temp2)
SIZE 4,1
GAP 0,0
DIRECTION 1
CLS
TEXT 10,10,"3",0,1,1,str1$
TEXT 10,60,"3",0,1,1,str2$
PRINT 1
EOP
DEMO
Result
See Also
STRCOMP()
159
TRIM$( )
Description
Removes both leading and trailing blank spaces or specific characters from a string.
Syntax
TRIM$ (str$[,list$])
Parameter
str$
list$
Description
The string that will be trimmed.
Optional. The specific characters in list$ will be removed.
Note:
This command has been supported since V6.59 EZ and later firmware.
Example
Sample Code
DOWNLOAD "DEMO.BAS"
data1$=" 1234567 "
data2$="a1234567a"
data3$="[<12345>]"
SIZE 4,1.5
GAP 0,0
DIRECTION 1
CLS
TEXT 50,020,"3",0,1,1,"LTRIM$(\["]"+data1$+"\["])
= "+LTRIM$(data1$)
TEXT 50,050,"3",0,1,1,"TRIM$ (\["]"+data1$+"\["])
= "+TRIM$(data1$)
TEXT 50,080,"3",0,1,1,"RTRIM$(\["]"+data1$+"\["])
= "+RTRIM$(data1$)
TEXT 50,110,"3",0,1,1,"LTRIM$(\["]"+data2$+ "\["], \["]a\["])
= "+LTRIM$(data2$,"a")
TEXT 50,140,"3",0,1,1,"TRIM$ (\["]"+data2$+ "\["], \["]a\["])
= "+TRIM$(data2$,"a")
TEXT 50,170,"3",0,1,1,"RTRIM$(\["]"+data2$+ "\["], \["]a\["])
= "+RTRIM$(data2$,"a")
TEXT 50,200,"3",0,1,1,"LTRIM$(\["]"+data3$+ "\["], \["][<>]\["]) = "+LTRIM$(data3$,"[<>]")
TEXT 50,230,"3",0,1,1,"TRIM$ (\["]"+data3$+ "\["], \["][<>]\["]) = "+TRIM$(data3$,"[<>]")
TEXT 50,260,"3",0,1,1,"RTRIM$(\["]"+data3$+ "\["], \["][<>]\["]) = "+RTRIM$(data3$,"[<>]")
PRINT 1
EOP
DEMO
Result
See Also
LTRIM$(), RTRIM$()
160
LTRIM$( )
Description
Removes leading blank space from a string.
Syntax
LTRIM$ (str$[,list$])
Parameter
str$
list$
Description
The string that will be trimmed.
Optional. The specific characters in list$ will be removed.
Note:
This command has been supported since V6.59 EZ and later firmware.
Example
Sample Code
DOWNLOAD "DEMO.BAS"
data1$=" 1234567 "
data2$="a1234567a"
data3$="[<12345>]"
SIZE 4,1.5
GAP 0,0
DIRECTION 1
CLS
TEXT 50,020,"3",0,1,1,"LTRIM$(\["]"+data1$+"\["])
="+LTRIM$(data1$)
TEXT 50,050,"3",0,1,1,"TRIM$ (\["]"+data1$+"\["])
="+TRIM$(data1$)
TEXT 50,080,"3",0,1,1,"RTRIM$(\["]"+data1$+"\["])
="+RTRIM$(data1$)
TEXT 50,110,"3",0,1,1,"LTRIM$(\["]"+data2$+"\["],\["]a\["])
="+LTRIM$(data2$,"a")
TEXT 50,140,"3",0,1,1,"TRIM$ (\["]"+data2$+"\["],\["]a\["])
="+TRIM$(data2$,"a")
TEXT 50,170,"3",0,1,1,"RTRIM$(\["]"+data2$+"\["],\["]a\["])
="+RTRIM$(data2$,"a")
TEXT 50,200,"3",0,1,1,"LTRIM$(\["]"+data3$+"\["],\["][<>]\["]) ="+LTRIM$(data3$,"[<>]")
TEXT 50,230,"3",0,1,1,"TRIM$ (\["]"+data3$+"\["],\["][<>]\["]) ="+TRIM$(data3$,"[<>]")
TEXT 50,260,"3",0,1,1,"RTRIM$(\["]"+data3$+"\["],\["][<>]\["]) ="+RTRIM$(data3$,"[<>]")
PRINT 1
EOP
DEMO
Result
See Also
TRIM$(), RTRIM$()
161
RTRIM$( )
Description
Removes trailing blank space from a string.
Syntax
RTRIM$ (str$ [, list$])
Parameter
str$
list$
Description
The string that will be trimmed.
Optional. The specific characters in list$ will be removed.
Note:
This command has been supported since V6.59 EZ and later firmware.
Example
Sample Code
DOWNLOAD "DEMO.BAS"
data1$=" 1234567 "
data2$="a1234567a"
data3$="[<12345>]"
SIZE 4,1.5
GAP 0,0
DIRECTION 1
CLS
TEXT 50,020,"3",0,1,1,"LTRIM$(\["]"+data1$+"\["])
= "+LTRIM$(data1$)
TEXT 50,050,"3",0,1,1,"TRIM$ (\["]"+data1$+"\["])
= "+TRIM$(data1$)
TEXT 50,080,"3",0,1,1,"RTRIM$(\["]"+data1$+"\["])
= "+RTRIM$(data1$)
TEXT 50,110,"3",0,1,1,"LTRIM$(\["]"+data2$+"\["], \["]a\["])
= "+LTRIM$(data2$,"a")
TEXT 50,140,"3",0,1,1,"TRIM$ (\["]"+data2$+"\["], \["]a\["])
= "+TRIM$(data2$,"a")
TEXT 50,170,"3",0,1,1,"RTRIM$(\["]"+data2$+"\["], \["]a\["])
= "+RTRIM$(data2$,"a")
TEXT 50,200,"3",0,1,1,"LTRIM$(\["]"+data3$+"\["], \["][<>]\["]) = "+LTRIM$(data3$,"[<>]")
TEXT 50,230,"3",0,1,1,"TRIM$ (\["]"+data3$+"\["], \["][<>]\["]) = "+TRIM$(data3$,"[<>]")
TEXT 50,260,"3",0,1,1,"RTRIM$(\["]"+data3$+"\["], \["][<>]\["]) = "+RTRIM$(data3$,"[<>]")
PRINT 1
EOP
DEMO
Result
See Also
TRIM$(), LTRIM$()
162
TEXTPIXEL( )
Description
Returns the width of the text string in dot.
Syntax
TEXTPIXEL (cont$,font$,size)
Parameter
cont$
font $
size
Description
The content of text string.
The font type. Please refer to the parameter font in command TEXT.
The font size. Please refer to the parameter x-multiplication in command
TEXT.
Note:
This command has been supported since V6.61 EZ and later firmware.
Example
Sample code
Result
DOWNLOAD "TEST.BAS"
str$="ABCDEFG"
font$="3"
fontsize=3
strwidth=TEXTPIXEL(str$,font$,fontsize)
SIZE 4,1
GAP 0,0
DIRECTION 1
CLS
TEXT 10,10,font$,0,fontsize,fontsize,str$
REVERSE 8,8,strwidth,72
PRINT 1
EOP
TEST
See Also
TEXT, BARCODEPIXEL()
163
BARCODEPIXEL( )
Description
Returns the width of barcode in dot.
Syntax
BARCODEPIXEL (cont$, sym$, narrow, wide)
Parameter
cont$
sym $
narrow
wide
Description
The content of barcode.
Barcode type. Please refer to the parameter code type in command
BARCODE.
The width of narrow bar. Please refer to the parameter narrow in command
BARCODE.
The width of wide bar. Please refer to the parameter wide in command
BARCODE.
Note:
This command has been supported since V6.72 EZ and later firmware.
Example
Sample code
Result
DOWNLOAD "TEST.BAS"
cont$="ABCDEFG"
sym$="39"
narrow=2
wide=6
codewidth=BARCODEPIXEL(cont$,sym$,narrow,wide)
SIZE 4,1.5
GAP 0,0
DIRECTION 1
CLS
BARCODE 10,10,sym$,100,1,0,narrow,wide,cont$
REVERSE 8,8,codewidth+8,132
BARCODE 10,160,sym$,100,1,0,narrow,wide,cont$
PRINT 1
EOP
TEST
See Also
BARCODE, TEXTPIXEL()
164
VAL( )
Description
This function converts numeric characters into corresponding integer or floating point number.
Syntax
VAL ("numeric character")
Parameter
numeric character
Description
"0~9", "."
Example
Sample code
Result
DOWNLOAD "DEMO.BAS"
SIZE 4,1
GAP 0,0
DIRECTION 1
A$="ABCDEFGHIJKLMNOPQRSTUVWXYZ"
F$="100"
G$="500"
CLS
H=VAL(F$)+VAL(G$)
I$=STR$(H)
TEXT 10,10,"3",0,1,1,A$
TEXT 10,60,"3",0,1,1,"F="+F$
TEXT 10,110,"3",0,1,1,"G="+G$
TEXT 10,160,"3",0,1,1,"F+G="+I$
PRINT 1
EOP
DEMO
See Also
DOWNLOAD, EOP, END, LEFT$(), LEN(), RIGHT$(), MID$(), STR$()
165
BEEP
Description
This command issues a beep sound on portable keyboard. Printer sends the string 0x07 to KP-200
portable keyboard.
Syntax
BEEP
Example
Sample code
DOWNLOAD "DEMO.BAS"
SIZE 4,4
GAP 0,0
DIRECTION 1
BEEP
INPUT "Text1 =",TEXT1$
CLS
TEXT 100,100,"3",0,1,1,TEXT1$
PRINT 1
EOP
166
NOW$( )
Description
Returns the current date and time according to the setting of your printer. The returned value always
uses with commands FORMAT$().
Syntax
NOW$( )
Note:
This command has been supported since V6.81 EZ and later firmware.
Example
Sample code
SIZE 4,1
GAP 0,0
DIRECTION 1
CLS
TEXT 10,10,"3",0,1,1,"Now is "+NOW$( )
TEXT 10,60,"3",0,1,1,FORMAT$(NOW$(),"Long Date")
PRINT 1
Result
167
NOW
Description
Returns the total days since A.D. 1900. This global variable always uses with commands FORMAT$()
and DATEADD().
Syntax
NOW
Note:
This command has been supported since V6.87 EZ and later firmware.
Example
Sample Code
SIZE 4,1
GAP 0,0
DIRECTION 1
CLS
TEXT 10,10,"3",0,1,1,"Total days since a.d. 1900: "+STR$(NOW)+" days"
TEXT 10,50,"3",0,1,1,"Date Info in RTC: "+FORMAT$(NOW, "General Date")
TEXT 10,90,"3",0,1,1,"Date after a year: "+FORMAT$(DATEADD("yyyy",1,NOW),"General Date")
PRINT 1
Result
168
FORMAT$( )
Description
Returns the current date and time according to the setting of your printer.
Syntax
FORMAT$(expression[,style$])
Parameter
expression
style$
Description
Required. Any valid expression.
Optional. A valid named or user-defined format string expression.
Predefined
date/time format
General Date
Long Date
Medium Date
Short Date
Long Time
Medium Time
Short Time
User-defined
date/time formats
c
d
dd
ddd
dddd
ddddd
dddddd
w
ww
m
mm
mmm
mmmm
q
y
yy
yyyy
h
hh
n
nn
s
ss
ttttt
AM/PM
am/pm
Description
Shows date and time.
Uses the Long Date format.
Uses the dd-mmm-yy format.
Uses the Short Date format.
Shows the hour, minute, second, and "AM" or "PM" using the h:mm:ss format.
Shows the hour, minute, and "AM" or "PM" using the "hh:mm AM/PM" format.
Shows the hour and minute using the hh:mm format.
Description
Display the date as ddddd and display the time as ttttt, in that order.
Display the day as a number without a leading zero (1 - 31).
Display the day as a number with a leading zero (01 - 31).
Display the day as an abbreviation (Sun - Sat).
Display the day as a full name (Sunday - Saturday).
Display a date serial number as a complete date (including day, month, and
year), formatted according to your system's short date format setting. The
default short date format is m/d/yyyy.
Display the date as a complete date (including day, month, and year),
formatted according to the long date setting recognized by your system. The
default long date format is dddd, mmmm dd, yyyy.
Display the day of the week as a number (1 for Sunday through 7 for Saturday).
Display the week of the year as a number (1 - 53).
Display the month as a number without a leading zero (1 - 12). If m
immediately follows h or hh, the minute rather than the month is displayed.
Display the month as a number with a leading zero (01 - 12). If mm
immediately follows h or hh, the minute rather than the month is displayed.
Display the month as an abbreviation (Jan - Dec).
Display the month as a full month name (January - December).
Display the quarter of the year as a number (1 - 4).
Display the day of the year as a number (1 - 366).
Display the year as a 2-digit number (00 - 99).
Display the year as a 4-digit number (100 - 9999).
Display the hour as a number without leading zeros (0 - 23).
Display the hour as a number with leading zeros (00 - 23).
Display the minute as a number without leading zeros (0 - 59).
Display the minute as a number with leading zeros (00 - 59).
Display the second as a number without leading zeros (0 - 59).
Display the second as a number with leading zeros (00 - 59).
Display a time as a complete time (including hour, minute, and second). The
default time format is h:mm:ss AM/PM.
Display an uppercase AM with any hour before noon; display an uppercase PM
with any hour between noon and 11:59 P.M.
Display a lowercase AM with any hour before noon; display a lowercase PM
with any hour between noon and 11:59 P.M.
169
A/P
a/p
AMPM
\
"string"
Display an uppercase A with any hour before noon; display an uppercase P with
any hour between noon and 11:59 P.M.
Display a lowercase A with any hour before noon; display a lowercase P with
any hour between noon and 11:59 P.M.
AMPM can be either uppercase or lowercase, but the case of the string
displayed matches the string as defined by your system settings.
Display the next character in the format string.
Display the string inside the double quotation marks.
Note:
This command has been supported since V6.81 EZ and later firmware.
Example
Sample Code
Result
170
DATEADD()
Description
Returns a date after which a specified time/date interval has been added. The returned value always
uses with commands FORMAT$().
Syntax
DATEADD(interval$,number,date)
Parameter
interval$,
Description
The time/date interval for adding. It can be one of following values.
interval$
"yyyy"
"q"
"m"
"y"
"d"
"w"
"ww"
"h"
"n"
"s"
number
date
Note:
This command has been supported since V6.87 EZ and later firmware.
Example
Sample Code 1
SIZE 4,2
GAP 0,0
DIRECTION 1
CLS
TEXT 10,10,"3",0,1,1,"Current RTC info: "+NOW$()
TEXT 10,60,"3",0,1,1,"-1 year: "+FORMAT$(DATEADD("yyyy",-1,"11/26/2012 10:08:00"),"yyyy/mm/dd hh:nn:ss")
TEXT 10,110,"3",0,1,1,"+9 months: "+FORMAT$(DATEADD("m",9,NOW),"Short Date")
TEXT 10,160,"3",0,1,1,"-8 hours: "+FORMAT$(DATEADD("h",-8,NOW),"Short Time")
TEXT 10,210,"3",0,1,1,"+5 mins: "+FORMAT$(DATEADD("n",5,NOW),"Short Time")
TEXT 10,260,"3",0,1,1,"+00 day: "+FORMAT$(NOW,"Short Date")
TEXT 10,310,"3",0,1,1,"+20 days: "+FORMAT$(DATEADD("d",20,NOW),"Short Date")
TEXT 10,360,"3",0,1,1,"-20 day: "+FORMAT$(DATEADD("d",-20,NOW),"Short Date")
PRINT 1
Result 1
171
Sample Code 2
SIZE 4,2
GAP 0,0
DIRECTION 1
CLS
TEXT 10,60,"3",0,1,1,"-1 year:
"+FORMAT$(DATEADD("yyyy", -1,"11/26/2012 10:08"),"yyyy/mm/dd hh:nn AM/PM")
TEXT 10,110,"3",0,1,1,"+9 months: "+FORMAT$(DATEADD("m",9,"11/26/2012 10:08"),"yyyy/mm/dd hh:nn AM/PM")
TEXT 10,160,"3",0,1,1,"+8 hours: "+FORMAT$(DATEADD("h", +8,"11/26/2012 10:08"),"yyyy/mm/dd hh:nn AM/PM")
TEXT 10,210,"3",0,1,1,"+00 day:
"+FORMAT$("11/26/2012 10:08:00","yyyy/mm/dd hh:nn AM/PM")
TEXT 10,260,"3",0,1,1,"+20 days: "+FORMAT$(DATEADD("d",20,"11/26/2012 10:08"),"yyyy/mm/dd hh:nn AM/PM")
TEXT 10,310,"3",0,1,1,"-20 days: "+FORMAT$(DATEADD("d", -20,"11/26/2012 10:08"),"yyyy/mm/dd hh:nn AM/PM")
PRINT 1
Result 2
172
Syntax
SET COUNTER @n step
@n="Expression"
Parameter
@n
step
Expression
Description
n: counter number. There are 61 counters available (@0 ~ @60) in the
printer. @0 to @50 will be cleared while restarting the printer. @51 to @60
will be stored in printer until the printer is restored to factory default.
@51~@55 were supported since V6.37 EZ.
@56~@60 were supported since V6.74 EZ.
The increment of the counter, can be positive or negative.
-999999999 <= step <= 999999999
If the counter is used as a fixed variable, please set the increment to 0.
Initial string. String length is 101 bytes
Example
Sample Code
Result
See Also
PRINT, TEXT, BARCODE
173
SET CUTTER
Description
This setting activates or deactivates the cutter and defines how many printed labels is to be cut at one
time. This setting will be saved in printer memory after turning off the power.
Syntax
SET CUTTER OFF/BATCH/pieces
Parameter
OFF
BATCH
Pieces
Description
Disable cutter function.
Set printer to cut label at the end of printing job.
Set number of printing labels per cut. 0<= pieces <=65535
Note:
Care label cutter module was supported since V6.86 EZ in industrial printer TTP-2410M series.
Since V6.86 EZ, if cutter is not installed, the cutter error doesnt happen even SET CUTTER ON is
set.
Example
Sample code
Result
SIZE 3,3
GAP 0,0
SET CUTTER OFF
SET PEEL OFF
CLS
TEXT 50,50,"3",0,1,1,"SET CUTTER OFF"
PRINT 3
SET CUTTER 1
CLS
TEXT 50,50,"3",0,1,1,"SET CUTTER 1"
PRINT 3,2
CLS
TEXT 50,50,"3",0,1,1,"SET CUTTER 2"
PRINT 3,2
See Also
OFFSET, PRINT, SET PARTIAL_CUTTER
174
SET PARTIAL_CUTTER
Description
This setting activates or deactivates the cutter and defines how many printed labels is to be cut at one
time. This setting will be saved in printer memory after turning off the power. This function prevents
label back feeding after a cut.
Syntax
SET PARTIAL_CUTTER OFF/BATCH/pieces
Parameter
OFF
BATCH
Pieces
Description
Disable cutter function.
Set printer to cut label at the end of printing job.
Set number of printing labels per cut. 0<= pieces <=65535
Model
Support
TTP-243 series
TTP-243 Plus series
TTP-244ME series
TTP-244ME Plus series
TTP-244 series
TTP-244CE series
TTP-245 series
TTP-245C series
TDP-245 series
TTP-246M series
TTP-248M series
TTP-2410M series
TDP-643 Plus
TDP-643R Plus
TTP-342 series
TTP-342 Plus series
TTP-342M series
TTP-342M Plus series
TTP-343 series
TTP-343C series
TTP-344M series
TTP-346M series
TTP-384M series
TTP-644M series
M23 series
V
V
V
V
V
Example
Sample code
REM **SET PARTIAL_CUTTER FUNCTION OFF EXAMPLE PROGRAM**
SIZE 3,1
GAP 0,0
DENSITY 8
SPEED 6
DIRECTION 0
REFERENCE 0,0
SET PARTIAL_CUTTER OFF
CLS
TSC AUTO ID Technology Co., Ltd.
175
See Also
OFFSET, PRINT, SET CUTTER
176
SET BACK
Description
This setting is used after SET CUTTER function. This function prevents label backfeeding after a cut.
Syntax
SET BACK OFF/ON
Parameter
OFF
ON
Description
Disable back function.
Enable back function.
Model
Support
TTP-243 series
TTP-243 Plus series
TTP-244ME series
TTP-244ME Plus series
TTP-244 series
TTP-244CE series
TTP-245 series
TTP-245C series
TDP-245 series
TTP-246M series
TTP-248M series
TTP-2410M series
TDP-643 Plus
TDP-643R Plus
TTP-342 series
TTP-342 Plus series
TTP-342M series
TTP-342M Plus series
TTP-343 series
TTP-343C series
TTP-344M series
TTP-346M series
TTP-384M series
TTP-644M series
M23 series
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
Example
Sample code
REM **SET BACK FUNCTION OFF EXAMPLE PROGRAM**
SIZE 3,1
GAP 0,0
DENSITY 8
SPEED 6
DIRECTION 1
REFERENCE 0,0
SET CUTTER 1
SET BACK OFF
CLS
TEXT 50,50,"3",0,1,1,"SET BACK OFF"
PRINT 3
CLS
TSC AUTO ID Technology Co., Ltd.
177
SET CUTTER 1
SET BACK ON
TEXT 50,50,"3",0,1,1,"SET BACK ON"
PRINT 3
See Also
OFFSET, PRINT, SET CUTTER
178
Syntax
SET KEY1 ON/OFF
SET KEY2 ON/OFF
SET KEY3 ON/OFF
Parameter
ON
OFF
Model
TTP-243 series
TTP-243 Plus series
TTP-244ME series
TTP-244ME Plus series
TTP-244 series
TTP-244C series
TTP-245 series
TTP-245C series
TDP-245 series
TTP-246M series*
TTP-248M series
TTP-2410M series
TDP-643 Plus
TDP-643R Plus
TTP-342 series
TTP-342 Plus series
TTP-342M series
TTP-342M Plus series
TTP-343 series
TTP-343C series
TTP-344M series*
TTP-346M series
TTP-384M series
TTP-644M series
M23 series
Description
Enable KEYn function
Disable KEYn function
KEY0
FEED
KEY1
PAUSE
PAUSE
PAUSE
PAUSE
PAUSE
FEED
FEED
FEED
FEED
MENU
MENU
MENU
PAUSE
PAUSE
PAUSE
PAUSE
PAUSE
PAUSE
FEED
FEED
MENU
MENU
MENU
MENU
LEFT
KEY2
FEED
FEED
FEED
FEED
FEED
KEY3
KEY4
KEY5
KEY6
PAUSE
PAUSE
PAUSE
FEED
FEED
FEED
(UP)
(DOWN)
(SELECT)
UP
DOWN
SELECT
FEED
FEED
FEED
FEED
RIGHT
(UP)
UP
UP
UP
(DOWN)
DOWN
DOWN
DOWN
(SELECT)
SELECT
SELECT
SELECT
FEED
FEED
FEED
FEED
PAUSE
PAUSE
PAUSE
PAUSE
MID
* For TTP-246M Plus and TTP-344M Plus, there are 6 buttons on the control panel.
Example
Sample code
DOWNLOAD "DEMO.BAS"
SIZE 3,1
GAP 0,0
DENSITY 8
SPEED 3
DIRECTION 0
REFERENCE 0,0
TSC AUTO ID Technology Co., Ltd.
179
See Also
OFFEST, PRINT
180
Syntax
SET LED1 ON/OFF
SET LED2 ON/OFF
SET LED3 ON/OFF
LED no.
LDE1
LED2
LED3
Default Function
Power on/off
Printer on-line/off-line
Erroe/normal
Parameter
ON
OFF
Description
Enable LEDn function
Disable LEDn function
LED1
POWER
POWER
POWER
POWER
POWER
GREEN
GREEN
GREEN
GREEN
POWER
POWER
POWER
ONLINE
ONLINE
POWER
POWER
POWER
POWER
GREEN
GREEN
POWER
POWER
POWER
POWER
LED2
ONLINE
ONLINE
ONLINE
ONLINE
ONLINE
GREEN
GREEN
GREEN
GREEN
ONLINE
ONLINE
ONLINE
ERROR
ERROR
ONLINE
ONLINE
ONLINE
ONLINE
GREEN
GREEN
ONLINE
ONLINE
ONLINE
ONLINE
LED3
ERROR
ERROR
ERROR
ERROR
ERROR
RED
RED
RED
RED
ERROR
ERROR
ERROR
ERROR
ERROR
ERROR
ERROR
ERROR
ERROR
RED
RED
ERROR
ERROR
ERROR
ERROR
ORANGE
ORANGE
ORANGE
ORANGE
ORANGE
ORANGE
Example
Sample code
DOWNLOAD "DEMO4.BAS"
SET LED1 OFF
SET LED2 OFF
SET LED3 OFF
TSC AUTO ID Technology Co., Ltd.
181
182
SET PEEL
Description
This setting is used to enable/disable the self-peeling function. The default setting for this function is
off. When this function is set on, the printer stops after each label printing, and does not print the next
label until the peeled label is taken away. This setting will be saved in printer memory when turning off
the power.
Syntax
SET PEEL ON/OFF
Parameter
ON
OFF
Description
Enable the self-peeling function
Disable the self-peeing function
Example
Sample code
REM ***SELF-PEELING FUNCTION ON***
SIZE 4,4
GAP 0,0
DENSITY 8
SPEED 6
DIRECTION 0
REFERENCE 0,0
SET CUTTER OFF
SET PEEL ON
CLS
TEXT 50,100,"3",0,1,1,"SELF-PEELING FUNCTION TEST"
PRINT 5
See Also
OFFEST, PRINT
183
Syntax
SET TEAR ON/OFF
SET STRIPER ON/OFF
Parameter
ON
OFF
MODEL
SET TEAR
TTP-243 series
TTP-243 Plus series
TTP-244ME series
TTP-244ME Plus series
TTP-244 series
TTP-244CE series
TTP-245 series
TTP-245C series
TDP-245 series
TTP-246M series
TTP-248M series
TTP-2410M series
TDP-643 Plus series
TDP-643R Plus series
TTP-342 series
TTP-342 Plus series
TTP-342M series
TTP-342M Plus series
TTP-343 series
TTP-343C series
TTP-344M series
TTP-346M series
TTP-384M series
TTP-644M series
M23
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
SET STRIPER
V
V
V
V
V
V
V
V
V
V
V
V
Example
Sample code
REM ***TEAR FUNCTION ON***
SIZE 3,3
GAP 0.08,0
DENSITY 8
SPEED 4
DIRECTION 0
REFERENCE 0,0
SET CUTTER OFF
TSC AUTO ID Technology Co., Ltd.
184
See Also
SET PEEL, SET CUTTER
185
SET GAP
Description
This setting sets the gap sensor emission sensitivity. The printer initiates automatic gap sensor
calibration when the PAUSE key is held down while powering up. This function may cease to work if
the thickness of the backing paper and that of label with backing paper are not of appreciable
difference to the sensor, or when there are pre-printed marks or patterns on the label. In such case,
users must calibrate the gap sensor manually by this command through trial-and-error method to
attain the proper setting. This setting will be saved in printer memory when turning off the power.
Syntax
SET GAP n/AUTO/OFF/0,/REVERSE/OBVERSE
Parameter
N
AUTO
OFF
0,
REVERSE
OBVERSE
Description
Gap sensor light emission strength. Available range is listed as below. 0 is
the lowest sensitivity
The printer will feed 2 or 3 labels to calibrate the gap. If the label is
continuous, the printer will feed label to limit 10~20 inches to confirm if the
label is continuous.
Disable the SET GAP AUTO function.
Automatically calibrate the gap size.
This function is used when the Black Mark is the separation in the front of
the label and which cant be detected by the Black Mark sensor. The parts
of the media which can be passed through by GAP sensor are defined to be
the printable area, otherwise it will be defined to the GAP of the media.
Disable the "SET GAP REVERSE" function.
Printer model
TTP-243 series
TTP-243 Plus series
TTP-243 Pro series
TTP-244 series
TTP-244 Plus series
TTP-244CE series
TTP-244ME series
TTP-244ME Plus series
TTP-245/343 series
TTP-245 Plus/343 Plus series
TTP-245C/343C series
TDP-245 series
TDP-245 Plus series
TTP-246M/344M series (non usb)
TTP-246M/344M series (usb)
TTP-246M Plus
TTP-248M series
TTP-2410M series
TDP-643 Plus series
TDP-643R Plus series
TTP-342 series
TTP-342M series
TTP-342 Plus series
TTP-344M Plus series
TTP-346M series
TTP-384M series
TTP-644M series
M23 series
TTP-225 series
0~15
0~255
0~63
0~255
0~63
0~31
0~15
0~255
0~63
0~15
0~31
0~63
0~15
0~63
0~31
0~7
0~255
0~7
0~15
0~255
0~15
0~15
0~255
0~7
0~7
0~7
0~7
0~255
0~31
ON/OFF
ON/OFF
ON/OFF
ON/OFF
ON/OFF
0~3
ON/OFF
ON/OFF
0~63
0~15
0~3
0~63
0~15
0~63
0~31
0~3
0~255
0~3
ON/OFF
ON/OFF
ON/OFF
ON/OFF
ON/OFF
0~3
0~3
0~3
0~3
0~255
0~3
186
TDP-225 series
0~31
0~3
Note:
When in SET HEAD OFF mode, the function SET GAP AUTO doesnt work even the printer head
is opened and closed, but it can work when power on the printer.
Example
The example below is operated in DOS environment via the parallel port connection to setup the
label size, gap distance and sensor sensitivity.
C:\>COPY CON LPT1<ENTER>
SIZE 4,2.5<ENTER>
GAP 0.12,0<ENTER>
SET GAP 1<ENTER>
<CTRL><Z><ENTER>
C:\>
Note:
<ENTER> stands for keyboard ENTER key. In the above example, please press ENTER key
instead of typing <ENTER> in the above example. <CTRL> stands for keyboard Ctrl key.
Troubleshooting:
Press the FEED key to test. Does printer stop at the same position on each label without the error
light blinking? If not, adjust the setting to a larger number. When adjusting this setting, begin from 0
and then on to higher values incrementally.
See Also
SIZE, GAP, BLINE
187
SET BLINE
Description
This setting is using to reverse/obverse the sensor function.
Syntax
SET BLINE REVERSE/OBVERSE
Parameter
REVERSE
OBVERSE
Description
Reverse the sensor function. Redefine the reflective area is black line and
non-reflective part is paper. (Normally, reflective part is paper and
non-reflective part is black line.)
Disable the "SET BLINE REVERSE" function.
188
SET HEAD
Description
This setting is used to enable/disable head open sensor. If the head open sensor is turned off, an open
printer head will not return an error message. This setting will be saved in printer memory. This
command is only available for BPL2 printers.
Syntax
SET HEAD ON /OFF
Parameter
ON
OFF
Description
Turn on the HEAD OPEN sensor
Turn off the HEAD OPEN sensor
Model
Support
TTP-243 series
TTP-243 Plus series
TTP-244ME series
TTP-244ME Plus series
TTP-244 series
TTP-244CE series
TTP-245 series
TTP-245C series
TDP-245 series
TTP-246M series
TTP-248M series
TTP-2410M series
TDP-643 Plus
TDP-643R Plus
TTP-342 series
TTP-342 Plus series
TTP-342M series
TTP-342M Plus series
TTP-343 series
TTP-343C series
TTP-344M series
TTP-346M series
TTP-384M series
TTP-644M series
M23 series
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
Example
SET HEAD ON
SET HEAD OFF
189
SET RIBBON
Description
This setting is used to enable/disable ribbon sensor detection. (Thermal Transfer Printing/Thermal
Direct Printing) Printer will detect the presence of a ribbon to determine using either direct thermal or
thermal transfer printing upon printer startup. This setting will NOT be saved in printer memory.
Syntax
SET RIBBON ON/OFF/INSIDE/OUTSIDE
Parameter
ON
OFF
INSIDE
OUTSIDE
Description
Thermal transfer printing
Thermal direct printing
The ribbon is inside wound. For TTP-384M only. *Since V6.80EZ.
The ribbon is outside wound. For TTP-384M only. *Since V6.80EZ.
Example
Sample Code
REM *****Disable ribbon detection sensor for direct thermal printing.
SET RIBBON OFF
SIZE 4,1
GAP 0,0
CLS
TEXT 10,10,"3",0,1,1,"Direct thermal printing."
PRINT 1
REM *****Enable ribbon detection sensor for thermal transfer printing.
SET RIBBON ON
SIZE 4,1
GAP 0,0
CLS
TEXT 10,10,"3",0,1,1,"Thermal transfer printing."
PRINT 1
REM *****For using ink-in ribbon in TTP-384M.
SET RIBBON INSIDE
SIZE 4,1
GAP 0,0
CLS
TEXT 10,10,"3",0,1,1,"TTP-384M is using ink-in ribbon."
PRINT 1
REM *****For using ink-out ribbon in TTP-384M.
SET RIBBON OUTSIDE
SIZE 4,1
GAP 0,0
CLS
TEXT 10,10,"3",0,1,1,"TTP-384M is using ink-out ribbon."
PRINT 1
190
SET ENCODER
Description
This setting is used to enable/disable ribbon encoder sensor detection.
Syntax
SET ENCODER ON/OFF
Parameter
ON
OFF
Description
Enable ribbon encoder sensor.
Disable ribbon encoder sensor.
Example
SET ENCODER ON
SET ENCODER OFF
191
SET RIBBONEND
Description
This setting is used to enable/disable ribbon-end sensor detection.
Syntax
SET RIBBONEND ON/OFF
Parameter
ON
OFF
Description
Enable ribbon-end sensor.
Disable ribbon-end sensor.
Note:
This command has been supported since V6.91 EZ and later firmware.
Example
SET RIBBONEND ON
SET RIBBONEND OFF
192
SET COM1
Description
This setting defines communication parameters for printer serial port.
Syntax
SET COM1 baud,parity,data,stop
Parameter
baud
parity
Data
stop
Description
Baud rate, available baud rates are as listed :
24: 2400 bps
48: 4800 bps
96: 9600 bps
19: 19200 bps
38: 38400 bps
57: 57600 bps
115: 115200 bps
Parity check
N: No parity check
E: Even parity check
O: Odd parity check
Data bit
8: 8 bits data
7: 7 bits data
Stop bit
1: 1 stop bit
2: 2 stop bits
Example
The parallel port is used to setup the printer serial port in this example via MS-DOS mode.
C:\>COPY CON LPT1<ENTER>
SET COM1 19,N,8,1<ENTER>
<CTRL><Z><ENTER>
C:\>
Note:
<ENTER> stands for PC keyboard ENTER key. <CTRL><Z> means to hold PC keyboard CTRL
key then press the PC keyboard <Z> key.
193
SET PRINTKEY
Description
This command will print one label and feed label gap to tear bar position for tearing away. Press FEED
button to print the next label or batch of labels. If label content includes serial text or barcode, it will
change the serial number accordingly. This setting will be saved in printer memory.
Syntax
SET PRINTEKY OFF/ON/AUTO/<num>
Parameter
OFF
ON
AUTO
<num>
Description
Disable this function
Enable this function
Enable this function
Numbers of labels will be printed if FEED button is pressed.
Support
TTP-243 series
TTP-243 Plus series
TTP-244ME series
TTP-244ME Plus series
TTP-244 series
TTP-244CE series
TTP-245 series
TTP-245C series
TDP-245 series
TTP-246M series
TTP-248M series
TTP-2410M series
TDP-643 Plus
TDP-643R Plus
TTP-342 series
TTP-342 Plus series
TTP-342M series
TTP-342M Plus series
TTP-343 series
TTP-343C series
TTP-344M series
TTP-346M series
TTP-384M series
TTP-644M series
M23 series
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
Example
Sample code
SIZE 4,2.5
GAP 0.12,0
SET PRINTKEY ON
SET COUNTER @0 1
@0="0001"
CLS
TEXT 10,10,"5",0,1,1,@0
PRINT 1
194
Execute:
Syntax
SET PRINTKEY ON or
SET PRINTKEY AUTO
Receive PRINT m
1.) PRINT 2
2.) Press FEED key
Print Out
Label 1~2
Label 3~4
Syntax
SET PRINTKEY ON or
SET PRINTKEY AUTO
Print Out
Label 1, Label 1
Label 2, Label 2
Syntax
SET PRINTKEY ON or
SET PRINTKEY AUTO
Print Out
Label 1, Label 1
Label 1, Label 1
Syntax
Receive PRINT m
1.) PRINT 2
2.) Press FEED key
Receive PRINT m,n
1.) PRINT 1,2
2.) Press FEED key
Print Out
Label 1~2
Label 3~7
Print Out
Label 1, Label 1
Label 2~6
Print Out
Label 1, Label 1
Label 1, Label 1
SET PRINTKEY 5
Syntax
SET PRINTKEY 5
Syntax
SET PRINTKEY 5
195
SET REPRINT
Description
This command will disable/enable a reprinting attempt subsequent to a "no paper", "no ribbon" or
"carriage open" error.
Syntax
SET REPRINT OFF/ON
Parameter
OFF
ON
Description
Disable this function
Enable this function
Model
Support
TTP-243 series
TTP-243 Plus series
TTP-244ME series
TTP-244ME Plus series
TTP-244 series
TTP-244CE series
TTP-245 series
TTP-245C series
TDP-245 series
TTP-246M series
TTP-248M series
TTP-2410M series
TDP-643 Plus
TDP-643R Plus
TTP-342 series
TTP-342 Plus series
TTP-342M series
TTP-342M Plus series
TTP-343 series
TTP-343C series
TTP-344M series
TTP-346M series
TTP-384M series
TTP-644M series
M23 series
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
Example
SET REPRINT ON
196
SET FEED_LEN
Description
This command can set the feeding length when FEED key is pressed. This setting will be memorized by
printer. The initialized value is the label length.
Syntax
SET FEED_LEN n
Parameter
n
Description
The feeding length in dot.
Note:
This command has been supported since V5.10 EZ and later firmware.
Example
Sample code
SET FEED_LEN 100
Result
The feeding length is 100 dots when you press the FEED button after this setting.
197
GETSENSOR()
Description
This command is used to get the sensor status/AD value. We can use it to check the sensor function.
Syntax
GETSENSOR(sensor$[,intension])
Parameter
sensor$
intension
Description
Sensor type.
GAP
BLINE
RIBBON
PEEL
HEAD UP
HEAD TEMP
HEAD VOLT
Gap sensor
Black mark sensor
Ribbon-end sensor
Peeler sensor
Thermal print head open sensor
The temperature of print head
The voltage of print head
Sensor intension.
Gap intension
BLINE intension
RIBBON intension
PEEL sensor intension
HEAD UP sensor
intension
HEAD TEMP
HEAD VOLT
Returned value
Gap
BLINE
RIBBON
PEEL
HEAD UP
HEAD TEMP
HEAD VOLT
Note:
This command has been supported since V6.75 EZ and later firmware.
198
Sample code
OUT GETSENSOR("GAP",0)
OUT GETSENSOR("GAP",1)
OUT GETSENSOR("GAP",2)
OUT GETSENSOR("GAP",3)
OUT GETSENSOR("GAP",4)
OUT GETSENSOR("GAP",5)
OUT GETSENSOR("GAP",6)
OUT GETSENSOR("GAP",7)
OUT GETSENSOR("GAP",8)
OUT GETSENSOR("BLINE",0)
OUT GETSENSOR("BLINE",1)
OUT GETSENSOR("BLINE",2)
OUT GETSENSOR("BLINE",3)
Result
Result
Sample code
Sample code
OUT GETSENSOR("RIBBON",0)
OUT GETSENSOR("RIBBON",1)
OUT GETSENSOR("RIBBON",2)
OUT GETSENSOR("RIBBON",3)
OUT GETSENSOR("PEEL")
Result
Result
199
GETSETTING$()
Description
This command is used to get printer settings.
Syntax
GETSETTING(app$,sec$,key$[,default$])
app$
sec$
INFORMATION
SYSTEM
RECORD
DRAM
FILE
FLASH
CARD
NET
COM1
SENSOR
CONFIG
TSPL
Parameter
default$
key$
Comment
DPI
MODEL
SERIAL
VERSION
CHECKSUM
MILAGE
CUT COUNTER
CAPACITY
AVAILABLE
CAPACITY
AVAILABLE
CAPACITY
AVAILABLE
INSTALLED
MAC ADDRESS
IP ADDRESS
SUBNET MASK
DEFAULT GATEWAY
BAUD RATE
DATA BIT
PARITY
STOP BIT
SENSOR TYPE
CARRIAGE
GAP INTENSION
BLINE INTENSION
CONTINUOUS INTENSION
PRINT MODE
DENSITY
PAPER SIZE
GAP SIZE
BLINE SIZE
DIRECTION
MIRROR
RIBBON
REPRINT
PAPER WIDTH
LIMIT FEED
OFFSET
REFERENCE X
REFERENCE Y
SHIFT X
SHIFT Y
SPEED
COUNTRY CODE
CODEPAGE
Description
Optional. Expression containing the value to return if no value is set in
the key$ setting. If omitted, default is assumed to be a zero-length string
("").
Note: This command has been supported since V6.72 EZ and later firmware.
TSC AUTO ID Technology Co., Ltd.
200
201
Result
202
Syntax
SET USBHOST KAYBOARD/SCANNER
Parameter
KAYBOARD
SCANNER
Description
USB keyboard
USB scanner
Note:
This command has been supported since V6.95 EZ and later firmware.
This command is for TTP-2410M series, ME240 series, TTP-225 series and TDP-225 series
which has USB HOST connector.
Example
Sample code
SET USBHOST KEYBOARD
or
SET USBHOST SCANNER
203
SET AUTORUN
Description
This command redefines the BAS file which can be run automatically while switching on the printer.
Default is AUTO.BAS.
Syntax
SET AUTORUN "filename"
Parameter
filename
Description
The file will be defined to AUTO-RUN file. Default is AUTO.BAS.
Note:
This command has been supported since V6.86 EZ and later firmware.
Example
Sample Code
REM *****Step1: Send the following command to redefine the auto-run file from "AUTO.BAS" to
"TEST.BAS"
SET AUTORUN "TEST.BAS"
REM *****Step2: Send the following commands to download "TEST.BAS" file into printer.
DOWNLOAD F,"TEST.BAS"
SIZE 4,1
GAP 0,0
DIRECTION 1
CLS
BLOCK 10,10,600,200,"3",0,1,1,12,"\["]TEST.BAS\["] is running automatically while turning on the
printer."
PRINT 1
EOP
REM *****Step3: Turn off and on the printer to run "TEST.BAS" automatically.
Result
204
PEEL
Description
This command obtains the status of the peel-off sensor. This attribute is read only.
Syntax
PEEL
Return Value
0
1
Description
Paper is not on top of peel sensor
Paper is on top of peel sensor
Example
Sample code
DOWNLOAD "DEMO.BAS"
SIZE 4,1
GAP 0,0
SET PEEL OFF
SET KEY1 OFF
SET LED1 OFF
SET LED3 OFF
:START
LED1=0
LED3=0
IF KEY1=1 THEN GOTO A
GOTO START
:A
LED1=1
CLS
TEXT 10,10,"3",0,1,1,"PEEL Function Test!! "
PRINT 1,1
:B
LED1=0
IF PEEL=1 THEN
LED3=1
GOTO B
ELSE
CLS
TEXT 10,10,"3",0,1,1,"The label is removed from the PEEL sensor!!"
PRINT 1,1
GOTO START
ENDIF
EOP
DEMO
205
Syntax
LEDm = n
Return Value
m
Description
m=1, LED1
m=2, LED2
m=3, LED3
0: turn off LED
1: light on LED
Model
TTP-243 series
TTP-243 Plus series
TTP-244ME series
TTP-244ME Plus series
TTP-244 series
TTP-244CE series
TTP-245 series
TTP-245C series
TDP-245 series
TTP-246M series
TTP-248M series
TTP-2410M series
TDP-643 Plus
TDP-643R Plus
TTP-342 series
TTP-342 Plus series
TTP-342M series
TTP-342M Plus series
TTP-343 series
TTP-343C series
TTP-344M series
TTP-346M series
TTP-384M series
TTP-644M series
M23 series
LED1
POWER
POWER
POWER
POWER
POWER
POWER
GREEN
GREEN
GREEN
POWER
POWER
POWER
ONLINE
ONLINE
POWER
POWER
POWER
POWER
GREEN
GREEN
POWER
POWER
POWER
POWER
LED2
ONLINE
ONLINE
ONLINE
ONLINE
ONLINE
ONLINE
GREEN
GREEN
GREEN
ONLINE
ONLINE
ONLINE
ERROR
ERROR
ONLINE
ONLINE
ONLINE
ONLINE
GREEN
GREEN
ONLINE
ONLINE
ONLINE
ONLINE
LED3
ERROR
ERROR
ERROR
ERROR
ERROR
ERROR
RED
RED
RED
ERROR
ERROR
ERROR
ERROR
ERROR
ERROR
ERROR
ERROR
ERROR
RED
RED
ERROR
ERROR
ERROR
ERROR
ORANGE
ORANGE
ORANGE
ORANGE
ORANGE
Note:
For TTP-245/343/TDP-245 series, the LED1=LED2.
Example
Sample code
DOWNLOAD "DEMO.BAS"
SIZE 3,3
GAP 0.12,0
SPEED 4
DENSITY 8
DIRECTION 1
TSC AUTO ID Technology Co., Ltd.
206
REFERENCE 0,0
SET CUTTER OFF
SET PEEL OFF
SET LED1 OFF
SET LED2 OFF
SET LED3 OFF
LED1=0
LED2=1
LED3=0
EOP
DEMO
207
KEY0
FEED
KEY1
PAUSE
PAUSE
PAUSE
PAUSE
PAUSE
FEED
FEED
FEED
FEED
MENU
MENU
MENU
PAUSE
PAUSE
PAUSE
PAUSE
PAUSE
PAUSE
FEED
FEED
MENU
MENU
MENU
MENU
LEFT
KEY2
FEED
FEED
FEED
FEED
FEED
KEY3
KEY4
KEY5
KEY6
PAUSE
PAUSE
PAUSE
FEED
FEED
FEED
(UP)
(DOWN)
(SELECT)
UP
DOWN
SELECT
FEED
FEED
FEED
FEED
RIGHT
(UP)
UP
UP
UP
(DOWN)
DOWN
DOWN
DOWN
(SELECT)
SELECT
SELECT
SELECT
FEED
FEED
FEED
FEED
PAUSE
PAUSE
PAUSE
PAUSE
MID
* For TTP-246M Plus and TTP-344M Plus, there are 6 buttons on the control panel.
Syntax
KEYm = n
Key
KEY1 (MENU)
KEY2 (PAUDE)
KEY3 (FEED)
Return Value
0: released
1: pressed
0: released
1: pressed
0: released
1: pressed
Example
Sample code
DOWNLOAD "DEMO.BAS"
SIZE 3,1
GAP 0,0
SPEED 4
DENSITY 8
DIRECTION 1
REFERENCE 0,0
SET LED1 OFF
TSC AUTO ID Technology Co., Ltd.
208
209
Syntax
Write attribute: @LABEL=n or @LABEL=n
Read attribute: A=LABEL or A$=STR$(LABEL)
Parameter
n
Description
Number of labels printed. 0<=n<=999999999
Example
Sample code
Result
DOWNLOAD "DEMO.BAS"
SIZE 4,2.5
GAP 0,0
DIRECTION 1
CLS
TEXT 10,50,"3",0,1,1,@LABEL
TEXT 10,100,"3",0,1,1,"@LABEL="+STR$(LABEL)
TEXT 10,150,"3",0,1,1,"*****Statement 1*****"
IF LABEL>1000 THEN
TEXT 10,200,"3",0,1,1,"LABEL>1000"
ELSE
TEXT 10,200,"3",0,1,1,"LABEL<1000"
ENDIF
TEXT 10,250,"3",0,1,1,"*****Statement 1*****"
A=LABEL
IF A>1000 THEN
TEXT 10,300,"3",0,1,1,"A>1000"
ELSE
TEXT 10,300,"3",0,1,1,"A<1000"
ENDIF
TEXT 10,350,"3",0,1,1,"*****Statement 3*****"
A$=STR$(LABEL)
IF VAL(A$)>1000 THEN
TEXT 10,400,"3",0,1,1,"VAL(A$)>1000"
ELSE
TEXT 10,400,"3",0,1,1,"VAL(A$)<1000"
ENDIF
PRINT 1,1
EOP
DEMO
210
YEAR
Description
This variable reads/writes the year data via the Real Time Clock (RTC). Four-digit year formats are
supported by RTC.
Syntax
Write attribute: YEAR = 02
Read attribute: A = YEAR
Range: 00~50 = 2000~2050; 51~99 = 1951~1999
Example
Sample code
DOWNLOAD "SetYear.BAS"
REM *****Set Year Parameter to RTC*****
YEAR=13
EOP
SetYear
Sample code
DOWNLOAD "DEMO.BAS"
SIZE 4,1
GAP 0,0
DIRECTION 1
CLS
REM *****Read YEAR parameter from RTC*****
YEAR$=STR$(YEAR)
Y=YEAR
REM *****Print*****
TEXT 10,10,"3",0,1,1,"YEAR1="+YEAR$
TEXT 10,50,"3",0,1,1,"YEAR2="+STR$(Y)
TEXT 10,90,"3",0,1,1,"YEAR3="+STR$(YEAR)
PRINT 1
EOP
DEMO
Result
See Also
~!C, MONTH, DATE, DAY, HOUR, MINUTE, SECOND
211
MONTH
Description
This variable reads/writes the month data via the Real Time Clock (RTC). Two-digit (01~12) month
formats are supported by RTC.
Syntax
Write attribute: MONTH = 01
Read attribute: A = MONTH
Range: 01~12
Example
Sample code
DOWNLOAD "SetMonth.BAS"
REM *****Set Month Parameter to RTC*****
MONTH=01
EOP
SetMonth
Sample code
DOWNLOAD "DEMO.BAS"
SIZE 4,1
GAP 0,0
DIRECTION 1
CLS
REM *****Read Month parameter form RTC*****
MONTH$=STR$(MONTH)
M=MONTH
REM *****Print*****
TEXT 10,10,"3",0,1,1,"MONTH1="+MONTH$
TEXT 10,50,"3",0,1,1,"MONTH2="+STR$(M)
TEXT 10,90,"3",0,1,1,"MONTH3="+STR$(MONTH)
PRINT 1
EOP
DEMO
Result
See Also
~!C, MONTH, DATE, DAY, HOUR, MINUTE, SECOND
212
DATE
Description
This variable reads/writes the date data via the Real Time Clock (RTC). Two-digit (01~31) date formats
are supported by RTC.
Syntax
Write attribute: DATE = 12
Read attribute: A = DATE
Range: 01~31
Example
Sample code
DOWNLOAD "SetDate.BAS"
REM *****Set Date Parameter to RTC*****
DATE=10
EOP
SetDate
Sample code
DOWNLOAD "DEMO.BAS"
SIZE 4,1
GAP 0,0
DIRECTION 1
CLS
REM *****Read Date parameter form RTC*****
DATE$=STR$(DATE)
D=DATE
REM *****Print*****
TEXT 10,10,"3",0,1,1,"DATE1="+DATE$
TEXT 10,50,"3",0,1,1,"DATE2="+STR$(D)
TEXT 10,90,"3",0,1,1,"DATE3="+STR$(DATE)
PRINT 1
EOP
DEMO
Result
See Also
~!C, MONTH, DATE, DAY, HOUR, MINUTE, SECOND
213
WEEK
Description
This variable reads/writes the day of the week data via the Real Time Clock (RTC), which is represented
by one single digit (1~7).
Syntax
Read attribute: A = WEEK
Range: 1(Sunday)~7(Saturday)
Example
Sample code
DOWNLOAD "DEMO.BAS"
SIZE 4,1
GAP 0,0
DIRECTION 1
CLS
REM *****Read Week parameter form RTC*****
WEEK$=STR$(WEEK)
W=WEEK
REM *****Print*****
TEXT 10,10,"3",0,1,1,"WEEK1="+WEEK$
TEXT 10,50,"3",0,1,1,"WEEK2="+STR$(W)
TEXT 10,90,"3",0,1,1,"WEEK3="+STR$(WEEK)
PRINT 1
EOP
DEMO
Result
See Also
~!C, MONTH, DATE, DAY, HOUR, MINUTE, SECOND
214
HOUR
Description
This variable reads/writes the hour data via the Real Time Clock (RTC). The 24-hour-day system (00~23)
is supported by RTC.
Syntax
Write attribute: HOUR = 12
Read attribute: A = HOUR
Range: 00~23
Example
Sample code
DOWNLOAD "SetHour.BAS"
REM *****Set Hour Parameter to RTC*****
HOUR=10
EOP
SetHour
Sample code
DOWNLOAD "DEMO.BAS"
SIZE 4,1
GAP 0,0
DIRECTION 1
CLS
REM *****Read Hour parameter form RTC*****
HOUR$=STR$(HOUR)
H=HOUR
REM *****Print*****
TEXT 10,10,"3",0,1,1,"HOUR1="+HOUR$
TEXT 10,50,"3",0,1,1,"HOUR2="+STR$(H)
TEXT 10,90,"3",0,1,1,"HOUR3="+STR$(HOUR)
PRINT 1
EOP
DEMO
Result
See Also
~!C, MONTH, DATE, DAY, HOUR, MINUTE, SECOND
215
MINUTE
Description
This variable reads/writes the minute data via the Real Time Clock (RTC).
format is supported by RTC.
Syntax
Write attribute: MINUTE = 12
Read attribute: A = MINUTE
Range: 00~59
Example
Sample code
DOWNLOAD "SetMinute.BAS"
REM *****Set Minute Parameter to RTC*****
MINUTE=27
EOP
SetMinute
Sample code
DOWNLOAD "DEMO.BAS"
SIZE 4,1
GAP 0,0
DIRECTION 1
CLS
REM *****Read Minute parameter form RTC*****
MINUTE$=STR$(MINUTE)
MIN=MINUTE
REM *****Print*****
TEXT 10,10,"3",0,1,1,"MINUTE1="+MINUTE$
TEXT 10,50,"3",0,1,1,"MINUTE2="+STR$(MIN)
TEXT 10,90,"3",0,1,1,"MINUTE3="+STR$(MINUTE)
PRINT 1
EOP
DEMO
Result
See Also
~!C, MONTH, DATE, DAY, HOUR, MINUTE, SECOND
216
SECOND
Description
This variable reads/writes the second data via the Real Time Clock (RTC). Two-digits (00~59) second
format is supported by RTC.
Syntax
Write attribute: SECOND = 12
Read attribute: A = SECOND
Range: 00~59
Example
Sample code
DOWNLOAD "SetSecond.BAS"
REM *****Set Second Parameter to RTC*****
SECOND=59
EOP
SetSecond
Sample code
DOWNLOAD "DEMO.BAS"
SIZE 4,1
GAP 0,0
DIRECTION 1
CLS
REM *****Read Second parameter form RTC*****
SECOND$=STR$(SECOND)
SEC=SECOND
REM *****Print*****
TEXT 10,10,"3",0,1,1,"SECOND1="+SECOND$
TEXT 10,50,"3",0,1,1,"SECOND2="+STR$(SEC)
TEXT 10,90,"3",0,1,1,"SECOND3="+STR$(SECOND)
PRINT 1
EOP
DEMO
Result
See Also
~!C, MONTH, DATE, DAY, HOUR, MINUTE, SECOND
217
@YEAR
Description
This variable reads/writes the year data via the Real Time Clock (RTC). Two-digit year formats are
supported by RTC. @YEAR global variable can be accessed directly without using BASIC language
functions.
Syntax
Write attribute: @YEAR = "01"
Read attribute: @YEAR
Range: 00~99
Model
Support
TTP-243 series
TTP-243 Plus series
TTP-244ME series
TTP-244ME Plus series
TTP-244 series
TTP-244CE series
TTP-245 series
TTP-245C series
TDP-245 series
TTP-246M series
TTP-248M series
TTP-2410M series
TDP-643 Plus
TDP-643R Plus
TTP-342 series
TTP-342 Plus series
TTP-342M series
TTP-342M Plus series
TTP-343 series
TTP-343C series
TTP-344M series
TTP-346M series
TTP-384M series
TTP-644M series
M23 series
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
Example
Sample code
Result
See Also
~!C, @MONTH, @DATE, @DAY, @HOUR, @MINUTE, @SECOND
TSC AUTO ID Technology Co., Ltd.
218
@MONTH
Description
This variable reads/writes the month data via the Real Time Clock (RTC). Two-digits (01~12) month
formats are supported by RTC. @MONTH global variable can be accessed directly without using BASIC
language functions.
Syntax
Write attribute: @MONTH = "01"
Read attribute: @MONTH
Range: 01~12
Model
Support
TTP-243 series
TTP-243 Plus series
TTP-244ME series
TTP-244ME Plus series
TTP-244 series
TTP-244CE series
TTP-245 series
TTP-245C series
TDP-245 series
TTP-246M series
TTP-248M series
TTP-2410M series
TDP-643 Plus
TDP-643R Plus
TTP-342 series
TTP-342 Plus series
TTP-342M series
TTP-342M Plus series
TTP-343 series
TTP-343C series
TTP-344M series
TTP-346M series
TTP-384M series
TTP-644M series
M23 series
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
Example
Sample code
Result
See Also
~!C, @YEAR, @DATE, @DAY, @HOUR, @MINUTE, @SECOND
TSC AUTO ID Technology Co., Ltd.
219
@DATE
Description
This variable reads/writes the date data via the Real Time Clock (RTC). Two-digits (01~31) date formats
are supported by RTC. @DATE global variable can be accessed directly without using BASIC language
functions.
Syntax
Write attribute: @DATE = "12"
Read attribute: @DATE
Range: 01~31
Model
Support
TTP-243 series
TTP-243 Plus series
TTP-244ME series
TTP-244ME Plus series
TTP-244 series
TTP-244CE series
TTP-245 series
TTP-245C series
TDP-245 series
TTP-246M series
TTP-248M series
TTP-2410M series
TDP-643 Plus
TDP-643R Plus
TTP-342 series
TTP-342 Plus series
TTP-342M series
TTP-342M Plus series
TTP-343 series
TTP-343C series
TTP-344M series
TTP-346M series
TTP-384M series
TTP-644M series
M23 series
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
Example
Sample code
Result
See Also
~!C, @YEAR, @MONTH, @DAY, @HOUR, @MINUTE, @SECOND
220
@DAY
Description
This variable reads/writes the day of the week data via the Real Time Clock (RTC), which is represented
by one single digit (1~7). @DAY global variable can be accessed directly without using BASIC language
functions.
Syntax
Read attribute: @DAY
Range: 1(Sunday)~7(Saturday)
Model
Support
TTP-243 series
TTP-243 Plus series
TTP-244ME series
TTP-244ME Plus series
TTP-244 series
TTP-244CE series
TTP-245 series
TTP-245C series
TDP-245 series
TTP-246M series
TTP-248M series
TTP-2410M series
TDP-643 Plus
TDP-643R Plus
TTP-342 series
TTP-342 Plus series
TTP-342M series
TTP-342M Plus series
TTP-343 series
TTP-343C series
TTP-344M series
TTP-346M series
TTP-384M series
TTP-644M series
M23 series
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
Example
Sample code
Result
REM *****Print*****
SIZE 4,1
GAP 0,0
DIRECTION 1
CLS
TEXT 10,10,"3",0,1,1,"@DAY"
TEXT 210,10,"3",0,1,1,@DAY
PRINT 1
See Also
~!C, @YEAR, @MONTH, @DATE, @HOUR, @MINUTE, @SECOND
221
@HOUR
Description
This variable reads/writes the hour data via the Real Time Clock (RTC). The 24-hour-day system (00~23)
is supported by RTC. @HOUR global variable can be accessed directly without using BASIC language
functions.
Syntax
Write attribute: @HOUR = "12"
Read attribute: @HOUR
Range: 00~23
Model
Support
TTP-243 series
TTP-243 Plus series
TTP-244ME series
TTP-244ME Plus series
TTP-244 series
TTP-244CE series
TTP-245 series
TTP-245C series
TDP-245 series
TTP-246M series
TTP-248M series
TTP-2410M series
TDP-643 Plus
TDP-643R Plus
TTP-342 series
TTP-342 Plus series
TTP-342M series
TTP-342M Plus series
TTP-343 series
TTP-343C series
TTP-344M series
TTP-346M series
TTP-384M series
TTP-644M series
M23 series
Example
Sample code
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
Result
See Also
~!C, @YEAR, @MONTH, @DATE, @DAY, @MINUTE, @SECOND
TSC AUTO ID Technology Co., Ltd.
222
@MINUTE
Description
This variable reads/writes the minute data via the Real Time Clock (RTC). The two-digits (00~59)
minute format is supported by RTC. @MINUTE global variable can be accessed directly without using
BASIC language functions.
Syntax
Write attribute: @MINUTE = "12"
Read attribute: @MINUTE
Range: 00~59
Model
Support
TTP-243 series
TTP-243 Plus series
TTP-244ME series
TTP-244ME Plus series
TTP-244 series
TTP-244CE series
TTP-245 series
TTP-245C series
TDP-245 series
TTP-246M series
TTP-248M series
TTP-2410M series
TDP-643 Plus
TDP-643R Plus
TTP-342 series
TTP-342 Plus series
TTP-342M series
TTP-342M Plus series
TTP-343 series
TTP-343C series
TTP-344M series
TTP-346M series
TTP-384M series
TTP-644M series
M23 series
Example
Sample code
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
Result
See Also
~!C, @YEAR, @MONTH, @DATE, @DAY, @HOUR, @SECOND
TSC AUTO ID Technology Co., Ltd.
223
@SECOND
Description
This variable reads/writes the second data via the Real Time Clock (RTC). The Two-digit (00~59) second
format is supported by RTC. @SECOND global variable can be accessed directly without using BASIC
language functions.
Syntax
Write attribute: @SECOND = "12"
Read attribute: @SECOND
Range: 00~59
Model
Support
TTP-243 series
TTP-243 Plus series
TTP-244ME series
TTP-244ME Plus series
TTP-244 series
TTP-244CE series
TTP-245 series
TTP-245C series
TDP-245 series
TTP-246M series
TTP-248M series
TTP-2410M series
TDP-643 Plus
TDP-643R Plus
TTP-342 series
TTP-342 Plus series
TTP-342M series
TTP-342M Plus series
TTP-343 series
TTP-343C series
TTP-344M series
TTP-346M series
TTP-384M series
TTP-644M series
M23 series
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
Example
Sample code
Result
See Also
~!C, @YEAR, @MONTH, @DATE, @DAY, @HOUR, @MINUTE
224
_MODEL$
Description
This variable can be read only. It includes the information of printers model name.
Syntax
_MODEL$
Example
Sample code
SIZE 4,1
GAP 0,0
DIRECTION 1
CLS
TEXT 10,10,"3",0,1,1,"Model: " + _MODEL$
TEXT 10,60,"3",0,1,1,"Serial No.: " + _SERIAL$
TEXT 10,110,"3",0,1,1,"F/W Version: " + _VERSION$
PRINT 1
Result
See Also
_SERIAL$, _VERSION$
225
_SERIAL$
Description
This variable can be read only. It includes the information of printers serial number.
*The printers serial number must be programmed into printer at factory.
Syntax
_SERIAL$
Example
Sample code
SIZE 4,1
GAP 0,0
DIRECTION 1
CLS
TEXT 10,10,"3",0,1,1,"Model: " + _MODEL$
TEXT 10,60,"3",0,1,1,"Serial No.: " + _SERIAL$
TEXT 10,110,"3",0,1,1,"F/W Version: " + _VERSION$
PRINT 1
Result
See Also
_MODEL$, _VERSION$
226
_VERSION$
Description
This variable can be read only. It includes the information of printers firmware version.
Syntax
_SERIAL$
Example
Sample code
SIZE 4,1
GAP 0,0
DIRECTION 1
CLS
TEXT 10,10,"3",0,1,1,"Model: " + _MODEL$
TEXT 10,60,"3",0,1,1,"Serial No.: " + _SERIAL$
TEXT 10,110,"3",0,1,1,"F/W Version: " + _VERSION$
PRINT 1
Result
See Also
_MODEL$, _VERSION$
227
Syntax
WLAN OFF
Note:
We can use command SELFTEST WLAN to check the status of WLAN. The SSID is empty.
Example
Sample code
Result
WLAN OFF
SELFTEST WLAN
See Also
WLAN SSID
228
WLAN SSID
Description
This command is used to set the SSID of your wireless network into Wi-Fi module. Restart the printer is
necessary.
Syntax
WLAN SSID "ssid"
Parameter
ssid
Description
In WLAN MODE INFRASTRUCTURE, it is the SSID of your wireless network.
In WLAN MODE AD-HOC, it is the SSID of Wi-Fi module.
Note:
SSID is case-sensitive. The maximum length is 32 bytes.
Example
Sample code
Result
See Also
WLAN OFF
229
WLAN WPA
Description
This command is used to set WPA security mode. This command only can be set but not be checked.
Restart the printer is necessary.
Syntax
WLAN WPA OFF
WLAN WPA "key"
Parameter
OFF
key
Description
Disable WPA security mode.
The network security key. 8 to 63 characters.
key = Passphrase or Pre-Shared Key
(Passphrase is a string containing between 8 and 63 characters)
(Pre-Shared Key is a 32-byte key, formatted as hexadecimal number)
Example
Sample code
WLAN WPA OFF
WLAN WPA "123456789"
230
WLAN WEP
Description
This command is used to set WEP security mode. This command only can be set but not be checked.
Restart the printer is necessary.
Syntax
WLAN WEP OFF
WLAN WEP n, "key"
Parameter
OFF
n
key
Description
Disable WPA security mode.
The index of key. 1 to 4.
The encryption key. 5 or 13 characters or 10 or 26 hexadecimal digits.
Example
Sample code
WLAN WEP OFF
WLAN WEP 1,"ABCDE"
WLAN WEP 2,"ABCDE"
WLAN WEP 3,"ABCDE"
WLAN WEP 4,"4142434445"
231
WLAN DHCP
Description
This command is used to set the printer to get the IP address from DHCP server. Restart the printer is
necessary.
Syntax
WLAN DHCP
Example
Sample code
Result
See Also
WLAN IP
232
WLAN IP
Description
This command is used to set the specific static IP address to printer. Restart the printer is necessary.
Syntax
WLAN IP "ip", "mask", "gateway"
Parameter
ip
mask
gateway
Description
IP address.
Subnet mask.
Default gateway.
Example
Sample code
Result
See Also
WLAN DHCP
233
WLAN PORT
Description
This command is used to specify the PORT number of Wi-Fi module. Restart the printer is necessary.
Syntax
WLAN PORT number
Parameter
number
Description
Base raw port number. Default is 9100.
Example
Sample code
Result
234
WLAN MODE
Description
This command is used to define the wireless operating mode. Restart the printer is necessary.
Syntax
WLAN MODE operation
Parameter
operation
Description
INFRASTRUCTURE: For AP (access point) usage.
AD-HOC: Peer-to-peer mode. *Support static IP and WEP security only.
Example
Sample code
Result
Result
235
Syntax
NET DHCP
Example
Sample code
Result
NET DHCP
SELFTEST ETHERNET
See Also
NET IP
236
NET IP
Description
This command is used to set the specific IP address to printer. Printer will restart itself while setting
this command.
Syntax
NET IP "ip","mask","gateway"
Parameter
ip
mask
gateway
Description
IP address
Subnet mask
Default gateway
Example
Sample code
NET IP "192.168.10.40","255.255.255.0","192.168.10.252"
SELFTEST ETHERNET
Result
See Also
NET DHCP
237
NET PORT
Description
This command is used to specify the PORT number of Ethernet. Printer will restart itself while setting
this command.
Syntax
NET PORT number
Parameter
number
Description
Base raw port number. Default is 9100.
Example
Sample code
Result
238
NET NAME
Description
This command is used to set the printer server name.
Syntax
NET NAME "printerserver"
Parameter
printerserver
Description
The specific name of printer server.
Example
Sample code
Result
239
Corporate Headquarters
9F., No.95, Minquan Rd., Xindian Dist.,
New Taipei City 23141, Taiwan (R.O.C.)
TEL: +886-2-2218-6789
FAX: +886-2-2218-5678
Web site: www.tscprinters.com
E-mail: [email protected]
[email protected]
Li Ze Plant
No.35, Sec. 2, Ligong 1st Rd., Wujie Township,
Yilan County 26841, Taiwan (R.O.C.)
TEL: +886-3-990-6677
FAX: +886-3-990-5577