Upload
danielfdo0578
View
254
Download
2
Embed Size (px)
Citation preview
8/3/2019 TSPL TSPL2 Programming 2008-4-10
1/173
TSPL/TSPL2 Programming Language
PROGRAMMINGMANUAL
TSC BAR CODE PRINTER SERIES
8/3/2019 TSPL TSPL2 Programming 2008-4-10
2/173
Update HistoryDate Content Editor
2007/7/13 Revise some typos Phil
2007/12/25 Revise FREAD$() example Camille
2008/4/10 Add update history list Camille
8/3/2019 TSPL TSPL2 Programming 2008-4-10
3/173
8/3/2019 TSPL TSPL2 Programming 2008-4-10
4/173
~!T ...........................................................................................................................................67Message Translation Protocols..............................................................................................68~# .............................................................................................................................................68Commands for Windows Driver...........................................................................................69!B..............................................................................................................................................69
!J ..............................................................................................................................................70!N .............................................................................................................................................71File Management Commands ...............................................................................................72DOWNLOAD.........................................................................................................................72EOP .........................................................................................................................................77FILES......................................................................................................................................78KILL........................................................................................................................................79MOVE.....................................................................................................................................81RUN.........................................................................................................................................82BASIC Commands and Functions .......................................................................................83ABS( ) ......................................................................................................................................83
ASC( )......................................................................................................................................84CHR$( ) ...................................................................................................................................85END .........................................................................................................................................86EOF( )......................................................................................................................................87OPEN ......................................................................................................................................88READ ......................................................................................................................................90SEEK.......................................................................................................................................92LOF( )......................................................................................................................................93FREAD$( ) ..............................................................................................................................94FORNEXT..........................................................................................................................95IFTHENELSEENDIF................................................................................................97GOSUBRETURN.............................................................................................................101GOTO....................................................................................................................................102INP$( ) ...................................................................................................................................103INPUT ...................................................................................................................................104REM ......................................................................................................................................105OUT.......................................................................................................................................106GETKEY( )...........................................................................................................................107INT( ).....................................................................................................................................109LEFT$( ) ...............................................................................................................................110LEN( ).................................................................................................................................... 111
MID$( )..................................................................................................................................112RIGHT$( ).............................................................................................................................113STR$( ) ..................................................................................................................................114VAL( ) ....................................................................................................................................115BEEP ..................................................................................................................................... 116Device Reconfiguration Commands ...................................................................................117SET COUNTER...................................................................................................................117SET CUTTER ......................................................................................................................118SET PARTIAL_CUTTER...................................................................................................119SET BACK ...........................................................................................................................121SET KEY1, SET KEY2, SET KEY3 ..................................................................................123
SET LED1, SET LED2, SET LED3 ...................................................................................125SET PEEL.............................................................................................................................127
8/3/2019 TSPL TSPL2 Programming 2008-4-10
5/173
SET TEAR & SET STRIP ..................................................................................................128SET GAP...............................................................................................................................130SET HEAD ...........................................................................................................................132SET RIBBON .......................................................................................................................133SET COM1 ...........................................................................................................................134
SET PRINTKEY..................................................................................................................135SET REPRINT.....................................................................................................................137PEEL .....................................................................................................................................138LED1, LED2, LED3.............................................................................................................139KEY1, KEY2, KEY3............................................................................................................141Printer Global Variables......................................................................................................143@LABEL ..............................................................................................................................143YEAR ....................................................................................................................................144MONTH................................................................................................................................145DATE.....................................................................................................................................146WEEK ...................................................................................................................................147
HOUR....................................................................................................................................148MINUTE ...............................................................................................................................149SECOND...............................................................................................................................150@YEAR ................................................................................................................................151@MONTH ............................................................................................................................153@DATE.................................................................................................................................155@DAY ...................................................................................................................................157@HOUR................................................................................................................................159@MINUTE ...........................................................................................................................161@SECOND ...........................................................................................................................163
8/3/2019 TSPL TSPL2 Programming 2008-4-10
6/173
8/3/2019 TSPL TSPL2 Programming 2008-4-10
7/173
TSC AUTO ID Technology Co., Ltd. II Copyright 2007 All Rights Reserved.
Paper feed direction
DIRECTION 0
Label origin (0,0)
X
YX=7mm
Y=3mm
Object Position Calculation
203 DPI, 1mm=8 dots300 DPI, 1mm=12 dots
DIRECTION 0TEXT 56,24,3,0,1,1,ABC
Paper feed direction
DIRECTION 1Label origin (0,0) X
Y X=7mmY=3mm
DIRECTION 1TEXT 56,24,3,0,1,1,ABC
8/3/2019 TSPL TSPL2 Programming 2008-4-10
8/173
TSC AUTO ID Technology Co., Ltd. III Copyright 2007 All Rights Reserved.
Printer Models ListSeries Models
TTP-243 series 1. TTP-2432. TTP-243E
TTP-243 Plus series 3. TTP-243 Plus4. TTP-243E Plus
TTP-244ME series 5. TTP-243M6. TTP-244ME
TTP-244ME Plus series 7. TTP-244ME PlusTTP-244 series 8. TTP-244
TTP-245 series 9. TTP-24510. TTP-245G11. TTP-245 Plus
TDP-245 series 12. TDP-245
13. TDP-245G14. TDP-245 PlusTTP-246M series 15. TTP-246M
16. TTP-246G17. TTP-246M Plus
TTP-248M series 18. TTP-248MTTP-2410M series 19. TTP-2410M
20. TTP-346MTDP-643 Plus 21. TTP-643 PlusTDP-643R Plus 22. TTP-643R PlusTTP-342 series 23. TTP-342
TTP-342 Plus series 24. TTP-342 PlusTTP-342M series 25. TP-342MTTP-342M Plus series 26. TTP-342M PlusTTP-343 series 27. TTP-343
28. TTP-343 PlusTTP-344M series 29. TTP-344M
30. TTP-344M PlusTTP-346M series 31. TTP-346MM23 series 32. M23
8/3/2019 TSPL TSPL2 Programming 2008-4-10
9/173
TSC AUTO ID Technology Co., Ltd. 1 Copyright 2007 All Rights Reserved.
Set up and System CommandsSIZE
DescriptionThis command defines the label width and length.
Syntax(1) English system (inch)
SIZE m, n(2) Metric system (mm)
SIZE m mm, n mm
Parameter Descriptionm Label width (inch or mm)
n Label length (inch or mm)
Note:
200 DPI: 1 mm = 8 dots
300 DPI: 1mm = 12 dots
For metric system, there must be a space between parameter and mm.
Max. width 72mm 104mm 106mm 108mm
TTP-243 series XTTP-243 Plus series XTTP-244ME series XTTP-244ME Plus series XTTP-244 series XTTP-245 series XTDP-245 series XTTP-246M series XTTP-248M series XTTP-2410M series XTDP-643 Plus series XTDP-643R Plus series XTTP-342 series X
TTP-342 Plus series XTTP-342M series XTTP-342M Plus series XTTP-343 series XTTP-344M series XTTP-346M series XM23 series X
Example(1) English system (inch)
SIZE 3.5, 3.00(2) Metric system (mm)
8/3/2019 TSPL TSPL2 Programming 2008-4-10
10/173
TSC AUTO ID Technology Co., Ltd. 2 Copyright 2007 All Rights Reserved.
SIZE 100 mm, 100 mm
See AlsoGAP, BLINE
8/3/2019 TSPL TSPL2 Programming 2008-4-10
11/173
TSC AUTO ID Technology Co., Ltd. 3 Copyright 2007 All Rights Reserved.
GAP
DescriptionDefine the gap distance between two labels
Syntax(1). English system (inch)
GAP m, n(2) Metric system (mm)
GAP m mm, n mm
Parameter Descriptionm The gap distance between two labels
0
m
1 (inch), 0
m
25.4 (mm)n The offset distance of the gap
n label length (inch or mm)0,0 Continuous label.
Note: For metric system, 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.
Ex: In DOS mode,
C:\>copy con lpt1
GAP 2 mm,0
+
ExampleNormal gap(1). English system (inch)
GAP 0.12,0(2) Metric system (mm)
GAP 3 mm,0(3). Continuous label
GAP 0,0
8/3/2019 TSPL TSPL2 Programming 2008-4-10
12/173
TSC AUTO ID Technology Co., Ltd. 4 Copyright 2007 All Rights Reserved.
Special gap(1). English system (inch)
GAP 0.30, 0.10(2). Metric system (mm)
GAP 7.62 mm, 2.54 mm
See AlsoSIZE, BLINE
8/3/2019 TSPL TSPL2 Programming 2008-4-10
13/173
TSC AUTO ID Technology Co., Ltd. 5 Copyright 2007 All Rights Reserved.
BLINE
DescriptionThis command definesis used to set the height of the black line, and the user-definedextra label feeding length each form feed takes.distance between the leading edge oflabel and the beginning of black line.
Syntax(1) English system (inch)
BLINE m, n(2) Metric system (mm)
BLINE m mm, n mm
Parameter Descriptionm The height of black line either in inch or mm.
0 m 1 (inch), 0 m 25.4 (mm)n The extra label feeding length.distance between label
leading edge and the
beginning of black line. 0 n label length0,0 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.Ex: In DOS mode,
C:\>copy con lpt1
BLINE 2 mm,0
+
Example(1) English system (inch)
BLINE 0.20,0.50
(2) Metric system (mm)BLINE 5.08 mm,12.7 mm
8/3/2019 TSPL TSPL2 Programming 2008-4-10
14/173
TSC AUTO ID Technology Co., Ltd. 6 Copyright 2007 All Rights Reserved.
See AlsoSIZE, GAP
8/3/2019 TSPL TSPL2 Programming 2008-4-10
15/173
TSC AUTO ID Technology Co., Ltd. 7 Copyright 2007 All Rights Reserved.
OFFSET
DescriptionThis command defines the selective, extra label feeding length for each formfeed.Iteach form feed takes, which, especially in peel-off mode and cutter mode, is usedto adjust label stop position, so as for label to register at proper places for theintended purposes. in peel-off mode and cutter mode. The printer back feedsbacktracks the extra feeding length before the next run of printing.
Syntax(1) English system (inch)
OFFSET m(2) Metric system (mm)
OFFSET m mm
Parameter Descriptionm The offset distance (inch or mm)
-1 m 1(inch)
CAUTION: Impropriety offset value may cause paper jam.
Example(1) English system (inch)
OFFSET 0.5
(2) Metric system (mm)OFFSET 12.7 mm
See AlsoSIZE, GAP, SET PEEL, SET CUTTER
8/3/2019 TSPL TSPL2 Programming 2008-4-10
16/173
TSC AUTO ID Technology Co., Ltd. 8 Copyright 2007 All Rights Reserved.
SPEED
DescriptionThis command defines the print speed.
SyntaxSPEED n
Parameter Descriptionn printing speed in inch per second
Model / IPS 1 1.5 2 2.5 3 3.5 4 5 6 8 10
TTP-243 series x x x
TTP-243 Plus series x x xTTP-244ME series x x x xTTP-244ME Plus series x x x xTTP-244 series x x xTTP-245 series x x x xTDP-245 series x x x xTTP-246M series x x x x xTTP-248M series x x x xTTP-2410M series x x x xTDP-643 Plus series x x x
TDP-643R Plus series x x xTTP-342 series x x xTTP-342 Plus series x x xTTP-342M series x x xTTP-342M Plus series x x xTTP-343 series x xTTP-344M series x x xTTP-346M series x x xM23 series x x x x x
ExampleSPEED 10
See AlsoDENSITY
8/3/2019 TSPL TSPL2 Programming 2008-4-10
17/173
TSC AUTO ID Technology Co., Ltd. 9 Copyright 2007 All Rights Reserved.
DENSITY
DescriptionThis command defines designates the printing level of darkness of printing.
SyntaxDENSITY n
Parameter Descriptionn 0~15
0, is specifies the lightest level15, is specifies the darkest level
ExampleDENSITY 7
See AlsoDENSITY
8/3/2019 TSPL TSPL2 Programming 2008-4-10
18/173
TSC AUTO ID Technology Co., Ltd. 10 Copyright 2007 All Rights Reserved.
DIRECTION and Mirror Image
DescriptionThis command defines the printout direction and mirror image. And this will bememorized in EEPROM.
SyntaxDIRECTION n[,m]
Parameter Descriptionn 0 or 1. Please refer to the illustrations as below:m 0: Print normal image. 1: Print mirror image.
8/3/2019 TSPL TSPL2 Programming 2008-4-10
19/173
TSC AUTO ID Technology Co., Ltd. 11 Copyright 2007 All Rights Reserved.
SupportModel
DIRECTION MIRROR
TTP-243 series X
TTP-243 Plus series X XTTP-244ME series X
TTP-244ME Plus series X X
TTP-244 series X X
TTP-245 series X X
TDP-245 series X X
TTP-246M series X X
TTP-248M series X X
TTP-2410M series X X
TDP-643 Plus series X
TDP-643R Plus series X X
TTP-342 series X
TTP-342 Plus series X X
TTP-342M series X
TTP-342M Plus series X X
TTP-343 series X X
TTP-344M series X X
TTP-346M series X X
M23 series X X
ExampleDIRECTION 0[,0]
See AlsoREFERENCE
8/3/2019 TSPL TSPL2 Programming 2008-4-10
20/173
TSC AUTO ID Technology Co., Ltd. 12 Copyright 2007 All Rights Reserved.
REFERENCE
DescriptionThis command defines the reference point of the label. The reference (original)point is different varies with the print direction, as shown:. Please refer to theillustration below:
SyntaxREFERENCE x, y
Parameter Descriptionx Horizontal coordinate, which is shown inwith dot as theunit.y Vertical coordinate, with dot as the unit.
Note: 200 DPI: 1 mm = 8 dots
300 DPI: 1 mm = 12 dots
which is shown in dot.
ExampleREFERENCE 10,10
See AlsoDIRECTION
8/3/2019 TSPL TSPL2 Programming 2008-4-10
21/173
TSC AUTO ID Technology Co., Ltd. 13 Copyright 2007 All Rights Reserved.
SHIFT
DescriptionThis command can be used to fine-tune the entire label up or down from its current
position. The position relates to the top edge of the label. A negative value movesthe entire label away from the top of the label; a positive value moves the entirelabel to the top of label.
SyntaxSHIFT n
Parameter Descriptionn 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 Support
TTP-243 seriesTTP-243 Plus series X
TTP-244ME series
TTP-244ME Plus series X
TTP-244 series X
TTP-245 series X
TDP-245 series X
TTP-246M series XTTP-248M series
TTP-2410M series X
TDP-643 Plus series
TDP-643R Plus series X
TTP-342 series
TTP-342 Plus series X
TTP-342M series
TTP-342M Plus series X
TTP-343 series X
TTP-344M series X
TTP-346M series XM23 series
8/3/2019 TSPL TSPL2 Programming 2008-4-10
22/173
TSC AUTO ID Technology Co., Ltd. 14 Copyright 2007 All Rights Reserved.
Example
SIZE 4,2.5GAP 2 mm,0DIRECTION 0SHIFT 0OFFSET 0CLSTEXT 400,200,"3",0,1,1,"DIRECTION 0"TEXT 400,250,"3",0,1,1,"SHIFT 0"BOX 10,0,780,490,8PRINT 3,1
See AlsoOFFSET, REFERENCE
8/3/2019 TSPL TSPL2 Programming 2008-4-10
23/173
TSC AUTO ID Technology Co., Ltd. 15 Copyright 2007 All Rights Reserved.
COUNTRY
DescriptionThis command defines what special character to have on the KP-200 portable LCDkeyboard (option) to orient the keyboard for use in different countries.
SyntaxCOUNTRY n
Parameter Descriptionn 001: USA
002: Canadian-French003: Spanish (Latin America)
031: Dutch032: Belgian033: French (France)034: Spanish (Spain)036: Hungarian038: Yugoslavian039: Italian041: Switzerland042: Slovak044: United Kingdom045: Danish
046: Swedish047: Norwegian048: Polish049: Germany055: Brazil061: English (International)351: Portuguese358: Finnish
Example
COUNTRY 001
See AlsoCODEPAGE,~!I
8/3/2019 TSPL TSPL2 Programming 2008-4-10
24/173
TSC AUTO ID Technology Co., Ltd. 16 Copyright 2007 All Rights Reserved.
CODEPAGE
DescriptionThis command defines the code page of international character set.
SyntaxCODEPAGE n
Parameter Descriptionn name or number of code page, which can be divided
into 7-bit code page and 8-bit code page further.7-bit code page nameUSA: USA
BRI: BritishGER: GermanyFRE: FrenchDAN: DanishITA: ItalianSPA: SpanishSWE: SwedishSWI: Swiss
8-bit code page number437: United States
850: Multilingual852: Slavic860: Portuguese863: Canadian/French865: Nordic857: Turkish (TSPL2 printers only)
Windows code page1250: Central Europe (TSPL2 printers only)1252: Latin I (TSPL2 printers only)
1253: Greek (TSPL2 printers only)1254: Turkish (TSPL2 printers only)
Note: Whether Tto use 7-bit or 8-bit code page, is determined by the communication
parameter of DATA LENGTH
.
8/3/2019 TSPL TSPL2 Programming 2008-4-10
25/173
TSC AUTO ID Technology Co., Ltd. 17 Copyright 2007 All Rights Reserved.
7-bit Codepage 8-bit Codepage Windows CodepageModel
USA BRI GER FRE DAN ITA SPA SWE SWI 437 850 852 860 863 865 857 1250 1252 1253 1254
TTP-243 series X X X X X X X X X X X X X X X
TTP-243 Plus series X X X X X X X X X X X X X X X
TTP-244ME series X X X X X X X X X X X X X X X
TTP-244ME Plus seriesX X X X X X X X X X X X X X X
TTP-244 series X X X X X X X X X X X X X X X X X X X X
TTP-245 series X X X X X X X X X X X X X X X X X X X X
TDP-245 series X X X X X X X X X X X X X X X X X X X X
TTP-246M series X X X X X X X X X X X X X X X X X X X X
TTP-246M Plus series X X X X X X X X X X X X X X X X X X X X
TTP-248M series X X X X X X X X X X X X X X X X X X X X
TTP-2410M series X X X X X X X X X X X X X X X X X X X X
TDP-643 Plus series X X X X X X X X X X X X X X X
TDP-643R Plus series X X X X X X X X X X X X X X X
TTP-342 series X X X X X X X X X X X X X X X
TTP-342 Plus series X X X X X X X X X X X X X X X
TTP-342M series X X X X X X X X X X X X X X X
TTP-342M Plus series X X X X X X X X X X X X X X X
TTP-343 series X X X X X X X X X X X X X X X X X X X X
TTP-344M series X X X X X X X X X X X X X X X X X X X X
TTP-344M Plus series X X X X X X X X X X X X X X X X X X X X
TTP-346M series X X X X X X X X X X X X X X X X X X X X
M23 series X X X X X X X X X X X X X X X
ExampleCODEPAGE 437
See AlsoCOUNTRY, SET COM1, ~!I
8/3/2019 TSPL TSPL2 Programming 2008-4-10
26/173
TSC AUTO ID Technology Co., Ltd. 18 Copyright 2007 All Rights Reserved.
CLS
DescriptionThis command clears the image buffer.
SyntaxCLS
Parameter DescriptionNone N/A
Note: This command must be placed after SIZE command.
ExampleCLS
See AlsoSIZE, GAP, BLINE
8/3/2019 TSPL TSPL2 Programming 2008-4-10
27/173
TSC AUTO ID Technology Co., Ltd. 19 Copyright 2007 All Rights Reserved.
FEED
DescriptionThis command feeds label with the specified length.The length is specified by dot.
SyntaxFEED n
Parameter Descriptionn unit: dot
1 n 9999
ExampleFEED 40
Note: 200 DPI: 1 mm = 8 dots
300 DPI: 1 mm = 12 dots
See AlsoBACKFEED, SIZE, GAP, BLINE, HOME, FORMFEED
8/3/2019 TSPL TSPL2 Programming 2008-4-10
28/173
TSC AUTO ID Technology Co., Ltd. 20 Copyright 2007 All Rights Reserved.
BACKFEED & BACKUP
DescriptionTo back feed label with the specified length. The length is specified by dot.
SyntaxBACKUP n (TSPL printers only)BACKFEED n (TSPL2 printers only)
Parameter Descriptionn unit: dot
1 n 9999
SupportModelBACKUP BACKFEED
TTP-243 series XTTP-243 Plus series X X
TTP-244ME series X
TTP-244ME Plus series X X
TTP-244 series X X
TTP-245 series X
TDP-245 series X
TTP-246M series X
TTP-248M series XTTP-2410M series X X
TDP-643 Plus series XTDP-643R Plus series X XTTP-342 series X
TTP-342 Plus series X X
TTP-342M series X
TTP-342M Plus series X X
TTP-343 series X
TTP-344M series X
TTP-346M series X X
M23 series X
ExampleBACKUP 40BACKFEED 40
CAUTION: Impropriety back feed value may cause paper jam or wrinkle.
Note: 200 DPI: 1 mm = 8 dots
300 DPI: 1 mm = 12 dots
See Also
8/3/2019 TSPL TSPL2 Programming 2008-4-10
29/173
TSC AUTO ID Technology Co., Ltd. 21 Copyright 2007 All Rights Reserved.
FEED, SIZE, GAP, BLINE, HOME, FORMFEED
8/3/2019 TSPL TSPL2 Programming 2008-4-10
30/173
8/3/2019 TSPL TSPL2 Programming 2008-4-10
31/173
TSC AUTO ID Technology Co., Ltd. 23 Copyright 2007 All Rights Reserved.
HOME
DescriptionIt is not expected Tthe first label is not towill be printed on the right position whenturning on printer the printer power is turned on. This command will feed label tothe beginning of next label (TSPL2) or back label to the beginning of current label(TSPL). TThe size and gap of the label should be setup must bebefore using thiscommandin advance.
SyntaxHOME
Parameter Description
None N/A
HOMEModel
Back Label Feed Label
TTP-243 series XTTP-243 Plus series X
TTP-244ME series X
TTP-244ME Plus series X
TTP-244 series X
TTP-245 series X
TDP-245 series X
TTP-246M series X
TTP-248M series X
TTP-2410M series X
TDP-643 Plus series XTDP-643R Plus series XTTP-342 series X
TTP-342 Plus series X
TTP-342M series X
TTP-342M Plus series X
TTP-343 series X
TTP-344M series XTTP-346M series X
M23 series X
8/3/2019 TSPL TSPL2 Programming 2008-4-10
32/173
TSC AUTO ID Technology Co., Ltd. 24 Copyright 2007 All Rights Reserved.
ExampleSIZE 4,2.5GAP 2 mm,0SPEED 4
DENSITY 7DIRECTION 0OFFSET 0.00REFERENCE 0,0SET PEEL OFFSET CUTTER OFFSET COUNTER @0 +1@0="000001"HOMECLSBOX 1,1,360,65,12
TEXT 25,25,"3",0,1,1,"HOME COMMAND TEST"TEXT 25,80,"3",0,1,1,@0PRINT 3,1
See AlsoFEED, SIZE, GAP, BLINE, FORMFEED
8/3/2019 TSPL TSPL2 Programming 2008-4-10
33/173
8/3/2019 TSPL TSPL2 Programming 2008-4-10
34/173
TSC AUTO ID Technology Co., Ltd. 26 Copyright 2007 All Rights Reserved.
SOUND
DescriptionThis command is used to control the sound frequency of the beeper. There are 10levels of sounds. The timing control the sound can be set by the intervalparameter.
SyntaxSOUND level,interval
Parameter Descriptionlevel Sound level: 0~9interval Sound interval: 1~4095
ExampleSOUND 5,200SOUND 3,200SOUND 3,200SOUND 4,200SOUND 2,200SOUND 2,200SOUND 1,200SOUND 2,200
SOUND 3,200SOUND 4,200SOUND 5,200
8/3/2019 TSPL TSPL2 Programming 2008-4-10
35/173
TSC AUTO ID Technology Co., Ltd. 27 Copyright 2007 All Rights Reserved.
CUT
DescriptionAt this command, the printer will activate the cutter to cut the labels immediatelywithout back feeding the label.
SyntaxCUT
Parameter DescriptionNone N/A
ExampleSIZE 3,3GAP 0 mm,0CLSDIRECTION 0REFERENCE 0,0OFFSET 0.00 mmSET CUTTER OFFSET TEAR OFFBOX 0,0,866,866,5TEXT 100,100,"5",0,1,1,"FEED & CUT"
TEXT 100,200,"5",0,1,1,"300 DPI"PRINT 1,1FEED 260CUT
See AlsoSET CUTTER, SET BACK, SET PARTITAL_CUTTER
8/3/2019 TSPL TSPL2 Programming 2008-4-10
36/173
TSC AUTO ID Technology Co., Ltd. 28 Copyright 2007 All Rights Reserved.
LIMITFEED
DescriptionWhen feeding labels, if the gap sensor is not set to a suitable sensitivity, the printerwill not be able to locate the correct position of the gap. This command is used stoplabel feeding and make the red LED flash if the printer does not locate gap afterfeeding the length of one label plus one preset value.
SyntaxLIMITFEED n (inch, the English system)LIMITFEED n mm (mm, the metric system)
Parameter Description
n inch or mm
RemarkThe setting will remain resident in memory.The default value is 10 inches when printer initializes.For metric system, there must be a space between parameter n and mm.
8/3/2019 TSPL TSPL2 Programming 2008-4-10
37/173
TSC AUTO ID Technology Co., Ltd. 29 Copyright 2007 All Rights Reserved.
SELFTEST
DescriptionAt this command, the printer will print out the printer information on the label.
Model Support
TTP-243 seriesTTP-243 Plus series X
TTP-244ME series
TTP-244ME Plus series X
TTP-244 series X
TTP-245 series X
TDP-245 series X
TTP-246M series X
TTP-248M series
TTP-2410M series X
TDP-643 Plus series
TDP-643R Plus series X
TTP-342 series
TTP-342 Plus series X
TTP-342M series
TTP-342M Plus series X
TTP-343 series X
TTP-344M series XTTP-346M series X
M23 series X
SyntaxSELFTEST
ExampleSELFTEST
8/3/2019 TSPL TSPL2 Programming 2008-4-10
38/173
TSC AUTO ID Technology Co., Ltd. 30 Copyright 2007 All Rights Reserved.
Label Formatting CommandsBAR
DescriptionThis command is used to draw a line or a bar on the label format.
SyntaxBAR x, y, width, height
Parameter Descriptionx The upper left corner x-coordinate in doty The upper left corner y-coordinate in dot
width The width of bar in dotheight The height of bar in dot
Note: 200 DPI: 1 mm = 8 dots
300 DPI: 1 mm = 12 dots
Recommended max. bar height is 12mm at 4 width. Bar height over 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.
ExampleSIZE 4,2.5GAP 0,0SPEED 6DENSITY 8DIRECTION 0CLSBAR 100, 100, 300, 200PRINT 1,1
See AlsoBOX
8/3/2019 TSPL TSPL2 Programming 2008-4-10
39/173
TSC AUTO ID Technology Co., Ltd. 31 Copyright 2007 All Rights Reserved.
BARCODEDescription
This command is used to print 1-D barcodes on label form.The available bar codes are listed below:
Code 128 (switching code subset automatically) Code 128M (switching code subset manually) EAN 128 (switching code subset automatically) Interleaved 2 of 5 Interleaved 2 of 5 with check digit Code 39 standard Code 39 full ASCII Code 39 full ASCII 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 PLESSEY China POST ITF14 EAN14
8/3/2019 TSPL TSPL2 Programming 2008-4-10
40/173
TSC AUTO ID Technology Co., Ltd. 32 Copyright 2007 All Rights Reserved.
SyntaxBARCODE X, Y, code type, height, human readable, rotation, narrow, wide,code
Parameter DescriptionX Specify the x-coordinate of the bar code on labelY Specify the y-coordinate of the bar code on labelcode type
128 Code 128, switching code subset A, B, Cautomatically
128M Code 128, switching code subset A, B, C manually.
Control code A B C
096 FNC3 FNC3 NONE
097 FNC2 FNC2 NONE
098 SHIFT SHIFT NONE099 CODE C CODE C NONE
100 CODE B FNC4 CODE B
101 FNC4 CODE A CODE A
102 FNC1 FNC1 FNC1
103 Start (CODE A)
104 Start (CODE B)
105 Start (CODE C)
Use ! as a starting character for the control code followed by three control
codes.If the start subset is not set, the default starting subset is B.
EAN128 Code 128, switching code subset A, B, Cautomatically
25 Interleaved 2 of 525C Interleaved 2 of 5 with check digits39 Code 39 full ASCII for TSPL2 printers
Code 39 standard for TSPL printersAuto switch full ASCII and standard code 39 forPLUS
models.39C Code 39 full ASCII with check digit for TSPL2 printers
Code 39 standard with check digit for TSPL printersAuto switch full ASCII and standard code 39 forPLUSmodels.
39S Code 39 standard for TSPL2 printers93 Code 93EAN13 EAN 13EAN13+2 EAN 13 with 2 digits add-onEAN13+5 EAN 13 with 5 digits add-onEAN8 EAN 8EAN8+2 EAN 8 with 2 digits add-onEAN8+5 EAN 8 with 5 digits add-on
8/3/2019 TSPL TSPL2 Programming 2008-4-10
41/173
TSC AUTO ID Technology Co., Ltd. 33 Copyright 2007 All Rights Reserved.
CODA CodabarPOST PostnetUPCA UPC-AUPCA+2 UPC-A with 2 digits add-on
UPCA+5 UPC-A with 5 digits add-onUPCE UPC-EUPCE+2 UPC-E with 2 digits add-onUPCE+5 UPC-E with 5 digits add-onCPOST China post codeMSI MSI codeMSICPLESSEY PLESSEY codeITF14 ITF 14 codeEAN14 EAN 14 code
height bar code height expressed by dothuman readable 0 : human not readable
1 : human readablerotation Rotate bar code orientation in degrees with clockwise
directionin degrees0 non rotation90 rotate 90 degrees with clockwise direction180 rotate 180 degrees with clockwise direction270 rotate 270 degrees with clockwise direction
narrow width of narrow element in dotwide width of wide element in dot
narrow : wide1:1
narrow : wide1:2
narrow : wide1:3
narrow : wide2:5
narrow : wide3:7
128 10x - - - -
EAN128 10x - - - -
25 - 10x 10x 5x -
25C - 10x 10x 5x -
39 - 10x 10x 5x -
39C - 10x 10x 5x -
93 - - 10x - -
EAN13 8x - - - -EAN13+2 8x - - - -
EAN13+5 8x - - - -
EAN 8 8x - - - -
EAN 8+2 8x - - - -
EAN 8+5 8x - - - -
CODA - 10x 10x 5x -
POST 1x - - - -
UPCA 8x - - - -
UPCA+2 8x - - - -
UPCA+5 8x - - - -UPCE 8x - - - -
8/3/2019 TSPL TSPL2 Programming 2008-4-10
42/173
TSC AUTO ID Technology Co., Ltd. 34 Copyright 2007 All Rights Reserved.
UPCE+2 8x - - - -
UPCE+5 8x - - - -
CPOST - - - - 1x
MSI - - 10x - -
MSIC 10x -PLESSY - - 10x - -
ITF14 - 10x 10x 5x -
EAN14 - - - - -
code number the maximum number of digits of bar code content
Barcode typeMaximum bar
code length
128 -
EAN128 -25 -
25C -
39 -
39C -
93 -
EAN13 12
EAN13+2 14
EAN13+5 17
EAN 8 7
EAN 8+2 9EAN 8+5 12
CODA -
POST 5,9,11
UPCA 11
UPCA+2 13
UPCA+5 16
UPCE 6
UPCE+2 8
UPCE+5 11
CPOST -
MSI -
MSIC
PLESSY -
ITF14 13
EAN14 13
ExampleBARCODE 100,100,39,96,1,0,2,4,1000BARCODE 10,10,128M,48,1,0,2,2,!104!096ABCD!101EFGH(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 bythe ABCD characters and EFGH characters encoded as CODE A subset.)
8/3/2019 TSPL TSPL2 Programming 2008-4-10
43/173
TSC AUTO ID Technology Co., Ltd. 35 Copyright 2007 All Rights Reserved.
Barcode Type
Model
128
EAN128
25
25C
39forTS
PL2
39forTS
PL
39forPL
US
39CforT
SPL2
39CforT
SPL
39CforP
LUS
39S
93
EAN13
EAN13+2
EAN13+5
EAN8
EAN8+2
EAN8+5
CODA
POST
UPCA
UPCA+2
UPCA+5
UPCE
UPCE+2
UPCE+5
CPOST
MSI
MSIC
PLESSY
ITF14
EAN14
TTP-243 series X X X X X X X X X X X X X X X X X X X X X XTTP-243 Plus series X X X X X X X X X X X X X X X X X X X X X X X X X X X
TTP-244ME series X X X X X X X X X X X X X X X X X X X X X X
TTP-244ME Plus series X X X X X X X X X X X X X X X X X X X X X X X X X X X
TTP-244 series X X X X X X X X X X X X X X X X X X X X X X X X X X X
TTP-245 series X X X X X X X X X X X X X X X X X X X X X X X X X X X X
TDP-245 series X X X X X X X X X X X X X X X X X X X X X X X X X X X X
TTP-246M series X X X X X X X X X X X X X X X X X X X X X X X X X X X X
TTP-248M series X X X X X X X X X X X X X X X X X X X X X X X X X X X
TTP-2410M series X X X X X X X X X X X X X X X X X X X X X X X X X X XTDP-643 Plus series X X X X X X X X X X X X X X X X X X X X X XTDP-643R Plus series X X X X X X X X X X X X X X X X X X X X X X X X X X XTTP-342 series X X X X X X X X X X X X X X X X X X X X X X
TTP-342 Plus series X X X X X X X X X X X X X X X X X X X X X X X X X X X
TTP-342M series X X X X X X X X X X X X X X X X X X X X X X
TTP-342M Plus series X X X X X X X X X X X X X X X X X X X X X X X X X X X
TTP-343 series X X X X X X X X X X X X X X X X X X X X X X X X X X X X
TTP-344M series X X X X X X X X X X X X X X X X X X X X X X X X X X X X
TTP-346M series X X X X X X X X X X X X X X X X X X X X X X X X X X X
M23 series X X X X X X X X X X X X X X X X X X X X X X X X X X X X
8/3/2019 TSPL TSPL2 Programming 2008-4-10
44/173
TSC AUTO ID Technology Co., Ltd. 36 Copyright 2007 All Rights Reserved.
BITMAP
DescriptionThis command is used to draw bitmap images (Not BMP graphic file).
SyntaxBITMAP X, Y, width, height, mode, bitmap data
Parameter DescriptionX Specify the x-coordinate of the bitmap imageY Specify the y-coordinate of the bitmap imagewidth The width of the image in bytesheight The height of the image in dot
mode Graphic mode is listed below:0 OVERWRITE1 OR2 XOR
bitmap data The bitmap data
Example
8/3/2019 TSPL TSPL2 Programming 2008-4-10
45/173
TSC AUTO ID Technology Co., Ltd. 37 Copyright 2007 All Rights Reserved.
L-Byte R-ByteROW(Y- axis) Binary Hexadecimal Binary Hexadecimal
0 00000000 00 00000000 00
1 00000000 00 00000000 00
2 00000000 00 00000000 003 00000111 07 11111111 FF4 00000011 03 11111111 FF
5 00010001 11 11111111 FF6 00011000 18 11111111 FF7 00011100 1C 01111111 7F
8 00011110 1E 00111111 3F9 00011111 1F 00011111 1FA 00011111 1F 10001111 8FB 00011111 1F 11000111 C7C 00011111 1F 11100011 E3
D 00011111 1F 11110111 F7E 00011111 1F 11111111 FFF 00011111 1F 11111111 FF
Ex:SIZE 4,2GAP 0,0CLSBITMAP 200,200,2,16,0, -?????PRINT 1,1
Hexadecimal ASCII53 49 5A 45 20 34 2C 32 0D 0A 47 41 5020 30 2C 30 0D 0A 43 4C 53 0D 0A 42 4954 4D 41 50 20 32 30 30 2C 32 30 30 2C32 2C 31 36 2C 30 2C00 00 00 00 00 0007 FF 03 FF 11 FF 18 FF 1C 7F 1E 3F 1F1F 1F 8F 1F C7 1F E3 1F E7 1F FF 1F FF0D 0A 50 52 49 4E 54 20 31 2C 31 0D 0A
SIZE 4,2GAP 0,0CLSBITMAP 200,200,2,16,0, -?????PRINT 1,1
See AlsoPUTBMP, PUTPCX
8/3/2019 TSPL TSPL2 Programming 2008-4-10
46/173
TSC AUTO ID Technology Co., Ltd. 38 Copyright 2007 All Rights Reserved.
BOX
DescriptionThis command is used to draw rectangles on the label.
SyntaxBOX X_start, Y_start, X_end, Y_end, line thickness
Parameter DescriptionX_start Specify x-coordinate of upper left corner in dotY_start Specify y-coordinate of upper left corner in dotX_end Specify x-coordinate of lower right corner in dotY_end Specify y-coordinate of lower right corner in dot
line thickness Line thickness of the box in dot
Note: 200 DPI: 1 mm = 8 dots
300 DPI: 1 mm = 12 dots
Recommended max. thickness of box is 12mm at 4 width. Thickness of box
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.
ExampleSIZE 4,2.5GAP 0,0SPEED 6DENSITY 8DIRECTION 0CLSBOX 100,100,200,200,5PRINT 1,1
See AlsoBAR
8/3/2019 TSPL TSPL2 Programming 2008-4-10
47/173
TSC AUTO ID Technology Co., Ltd. 39 Copyright 2007 All Rights Reserved.
DMATRIX
DescriptionThis command is used to define the DataMatrix 2-D bar code. Currently, it supportsECC200 error correction only.
SyntaxDMATRIX x, y, width, height, [xm,row,col,], expression
Parameter Descriptionx Horizontal start position in doty Vertical start position in dot
width The expected width of barcode area in dotheight The expected height of barcode area in dotxm Module size in dotrow Symbol size of row ,10 to 144col Symbol size of col,10 to 144
ExampleSIZE 3,3GAP 0,0SPEED 4DENSITY 8
DIRECTION 0REFERENCE 0,0OFFSET 0.00SET CUTTER OFFSET TEAR ONCLSDMATRIX 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
8/3/2019 TSPL TSPL2 Programming 2008-4-10
48/173
TSC AUTO ID Technology Co., Ltd. 40 Copyright 2007 All Rights Reserved.
ERASE
DescriptionThis command is used to clear a specified region in image buffer.
SyntaxERASE X_start, Y_start, X_width, Y_height
Parameter DescriptionX_start The x-coordinate of the starting point in dotY_start The y-coordinate of the starting point in dotX_width The region width in x-axis direction in dotY_height The region height in y-axis direction in dot
ExampleSIZE 4,2.5GAP 0,0SPEED 6DENSITY 8DIRECTION 0CLSBAR 100, 100, 300, 300ERASE 150,150,200,200
PRINT 1,1
See AlsoCLS
8/3/2019 TSPL TSPL2 Programming 2008-4-10
49/173
TSC AUTO ID Technology Co., Ltd. 41 Copyright 2007 All Rights Reserved.
MAXICODE
DescriptionThis command is used to define a 2-D Maxicode.
SyntaxMAXICODE x, y, mode, [class, country, post, Lm,] message
For mode 2 or 3:MAXICODE x, y, mode, class, country, postal code, low priority message"
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,6MAXICODE x, y, mode, [Lm], "message"
* AIM special format is supported, see page 23 in the spec.
Note: Mode 6 is not supported in TSPL2 printers firmware.
Parameter Descriptionx X-coordinate starting pointX-coordinate of the staring
point in doty Y-coordinate starting pointY-coordinate of the startingpoint in dotmode 2,3,4,5class Class of service, 3-digit number (for mode 2,3)country Country code, 3-digit number (for mode 2,3)post Post code (for mode 2,3)
Mode 2: (USA) 5-digit+ 4-digit numberMode3: (Canada) 6 alphanumeric post codeincluded by double quotes.
Lm Expression length (double quote is ignored) , 1m138,
(this parameter is just for mode 4 and 5.)message Barcode content
ExampleSIZE 4,2GAP 0,0CLSSPEED 4DENSITY 8OFFSET 0.00REFERENCE 0,0SET CUTTER OFF
8/3/2019 TSPL TSPL2 Programming 2008-4-10
50/173
8/3/2019 TSPL TSPL2 Programming 2008-4-10
51/173
TSC AUTO ID Technology Co., Ltd. 43 Copyright 2007 All Rights Reserved.
PDF417
DescriptionThis command is used to define a PDF417 2-D barcode.
SyntaxPDF417 x, y, width, height, rotate, [option], expression
Parameter Descriptionx X-coordinate of the starting point in doty Y-coordinate of the starting point in dotwidth The expected width of barcode in dotheight The expected height of barcode in dot
rotate Rotation counter clockwise.0: 0 degree90: 90 degrees180: 180 degrees270: 270 degrees
expression Barcode text or string expression to be printed onlabelle.
[option]P Data compression method
0: Auto encoding
1: Binary modeE Error correction level
Range: 0~8M Center pattern in barcode area
0: The pattern will print upper left justified the area1: The pattern is printed middle of area
Ux,y,c Human readablex: Human readable characters in the specified
x-coordinatey: Human readable characters in the specified
y-coordinatec: Maximum characters of human readable character
per lineW Module width in dot
Range: 2~9H Bar height in dot
Range: 4~99R Maximum Nnumber of maximum rowsC Maximum Nnumber of maximum columnsT Truncation.
0: Not truncated
1: TruncatedLm Expression length (without double quote), 1m2048
8/3/2019 TSPL TSPL2 Programming 2008-4-10
52/173
TSC AUTO ID Technology Co., Ltd. 44 Copyright 2007 All Rights Reserved.
ExampleSIZE 3,3GAP 0.12,0CLS
SPEED 6DENSITY 8DIRECTION 1REFERENCE 0,0
REM *****WITHOUR OPTIONS*****CLSPDF417 50,50,400,200,0,"Without Options"PRINT 1,1
REM *****OPTION:E4*****
CLSPDF417 50,50,400,200,0,E4,"Error correction level:4"PRINT 1,1
REM *****OPTION:E4 W4*****CLSPDF417 50,50,600,600,0,E4,W4,"Error correction level:4module width 4 dots"PRINT 1,1
REM *****OPTION:E4 W4 H4*****CLSPDF417 50,50,600,600,0,E4,W4,H4,"Error correction level:4module width 4 dotsbar height 4 dots"PRINT 1,1
REM *****OPTION:E4 W4 H4 R25*****CLS
PDF417 50,50,600,600,0,E4,W4,H4,R25,"Error correction level:4Module Width 4 dotsBar Height 4 dotsMaximum Number of Rows: 25 Rows"PRINT 1,1
REM *****OPTION:E4 W4 H4 R40 C3*****CLSPDF417 50,50,600,600,0,E4,W4,H4,R40,C3,"Error correction level:4Module Width 4 dots
Bar Height 4 dotsMaximum Number of Rows: 40 Rows
8/3/2019 TSPL TSPL2 Programming 2008-4-10
53/173
TSC AUTO ID Technology Co., Ltd. 45 Copyright 2007 All Rights Reserved.
Maximum number of columns: 3 Cols"PRINT 1,1
REM *****OPTION:E4 W4 H4 R40 C4 T0*****CLSPDF417 50,50,600,600,0,E4,W4,H4,R40,C4,T0,"Error correction level:4Module Width 4 dotsBar Height 4 dotsMaximum Number of Rows: 40 RowsMaximum number of columns: 4 ColsTruncation:0"PRINT 1,1
REM *****OPTION:E4 W4 H4 R40 C4 T1*****CLSPDF417 50,50,900,900,0,E4,W4,H4,R40,C4,T1,"Error correction level:4Module Width 4 dotsBar Height 4 dotsMaximum Number of Rows:5 RowsMaximum number of columns:90 ColsTruncation:1"PRINT 1,1
REM *****OPTION:E4 W4 H4 R40 C4 T0 L169*****CLSPDF417 50,50,900,900,0,E4,W4,H4,R40,C4,T0,L169,Error correction level:4Module Width 4 dotsBar Height 4 dotsMaximum Number of Rows: 40 RowsMaximum number of columns: 4 ColsTruncation:0Expression length:167PRINT 1,1
REM *****OPTION:E4 W4 H4 R40 C4 T1 L169*****CLSPDF417 50,50,900,900,0,E4,W4,H4,R40,C4,T1,L169,Error correction level:4Module Width 4 dotsBar Height 4 dotsMaximum Number of Rows: 40 RowsMaximum number of columns: 4 ColsTruncation:1Expression length:169PRINT 1,1
REM *****OPTION:P0 E4 W4 H4 R40 C4 T1 L169*****
8/3/2019 TSPL TSPL2 Programming 2008-4-10
54/173
TSC AUTO ID Technology Co., Ltd. 46 Copyright 2007 All Rights Reserved.
CLSPDF417 50,50,900,900,0,P0,E4,W4,H4,R40,C4,T1,L169,Error correction level:4Module Width 4 dotsBar Height 4 dots
Maximum Number of Rows: 40 RowsMaximum number of columns: 4 ColsTruncation:1Expression length:169PRINT 1,1
REM *****OPTION:P0 E4 M0 W6 H6 R60 C4 T0 L283*****SIZE 3,2CLSPDF417 50,50,900,600,0,P0,E4,M0,W6,H6,R60,C4,T0,L283,Data compressionmethod: P0
Error correction level: E4Center pattern in barcode area: M0Human Readable: NoModule Width 6 dots: W6Bar Height 6 dots: H6Maximum Number of Rows: 60 Rows: R60Maximum number of columns: 4 Cols: C4Truncation:0: T0Expression length:283: L283PRINT 1,1
REM *****OPTION:P1 E4 M1 U100,500,10 W4 H4 R60 C4 T1 L297*****CLSPDF417 50,50,900,600,0,P1,E4,M1,U100,500,10,W6,H6,R60,C4,T1,L297,Datacompression method: P1Error correction level: E4Center pattern in barcode area: M1Human Readable: Yes: U100,300,10Module Width 6 dots: W6Bar Height 6 dots: H6Maximum Number of Rows: 60 Rows: R60Maximum number of columns: 4 Cols: C4Truncation:1: T1Expression length:297: L297PRINT 1,1
8/3/2019 TSPL TSPL2 Programming 2008-4-10
55/173
TSC AUTO ID Technology Co., Ltd. 47 Copyright 2007 All Rights Reserved.
PUTBMP
DescriptionThis command is used to print BMP format image.
SyntaxPUTBMP X, Y, filename
Parameter DescriptionX The x-coordinate of the BMP format imageY The y-coordinate of the BMP format imagefilename The downloaded BMP filename.
Model PUTBMP Command Supported
TTP-243 seriesTTP-243 Plus series X
TTP-244ME series
TTP-244ME Plus series X
TTP-244 series X
TTP-245 series X
TDP-245 series X
TTP-246M series X
TTP-248M series
TTP-2410M series XTDP-643 Plus
TDP-643R Plus X
TTP-342 series
TTP-342 Plus series X
TTP-342M series
TTP-342M Plus series X
TTP-343 series X
TTP-344M series X
TTP-346M series X
M23 series X
8/3/2019 TSPL TSPL2 Programming 2008-4-10
56/173
TSC AUTO ID Technology Co., Ltd. 48 Copyright 2007 All Rights Reserved.
Example
See AlsoDOWNLOAD, BITMAP, PUTPCX
8/3/2019 TSPL TSPL2 Programming 2008-4-10
57/173
TSC AUTO ID Technology Co., Ltd. 49 Copyright 2007 All Rights Reserved.
PUTPCX
DescriptionThis command is used to print PCX format image.TSPL language supports 2-color PCX format graphics.TSPL2 language supports 256-color PCX format graphics.
SupportModel
2 color PCX 256 color PCX
TTP-243 series XTTP-243 Plus series X X
TTP-244ME series X
TTP-244ME Plus series X X
TTP-244 series X XTTP-245 series X X
TDP-245 series X X
TTP-246M series X X
TTP-248M series X X
TTP-2410M series X X
TDP-643 Plus X
TDP-643R Plus X X
TTP-342 series X
TTP-342 Plus series X X
TTP-342M series XTTP-342M Plus series X X
TTP-343 series X X
TTP-344M series X X
TTP-346M series X X
M23 series X X
SyntaxPUTPCX X, Y, filename
Parameter DescriptionX The x-coordinate of the PCX imageY The y-coordinate of the PCX imagefilename The downloaded PCX filename. Case sensitive
8/3/2019 TSPL TSPL2 Programming 2008-4-10
58/173
TSC AUTO ID Technology Co., Ltd. 50 Copyright 2007 All Rights Reserved.
Example
See AlsoDOWNLOAD, BITMAP, PUTPCX
8/3/2019 TSPL TSPL2 Programming 2008-4-10
59/173
TSC AUTO ID Technology Co., Ltd. 51 Copyright 2007 All Rights Reserved.
QRCODE
DescriptionThis command is used to print QR code
Model QR Code
TTP-243 seriesTTP-243 Plus series X
TTP-244ME series
TTP-244ME Plus series X
TTP-244 series X
TTP-245 series X
TDP-245 series X
TTP-246M series X
TTP-248M series
TTP-2410M series X
TDP-643 Plus
TDP-643R Plus X
TTP-342 series
TTP-342 Plus series X
TTP-342M series
TTP-342M Plus series X
TTP-343 series X
TTP-344M series XTTP-346M series X
M23 series X
SyntaxQRCODE X, Y, ECC Level, cell width, mode, rotation, [model, mask,]"Data string
Parameter DescriptionX The upper left corner x-coordinate of the QR code
Y The upper left corner y-coordinate of the QR codeECC level Error correction recovery levelL 7%M 15%Q 25%H 30%
cell width 1~10mode Auto / manual encode
A AutoM Manual
rotation
0 0 degree90 90 degree
8/3/2019 TSPL TSPL2 Programming 2008-4-10
60/173
TSC AUTO ID Technology Co., Ltd. 52 Copyright 2007 All Rights Reserved.
180 180 degree270 270 degree
modelM1 (default), original version
M2 enhanced versionmask S0~S8, default is S7Data string 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 EAA4HEX. These are values shifted from those of JIS X 0208. Refer to JIS X 0208Annex 1 Shift Coded Representation for detail.).
Data characters per symbol (for maximum symbol size):
Model 1 (Version 14-L) Model 2 (Version 40-L)1). Numeric data: 1,167 characters 7,089 characters2). Alphanumeric data: 707 characters 4,296 characters
3). 8-bit byte data: 486 characters 2,953 characters4). Kanji data: 299 characters 1,817 characters
*If A is the first character in the data string, then the following data after Aare Alphanumeric data.
*If N is the first character in the data string, then the following data after Nare numeric data.
*If B is the first character in the data string, then the following 4 digits afterB is used to specify numbers of data. After the 4 digits are the number ofbytes of binary data to be encoded.
*If K is the first character in the data string , then the following data afterK is Kanji data.
*If ! is in the data string and follows by N, A, B, K then it will beswitched to specified encodable character set.
Example
Manual mode example:QRCODE 100,10,L,7,M,0,M1,S1,"ATHE FIRMWARE HAS BEENUPDATED"(Where A: Alphanumeric data)
QRCODE 100,10,M,7,M,0,M1,S2,"N123456"(Where N: Numeric data)
8/3/2019 TSPL TSPL2 Programming 2008-4-10
61/173
8/3/2019 TSPL TSPL2 Programming 2008-4-10
62/173
TSC AUTO ID Technology Co., Ltd. 54 Copyright 2007 All Rights Reserved.
CAP 0.12,0CLSQRCODE 10,10,H,4,A,0,"ABC\["]abc\["]123"QRCODE 160,160,H,4,A,0,"123\["]ABC\["]abc"
QRCODE 310,310,H,4,A,0,"\["]\["]ABCabc123"PRINT 1,1
(3) Manual modea. General data string
SIZE 4,2.5CAP 0.12,0CLSQRCODE 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,1b. Data string including character, is an 8-bit byte data
SIZE 4,2.5CAP 0.12,0CLSQRCODE 10,10,H,4,M,0,"AABC!B0007abc!N123"QRCODE 160,160,H,4,M,0,"N123!B0002!AABC!B0005abc"
QRCODE 310,310,H,4,M,0,"K !B0002
!AABC!B0010abc123"
PRINT 1,1
c. Data string concatenation (Must be used with DOWNLOAD ... EOP command)DOWNLOAD A.BASSIZE 4,2.5CAP 0.12,0CLS
QRCODE 10,10,H,4,M,0,"AABC!B0006abc123!N"+STR$(1234)QRCODE 160,160,H,4,M,0,"N123!AABC!B0007abc"+"1234"QRCODE 310,310,H,4,M,0,"K !AABC!B0014abc123"+"1234"+"abcd"
PRINT 1,1EOPA
d. Data string including double quote () character, please use \["] instead ofSIZE 4,2.5CAP 0.12,0CLS
QRCODE 10,10,H,4,M,0,"AABC!B0005\["]abc\["]!N123"QRCODE 160,160,H,4,M,0,"N123!B0001\["]!AABC!B0004\["]abc"
8/3/2019 TSPL TSPL2 Programming 2008-4-10
63/173
TSC AUTO ID Technology Co., Ltd. 55 Copyright 2007 All Rights Reserved.
QRCODE 310,310,H,4,M,0,"B0001\["]!K !B0010\["]ABCabc123"
PRINT 1,1
8/3/2019 TSPL TSPL2 Programming 2008-4-10
64/173
TSC AUTO ID Technology Co., Ltd. 56 Copyright 2007 All Rights Reserved.
REVERSE
DescriptionThis command is used to reverse a region in image buffer.
SyntaxREVERSE X_start, Y_start, X_width, Y_height
Parameter DescriptionX_start The x-coordinate of the starting point in dotY_start The y-coordinate of the starting point in dotX_width The region width in x-axis direction in dotY_height The region height in y-axis direction in dot
Note: 200 DPI: 1 mm = 8 dots
300 DPI: 1 mm = 12 dots
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.
ExampleSIZE 4,2.5GAP 0,0SPEED 6DENSITY 8DIRECTION 0CLSTEXT 100,100,"3",0,1,1,"REVERSE"REVERSE 90,90,128,40PRINT 1,1
8/3/2019 TSPL TSPL2 Programming 2008-4-10
65/173
TSC AUTO ID Technology Co., Ltd. 57 Copyright 2007 All Rights Reserved.
TEXT
DescriptionThis command is used to print text on label
Note:(1). The internal font (font #1~#5) pitch between TSPL and TSPL2 is
different.(2). Font 0 and ROMAN.TTF internal True Type Fonts are available in
TSPL2 language printers. It is not available in TSPL language printers.
SyntaxTEXT X, Y, font, rotation, x-multiplication, y-multiplication, content
Parameter DescriptionX The x-coordinate of the textY The y-coordinate of the textfont Font name
0 Monotye CG Triumvirate Bold Condensed, font width andheight is stretchable
1 8 x 12 fixed pitch dot font2 12 x 20 fixed pitch dot font3 16 x 24 fixed pitch dot font4 24 x 32 fixed pitch dot font5 32 x 48 dot fixed pitch font
6 14 x 19 dot fixed pitch font OCR-B7 21 x 27 dot fixed pitch font OCR-B8 14 x25 dot fixed pitch font OCR-AROMAN.TTF Monotye CG Triumvirate Bold Condensed, font width
and height proportion is fixed
Rotation The rotation angle of text0 0 degree90 90 degrees, in clockwise direction180 180 degrees, in clockwise direction270 270 degrees, in clockwise direction
X-multiplication: Horizontal multiplication, up to 10x.Available factors: 1~10For ROMAN.TTF true type font, this parameter isignored.For font 0, this parameter is used to specify the width(point) of true type font.1 point=1/72 inch.
Y-multiplication: Vertical multiplication, up to 10x.Available factors: 1~10
For true type font, this parameter is used to specify theheight (point) of true type font.
8/3/2019 TSPL TSPL2 Programming 2008-4-10
66/173
TSC AUTO ID Technology Co., Ltd. 58 Copyright 2007 All Rights Reserved.
1 point=1/72 inch.
Note:
1. If there is any double quote () within the text, please change it to \[].
2. Font 0 and ROMAN.TTF internal True Type Fonts are available inTSPL2 language printers.3. 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.
MODEL Font Type0 1 2 3 4 5 6 7 8 ROMAN.TTF
TTP-243 series X X X X XTTP-243 Plus series X X X X X
TTP-244ME series X X X X X
TTP-244ME Plus series X X X X XTTP-244 series X X X X X X X X X X
TTP-245 series X X X X X X X X X X
TDP-245 series X X X X X X X X X X
TTP-246M series X X X X X X X X X X
TTP-248M series X X X X X X X X
TTP-2410M series X X X X X X X X X X
TDP-643 Plus X X X X X
TDP-643R Plus X X X X X
TTP-342 series X X X X X
TTP-342 Plus series X X X X XTTP-342M series X X X X X
TTP-342M Plus series X X X X X
TTP-343 series X X X X X X X X X X
TTP-344M series X X X X X X X X X X
TTP-346M series X X X X X X X X X X
M23 X X X X X X X X X X
ExampleSIZE 3,2GAP 0,0CLSTEXT 100,100,5,0,1,1,\[]DEMO FOR TEXT\[]TEXT 100,200,ROMAN.TTF,0,1,20,\[]True Type Font Test Print\[]PRINT 1,1
8/3/2019 TSPL TSPL2 Programming 2008-4-10
67/173
TSC AUTO ID Technology Co., Ltd. 59 Copyright 2007 All Rights Reserved.
Status Polling Commands (RS-232)
!?
DescriptionThis command is used to getobtain the printer status. An inquiry request is solicitedby sending an (ASCII 27, escape character) as the beginning controlcharacter to the printer. It can be sent any time, even in the stateevent of printer error.One byte character is returned, isof whicha bit compacted one bit is used statusindicatingto flag the current printers current readiness status. If 0 is returned, theprinter is ready to print labels.
Bit Status
0 Ready01 Head openedPrinter carriage open12 Paper jam23 Out of paper34 Out of ribbon45 Pause56 Printing Reserved67 Cover opened (option)7 Environment Temperature over range (option)
Hex Receive Printer Status
00 Normal
01 Head opened
02 Paper Jam
03 Paper Jam and head opened
04 Out of paper
05 Out of paper and head opened
08 Out of ribbon
09 Out of ribbon and head opened
0A Out of ribbon and paper jam
0B Out of ribbon, paper jam and head opened
0C Out of ribbon and out of paper0D Out of ribbon, out of paper and head opened
10 Pause
20 Printing
80 Other error
Syntax!?
See Also
!R
8/3/2019 TSPL TSPL2 Programming 2008-4-10
68/173
TSC AUTO ID Technology Co., Ltd. 60 Copyright 2007 All Rights Reserved.
!R
DescriptionThis command is used to reset the printer. It can be sent at any time as long as theprinter is powered on up except inand not in the dump mode. The beginning of thecommand is an ESCAPE character (ASCII 27). The files downloaded in memorywill be deleted.
Syntax!R
Parameter DescriptionN/A N/A
See Also!?
8/3/2019 TSPL TSPL2 Programming 2008-4-10
69/173
TSC AUTO ID Technology Co., Ltd. 61 Copyright 2007 All Rights Reserved.
~!@
DescriptionThis command is used to inquire the mileage of the printer. The integer part ofmileage is returned (the decimal part of mileage is not return). It is returned to PC inASCII characters. The ending character of mileage is 0x0D.
Syntax~!@
Parameter DescriptionNone N/A
Example~!@
8/3/2019 TSPL TSPL2 Programming 2008-4-10
70/173
TSC AUTO ID Technology Co., Ltd. 62 Copyright 2007 All Rights Reserved.
~!A
DescriptionThis command is used to inquire about the free memory of the printer. The numberof bytes of free memory is returned in decimal digits, with 0x0d as ending code ofPC.
Syntax~!A
Parameter DescriptionNone N/A
Example~!A
See AlsoFILES
8/3/2019 TSPL TSPL2 Programming 2008-4-10
71/173
TSC AUTO ID Technology Co., Ltd. 63 Copyright 2007 All Rights Reserved.
~!C
DescriptionThis command is used to inquire the presence of Real Time Clock. One byte isreturn from the printer, indicating whether or not the RTC is installed.
Return value Description0 RTC is not installed.1 RTC is installed.
Syntax~!C
Parameter DescriptionNone N/A
Example~!C
See AlsoYEAR, MONTH, DATE, WEEK, HOUR, MINUTE, SECOND, @YEAR,@MONTH, @DATE, @DAY, @HOUR, @MINUTE, @SECOND
8/3/2019 TSPL TSPL2 Programming 2008-4-10
72/173
TSC AUTO ID Technology Co., Ltd. 64 Copyright 2007 All Rights Reserved.
~!D
DescriptionThis command is used to enter DUMP mode.
Syntax~!D
Parameter DescriptionNone N/A
Example
~!D
8/3/2019 TSPL TSPL2 Programming 2008-4-10
73/173
TSC AUTO ID Technology Co., Ltd. 65 Copyright 2007 All Rights Reserved.
~!F
DescriptionThis command is used to inquire about the files that resident in the printer memoryand the fonts installed in the memory module.The filename is returned in ASCII characters. Each file name ends with 0x0D. Theending character is and0x1A.
Syntax~!F
Parameter DescriptionNone N/A
Example~!F
See AlsoFILES
8/3/2019 TSPL TSPL2 Programming 2008-4-10
74/173
TSC AUTO ID Technology Co., Ltd. 66 Copyright 2007 All Rights Reserved.
~!I
DescriptionThe command is used to inquire the code page and country setting of the printer.The returned information is given in the following formatcode page, country codeex: 8 bit: 437, 001
7 bit: USA, 001Regarding the code pages and country codes supported by the printer, please refer tothe CODEPAGE and COUNTRY command respectively.
Syntax~!I
Parameter DescriptionNone N/A
Example~!I
See AlsoCOUNTRY, CODEPAGE
8/3/2019 TSPL TSPL2 Programming 2008-4-10
75/173
TSC AUTO ID Technology Co., Ltd. 67 Copyright 2007 All Rights Reserved.
~!T
DescriptionThis command is used to inquire the model name and number of the printer. Theyare returnedwith in ASCII characters.
Printer Type Returned String
TTP-243 TTP/TDP 243
TTP-243E TTP/TDP 243E
TTP-243 Plus TTP243P
TTP-243E Plus TTP243EP
TTP-244ME TTP/TDP 244ME
TTP-244ME Plus TTP244MEP
TTP-245 TTP245TDP-245 TDP245
TTP-245G TTP245G
TDP-245G TDP245G
TTP-244 TTP244
TTP-246M TTP246M
TTP-246G TTP246G
TTP-246M Plus TTP246MP
TTP-248M TTP248M
TTP-2410M TTP2410M
TTP-342 TTP/TDP 342TTP-342 Plus TTP342MP
TTP-342M TTP/TDP 342M
TTP-342M Plus TTP342MP
TTP-344M TTP344M
TTP-344M Plus TTP344MP
TTP-346M TTP346M
TTP-346M TTP346M
TTP-343 TTP343
M23 M23
Syntax~!T
Parameter DescriptionNone N/A
Example~!T
See Also
~!I, ~!F
8/3/2019 TSPL TSPL2 Programming 2008-4-10
76/173
TSC AUTO ID Technology Co., Ltd. 68 Copyright 2007 All Rights Reserved.
Message Translation Protocols~#
DescriptionThe beginning identifier (~#) of the beginning of the prompt message is sent fromthe printer to the KP-200 portable keyboard. The ending identifier is ~&.
@0 following the ending identifier ~& is used to instruct keyboard to display theprompt in the first line of LCD display.
@1 following the ending identifier ~& is used to instruct keyboard to display theprompt in the first line of LCD display.
If @0 or @1 is ignored, prompt string will be displayed in first line of LCD andinput data will be displayed in second line of LCD.
Syntax~#Prompt~&[@0]~#Prompt~&[@1]
Parameter DescriptionNone N/A
Example
DOWNLOAD "A.BAS"OUT "~#KP-200~&@0"OUT "~#Testing~&@1"EOPA
See AlsoINPUT, OUT
8/3/2019 TSPL TSPL2 Programming 2008-4-10
77/173
TSC AUTO ID Technology Co., Ltd. 69 Copyright 2007 All Rights Reserved.
Commands for Windows Driver!B
DescriptionThis command is used toput store bitmap image data in the memory. Behind thennn is the bitmap data.
Syntax!Bnnn
Parameter Descriptionnnn The number of bytes of image data are sent from PC
to printer. The number is ,expressed in 3 decimalwith 3 digits.
Example!B100
See AlsoBITMAP
8/3/2019 TSPL TSPL2 Programming 2008-4-10
78/173
TSC AUTO ID Technology Co., Ltd. 70 Copyright 2007 All Rights Reserved.
!J
DescriptionThis command is used to print the bitmap data atin certain the specified position (iny-direction).
Syntax!Jnnnn
Parameter Descriptionnnnn Print image inat the specified position in y-direction.
The position is expressed in 4 decimal with 4 digits.
Example!J0100
See AlsoFEED
8/3/2019 TSPL TSPL2 Programming 2008-4-10
79/173
TSC AUTO ID Technology Co., Ltd. 71 Copyright 2007 All Rights Reserved.
!N
DescriptionThis command is used to print specified number of labels.
Syntax!Nnnn
Parameter Descriptionnnn Specifies the number of copies to be printed.
Example
!N001
8/3/2019 TSPL TSPL2 Programming 2008-4-10
80/173
TSC AUTO ID Technology Co., Ltd. 72 Copyright 2007 All Rights Reserved.
File Management CommandsDOWNLOAD
DescriptionDOWNLOAD is a header of the file, that which is going to be saved in theprinter's memory.The downloaded files can be divided to two categories: program file anddata file (including text data file, PCX graphic files and bitmap font file)The detailed descriptions regarding the download syntax for different filesare shown as below:
Maximum numbers of file saved in DRAM:50 files for TSPL/TSPL2 language printers.
Maximum numbers of file saved in Flash memory:50 files for TSPL language printers256 files for TSPL2 language desktop printers (TTP/TDP-245 / TTP-343 /
TTP-244)256 files for TSPL2 language industrial printers (TTP-246M/344M)
Maximum numbers of file saved inModel
DRAM FLASH Ext. FLASH
TTP-243 50 50 --TTP-243E 50 50 --
TTP-243 Plus 50 256 --TTP-243E Plus 50 256 --
TTP-244ME 50 50 --
TTP-244ME Plus 50 256 256
TTP-244 50 256 256
TTP-245 50 256 256
TDP-245 50 256 256
TTP-245G 50 256 256
TDP-245G 50 256 256
TTP-246M 50 256 256
TTP-246G 50 256 256
TTP-246M Plus 50 256 256TTP-248M 50 256 256
TTP-2410M 50 256 256
TDP-643 Plus 50 50 --TDP-643R Plus 50 256 --TTP-342 50 50 --
TTP-342 Plus 50 256 --
TTP-342M 50 50 --
TTP-342M Plus 50 256 --
TTP-343 50 256 256
TTP-344M 50 256 256TTP-344M Plus 50 256 256
8/3/2019 TSPL TSPL2 Programming 2008-4-10
81/173
TSC AUTO ID Technology Co., Ltd. 73 Copyright 2007 All Rights Reserved.
TTP-346M 50 256 256
M23 50 256 256
Printers will execute the program automatically when turning on power, if one
of the downloaded programs is named AUTO.BAS. To disable the autoexecution function, please follow the procedures below.
For TTP-245/TTP-343/TDP-245 Hold the FEED key and power on the switch. The LED color will be changed asfollowing pattern.
Orange red (5 blinks) orange (5 blinks) green (5 blinks) solid green(for firmware version before V3.37)
Orange red (5 blinks) orange (5 blinks) green (5 blinks) green andorange (5 blinks) red and orange (5 blinks) solid green (V3.37)Release the FEED key while LED becomes solid green then printer will not runAUTO.BAS.
For TTP-246M/TTP-344M seriesHold the FEED key and power on the switch. The ERROR LED will be on. Andthen, release the FEED key; AUTO.BAS will not be executed. Printer is ready touse.
For TTP-2410M/TTP-246M PLUS series
Hold the PAUSE and FEED keys and power on the switch. After initializing theprinter, the AUTO.BAS will not be executed. Printer is ready to use.Or hold the PAUSE key and power on the switch. After sensor calibrating, theAUTO.BAS will not be executed. Printer is ready to use.
Syntax
1. Download a program fileDOWNLOAD [n,]FILENAME.BAS
Parameter Description
n Specify the memory which is used to save thedownload files.
n is ignored Download files to DRAM only. If you would like tosave the files from DRAM to Flash memory beforeturning off power, you can issue MOVE command toprinter to move the files from DRAM to Flashmemory.F: Download files to main board flash memory.
E: Download files to expansion memory module.
FILENAME.BAS The filename resident in printer memory.
8/3/2019 TSPL TSPL2 Programming 2008-4-10
82/173
TSC AUTO ID Technology Co., Ltd. 74 Copyright 2007 All Rights Reserved.
Note:
(1). The filename is case sensitive.
(2). The extension of the program file must be .BAS
(3). Filename format must be in 8.3 format.(4). If memory is not specified, all files will be downloaded to DRAM.
No Battery is used to backup DRAM. The downloaded files in
DRAM will be lost in case turns off printer power.
2. Download a data fileDOWNLOAD [n,]FILENAME, DATA SIZE, DATA CONTENTwhere
Parameter Descriptionn Specify the memory location to save the download
files.
n is ignored Download files to DRAM only. If you would like tosave the files from DRAM to Flash memory beforeturning off power, you can issue MOVE command toprinter to move the files from DRAM to Flashmemory.F: Download files to main board flash memory.
E: Download files to expansion memory module.FILENAME The name of data file that will remain resident in the
printer memory. It is case sensitive.
DATA SIZE The actual size (numbers of byte) of the data filewithout header.
Note:
(1). For text data file, CR (carriage return) 0x0D and LF (Line Feed)
0x0A is the separator of data.
(2). If memory is not specified, all files will be downloaded to DRAM.
No Battery is used to backup DRAM. The downloaded files in
DRAM will be lost in case turns off printer power.
SupportModel DOWNLOAD
filenameMOVE
DOWNLOADF,filename
DOWNLOADE,filename
TTP-243 series X XTTP-243 Plus series X X X
TTP-244ME series X X
TTP-244ME Plus series X X X
TTP-244 series X X X
TTP-245 series X X X X
TDP-245 series X X X X
TTP-246M series X X X X
TTP-248M series X X XTTP-2410M series X X X X
8/3/2019 TSPL TSPL2 Programming 2008-4-10
83/173
TSC AUTO ID Technology Co., Ltd. 75 Copyright 2007 All Rights Reserved.
TDP-643 Plus series X XTDP-643R Plus series X X XTTP-342 series X X
TTP-342 Plus series X X X
TTP-342M series X XTTP-342M Plus series X X X
TTP-343 series X X X X
TTP-344M series X X X X
TTP-346M series X X X X
M23 series X X X X
Example
The program listed belowis going to will download to printer SDRAM.DOWNLOAD EXAMPLE.BASSIZE 4,4GAP 0,0DENSITY 8SPEED 6DIRECTION 0REFERENCE 0,0SET CUTTER OFFSET PEEL OFFCLSTEXT 100,100,3,0,1,1,EXAMPLE PROGRAM
PRINT 1EOP
Note: When writing a download program, DOWNLOAD header must be placed
in the beginning of file, and EOP must be placed at the end of program.
To run the program, you can call the main filename without BAS
extension or use RUN command to start the download program.
Example:
1. Call the main filenameC:\>COPY CON LPT1
EXAMPLE
C:\>
2. Use Run command to start the programC:\>COPY CON LPT1
RUN EXAMPLE.BAS
C:\>
Below is an example of downloading data file.DOWNLOAD DATA,20,COMPUTER
200121
8/3/2019 TSPL TSPL2 Programming 2008-4-10
84/173
TSC AUTO ID Technology Co., Ltd. 76 Copyright 2007 All Rights Reserved.
Note: stands for keyboard ENTER key. In the aboveexample, please press ENTER key instead of typing in the above example.
See AlsoEOP, RUN, PUTBMP, PUTPCX, INPUT
8/3/2019 TSPL TSPL2 Programming 2008-4-10
85/173
TSC AUTO ID Technology Co., Ltd. 77 Copyright 2007 All Rights Reserved.
EOP
DescriptionEnd of program. WhenTo declare the start and end of the BASIC languagecommands syntax is used in a programin the printer, Tthe DOWNLOADFILENAME.BAS must be added in the first line of the program,. and EOPstatement at the last line of program.should be placed
SyntaxEOP
ExampleDOWNLOAD DEMO.BAS
SIZE 4,4GAP 0,0DENSITY 8SPEED 6DIRECTION 0REFERENCE 0,0SET CUTTER OFFSET PEEL OFFCLSTEXT 100,100,3,0,1,1,DEMO PROGRAMPRINT 1
EOP
See AlsoDOWNLOAD, EOP, INPUT
8/3/2019 TSPL TSPL2 Programming 2008-4-10
86/173
TSC AUTO ID Technology Co., Ltd. 78 Copyright 2007 All Rights Reserved.
FILES
DescriptionThis command prints out the filenames (or lists the files through RS-232) thatremained in the printer memory (both FLASH memory and DRAM). The totalmemory size andand available memory size are printed out or lists as well also.
SyntaxFILES
ExampleFollow the steps below to print out (or lists the files through RS-232) the files thatare saved in printer memory in DOS environment through serial port or parallel port
connection.
C:\>MODE COM1 96,N,8,1C:\>COPY CON COM1
FILES
C:\>
Or
C:\>COPY CON LPT1
FILES
Note: stands for PC keyboard ENTER key. means to hold PC keyboard CTRL key then press the PC
keyboard key.
See Also~!F, KILL
8/3/2019 TSPL TSPL2 Programming 2008-4-10
87/173
TSC AUTO ID Technology Co., Ltd. 79 Copyright 2007 All Rights Reserved.
KILL
DescriptionThis command deletes a file saved in the printer memory. The wild card isavailable(*) will delete all files resident in specified DRAM or FLASH memory.
SyntaxKILL [n],FILENAME
Parameter Descriptionn 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.Note:(1). If optional parameter n is not specified, firmware will delete the file
in DRAM.
Syntax example1. KILL FILENAME2. KILL *.PCX
3. KILL *4. KILL F,FILENAME5. KILL E,*.PCX
(3). For TSPL printers, please send MOVE command to printer after sending
KILL command.
SupportModel
KILL *KILL *MOVE
KILL F,* KILL E,*
TTP-243 series X XTTP-243 Plus series X X
TTP-244ME series X X
TTP-244ME Plus series X X
TTP-244 series X X
TTP-245 series X X X
TDP-245 series X X X
TTP-246M series X X X
TTP-248M series X X X
TTP-2410M series X X X
TDP-643 Plus series X X
TDP-643R Plus series X XTTP-342 series X X
8/3/2019 TSPL TSPL2 Programming 2008-4-10
88/173
TSC AUTO ID Technology Co., Ltd. 80 Copyright 2007 All Rights Reserved.
TTP-342 Plus series X X
TTP-342M series X X
TTP-342M Plus series X X
TTP-343 series X X X
TTP-344M series X X XTTP-346M series X X X
M23 series X X X
ExampleUsers can use printer SELFTEST utility to list printer configurations and files savedin the printer memory, or use the FILES command to print the downloaded file listin printer. Follow the steps below to delete files saved in the printer memory viaparallel port connection.C:\>COPY CON LPT1
FILES
C:\>COPY CON LPT1KILL DEMO.BAS
C:\>COPY CON LPT1FILES
Note: stands for PC keyboard ENTER key. means to hold PC keyboard CTRL key then press the
PC keyboard key
See Also~!F, FILES
8/3/2019 TSPL TSPL2 Programming 2008-4-10
89/173
TSC AUTO ID Technology Co., Ltd. 81 Copyright 2007 All Rights Reserved.
MOVE
DescriptionThis command is used to move downloaded files from DRAM to the FLASHmemory.
SyntaxMOVE
Parameter DescriptionN/A N/A
See Also
DOWNLOAD, EOP
8/3/2019 TSPL TSPL2 Programming 2008-4-10
90/173
TSC AUTO ID Technology Co., Ltd. 82 Copyright 2007 All Rights Reserved.
RUN
DescriptionThis command is used to execute a program that resident in printer memoryThis command is available for TSPL2 language printers only.
Model Support
TTP-243 seriesTTP-243 Plus series X
TTP-244ME series
TTP-244ME Plus series X
TTP-244 series X
TTP-245 series X
TDP-245 series X
TTP-246M series X
TTP-248M series
TTP-2410M series X
TDP-643 Plus
TDP-643R Plus X
TTP-342 series
TTP-342 Plus series X
TTP-342M series
TTP-342M Plus series X
TTP-343 series XTTP-344M series X
TTP-346M series X
M23 series X
SyntaxRUN FILENAME.BAS
Example
C:\>COPY CON LPT1RUN DEMO.BASC:\>
Note: stands for PC keyboard ENTER key. means to hold PC keyboard CTRL key then press the
PC keyboard key
See AlsoDOWNLOAD, EOP
8/3/2019 TSPL TSPL2 Programming 2008-4-10
91/173
TSC AUTO ID Technology Co., Ltd. 83 Copyright 2007 All Rights Reserved.
BASIC Commands and FunctionsABS( )
DescriptionThis function returns the absolute value of an integer, floating point or variable.
SyntaxABS (-100)ABS (-99.99)ABS (VARIABLE)
ExampleDOWNLOAD TEST.BAS
SIZE 4,4GAP 0,0DENSITY 8SPEED 3DIRECTION 0REFERENCE 0,0SET CUTTER OFFSET PEEL OFFCLSA=ABS(-100)B=ABS(-50.98)C=-99.99TEXT 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 1EOP
See AlsoDOWNLOAD, EOP
8/3/2019 TSPL TSPL2 Programming 2008-4-10
92/173
TSC AUTO ID Technology Co., Ltd. 84 Copyright 2007 All Rights Reserved.
ASC( )
DescriptionThis function returns the ASCII code of the character.
SyntaxASC (A)
ExampleDOWNLOAD TEST.BASSIZE 4,4GAP 0,0DENSITY 8
SPEED 3DIRECTION 0REFERENCE 0,0SET CUTTER OFFSET PEEL OFFCLSCODE1=ASC(A)TEXT 100,100,3,0,1,1,STR$(CODE1)PRINT 1EOP
See AlsoDOWNLOAD, EOP, STR$()
8/3/2019 TSPL TSPL2 Programming 2008-4-10
93/173
TSC AUTO ID Technology Co., Ltd. 85 Copyright 2007 All Rights Reserved.
CHR$( )
DescriptionThis function returns the characterof that has the specified ASCII code.
SyntaxCHR$(n)
Parameter Descriptionn The ASCII code.
ExampleDOWNLOAD TEST.BAS
SIZE 4,4GAP 0,0DENSITY 8SPEED 3DIRECTION 0REFERENCE 0,0SET CUTTER OFFSET PEEL OFFCLSA=65WORD$=CHR$(A)
TEXT 100,100,3,0,1,1,WORD$PRINT 1EOP
See AlsoDOWNLOAD, EOP, STR$(), ASC$()
8/3/2019 TSPL TSPL2 Programming 2008-4-10
94/173
TSC AUTO ID Technology Co., Ltd. 86 Copyright 2007 All Rights Reserved.
END
DescriptionThis command states the ending of program.
SyntaxEND
ExampleDOWNLOAD "DEMO.BAS"SIZE 4,2GAP 0,0DENSITY 8
SPEED 6DIRECTION 0REFERENCE 0,0SET CUTTER OFFSET PEEL OFFCLSTEXT 200,60,"4",0,1,1,"END COMMAND TEST"X=300Y=200X1=500Y1=400
GOSUB DR_LINEPRINT 1END
:DR_LINEFOR I=1 TO 100 STEP 10BOX X+I,Y+I,X1-I,Y1-I,5NEXTRETURNEOPDEMO
See AlsoDOWNLOAD, EOP
8/3/2019 TSPL TSPL2 Programming 2008-4-10
95/173
TSC AUTO ID Technology Co., Ltd. 87 Copyright 2007 All Rights Reserved.
EOF( )
DescriptionThis function is used to detect an opened download file to see whether it hasreached the end of file.
SyntaxEOF (File Handle)
Parameter DescriptionFile handle Either 0 or 1.
Return value Description
None-zero End of file0 Not end of file
ExampleDOWNLOAD "DATA",16,COMPUTER2000
DOWNLOAD "DEMO.BAS"SIZE 3,3GAP 0.0,0DENSITY 8
SPEED 4DIRECTION 0REFERENCE 0,0SET CUTTER OFFSET PEEL OFFCLSOPEN "DATA",0SEEK 0,0Y=110TEXT 10,10,"3",0,1,1,"*****EOF TEST*****":A
Temp$=""READ 0,ITEM$,PTEXT 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+100IF EOF(0)=0 THEN GOTO APRINT 1EOPDEMO
See AlsoDOWNLOAD, EOP, OPEN, READ, SEEK
8/3/2019 TSPL TSPL2 Programming 2008-4-10
96/173
TSC AUTO ID Technology Co., Ltd. 88 Copyright 2007 All Rights Reserved.
OPEN
DescriptionThis command is used to open a downloaded file and establish the file handle. Up to2 files can be opened at the same time. The file to be opened should be downloadedprior to using this command.
SyntaxOPEN Filename, File handle
Parameter DescriptionFilename The file downloaded in the printer memoryFile handle Either 0 or 1.
ExampleIf there is a file withby the name of DATA is to be downloaded,The file format contains:
DOWNLOAD "DATA1",56,COMPUTER200012MOUSE50013
KEYBOARD300100
DOWNLOAD "DATA2",56,Computer300032Mouse90093Keyboard
700700
Saving the above contents of data under athe file name of DATA. UseFollow thesteps below to download data to the printer
C:\>COPY DATA/B LPT1
If there is a file withby name of DEMO.BAS is to be downloaded, Tthe file formatcontains:
8/3/2019 TSPL TSPL2 Programming 2008-4-10
97/173
TSC AUTO ID Technology Co., Ltd. 89 Copyright 2007 All Rights Reserved.
DOWNLOAD "DEMO.BAS"SIZE 3,1GAP 0,0DENSITY 8
SPEED 4DIRECTION 0REFERENCE 0,0SET CUTTER OFFSET PEEL OFFI=1Y=100GOSUB OpenData:StartCLSTEXT 10,10,"3",0,1,1,"*****OPEN COMMAND TEST*****"
ITEM$=""READ 0,ITEM$,P,QTEXT 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$(Q)+"="+STR$(P*Q)Y=Y+100PRINT 1Y=100IF EOF(0)=1 THEN GOSUB OpenDataIF EOF(0)=0 THEN GOTO StartEND:OpenData
IF I=1 THEN OPEN "DATA1",0IF I=2 THEN OPEN "DATA2",0SEEK 0,0IF I>2 THEN ENDI=I+1RETURNEOPDEMOSaving the above contents of data under athe file name ofDEMO.Follow the steps below to download data to the printer:C:\>COPY DEMO/B LPT1Execute DEMO.BAS in printer:C:\>COPY CON LPT1DEMOThe above example instructs the printer to open the file DATA1 and DATA2with same file handle of 0, and read items from the file.
See AlsoDOWNLOAD, EOP, READ, EOF, LOF, SEEK, FREAD$()
8/3/2019 TSPL TSPL2 Programming 2008-4-10
98/173
TSC AUTO ID Technology Co., Ltd. 90 Copyright 2007 All Rights Reserved.
READ
DescriptionThis command is used to read data from downloaded data file
SyntaxREAD file handle, variables
Parameter Descriptionfile handle 0 or 1variables string, integer or float point variable
Example
DOWNLOAD "DATA1",20,COMPUTER200012
DOWNLOAD "DATA2",16,Mouse90093
DOWNLOAD "DEMO.BAS"SIZE 3,1GAP 0,0
DENSITY 8SPEED 4DIRECTION 0REFERENCE 0,0SET CUTTER OFFSET PEEL OFFI=0Y=100OPEN "DATA1",0OPEN "DATA2",1SEEK 0,0
SEEK 1,0:StartCLSTEXT 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,QTEXT 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+100PRINT 1Y=100
8/3/2019 TSPL TSPL2 Programming 2008-4-10
99/173
TSC AUTO ID Technology Co., Ltd. 91 Copyright 2007 All Rights Reserved.
IF I
8/3/2019 TSPL TSPL2 Programming 2008-4-10
100/173
TSC AUTO ID Technology Co., Ltd. 92 Copyright 2007 All Rights Reserved.
SEEK
DescriptionThis command is used to shift the specified file pointer to a certain position.
SyntaxSEEK file handle, offset
Parameter Descriptionfile handle 0 or 1offset is the offset characters which isare shifted from to the
beginning of a new position
ExampleDOWNLOAD "DATA",12,1234567890
DOWNLOAD "TEST.BAS"SIZE 3,1GAP 0,0DENSITY 8SPEED 3DIRECTION 1REFERENCE 0,0CLS
OPEN "DATA",0SEEK 0,4READ 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,4SEEK 0,0READ 0,Num$
TEXT 100,160,"3",0,1,1,"SHIFT 0 CHARACTERS"
TEXT 100,210,"3",0,1,1,Num$PRINT 1EOPTEST
See AlsoDOWNLOAD, EOP, OPEN, READ, EOF, LOF, FREAD$()
8/3/2019 TSPL TSPL2 Programming 2008-4-10
101/173
TSC AUTO ID Technology Co., Ltd. 93 Copyright 2007 All Rights Reserved.
LOF( )
DescriptionThis function returns th