CAB A+ Series, Mach 4, PX, XD4 Programming Manual

Product Marking
1
A+ series
Mach 4
1
Programming Manual
XD4
J-Script and abc for cab printers
Edition 7.0
1cab Produkttechnik GmbH & Co KG
2
JScript - the programming language for cab printers.
The usage of all described functions in this manual requires firmware version 3.17 or higher. This is a generic manual which describes the commands for different printer models,which means that it may contain descriptions or explanations of features which are not available on every printer model.
2
2cab Produkttechnik GmbH & Co KG
3
3
cab Programming Manual
valid for following printer types:
A+ -Series
XD4 -Series
Mach 4
PX -Print Module
TM
TM
TM
TM
and all printing systems based on the cab „X2“ board
copyright © cab Produkttechnik GmbH & Co KG
all rights reserved
No parts of this manual may be copied, rewritten or used for anything else
than for original cab printers.
This interdicts the usage of the manual for OEM products
unless you have a written permission.
The cab printers command language is owned and copyrighted by
cab Produkttechnik GmbH & Co KG
cab Produkttechnik GmbH & Co KG
Wilhelm Schickard Str. 14
76131 Karlsruhe / Germany
Tel: +49 - 721-6626-0
Fax:+49 - 721-6626-239
Email: support@cabgmbh.com
http://www.cabgmbh.com
All registered trademarks or product names are trademarks of their respectives companies
TM
Swiss
is registered Trademark of Bitstream Inc.
3cab Produkttechnik GmbH & Co KG
4
4
Table of contents
copyright © cab Produkttechnik GmbH & Co KG................................................................................... 3
Chapter 1: Introduction............................................................................... 11
Introduction...........................................................................................................................................11
Nomenclature, Syntax of the commands..............................................................................................11
Usage of this manual........................................................................................................................... 12
Print Positions: .................................................................................................................................... 13
Overview ............................................................................................................................................. 14
1. ESC instructions.............................................................................................................................. 14
2. Immediate Commands .................................................................................................................... 14
3. Label Format Commands................................................................................................................ 15
4. Special Content Fields..................................................................................................................... 15
Simple programming lesson ................................................................................................................ 16
Create your first label: ......................................................................................................................... 16
Explanation of this example................................................................................................................. 16
Chapter 2: Command Overview.................................................................18
Command Overview............................................................................................................................ 18
ESC Commands ................................................................................................................................. 19
Immediate Commands ........................................................................................................................ 20
Label Format Commands.................................................................................................................... 22
Label Format Commands.................................................................................................................... 23
Special Content Fields......................................................................................................................... 24
Time Functions.................................................................................................................................... 24
Date Functions .................................................................................................................................... 24
Date Functions (continued) ................................................................................................................. 25
Jalali Date Functions ( Arab date )....................................................................................................... 26
Suriyakati Date Functions ( official date in Thailand ) ......................................................................... 26
Mathematical functions........................................................................................................................ 27
Field Calculations and Comparisons ................................................................................................... 27
Special functions (miscellaneous) ....................................................................................................... 28
RFID Functions ................................................................................................................................... 29
Database Connector commands ......................................................................................................... 30
Chapter 3: ESC Commands........................................................................33
ESCESC Replaces ESC in binary data ............................................................................................ 34
ESC!ESC! Hard Reset ..................................................................................................................... 35
ESC* Activate all RS-485 printers..................................................................................................... 36
ESC. Start and stop value for binary data ......................................................................................... 37
ESC: Start description of binary data ................................................................................................ 38
ESC< Back feed of the material behind the photocell....................................................................... 39
ESC? Request for free memory ....................................................................................................... 40
ESCa abc-status ................................................................................................................................ 41
ESCc - Cancel Printjob....................................................................................................................... 42
ESCend-of-data End description of binary data................................................................................43
ESCf formfeed.................................................................................................................................. 44
ESCg Print St art command.................................................................................................... ........... 45
ESCi Send value from the INF-memory ........................................................................................... 46
4cab Produkttechnik GmbH & Co KG
5
ESCj Request for the latest printed job............................................................................................. 47
ESCI Request of synchronisation info .............................................................................................. 48
ESCp0 End printer´s pause mode .................................................................................................... 49
ESCp1 Set printer into pause mode ................................................................................................. 50
ESCs Printer status query ................................................................................................................. 51
ESCt total cancel.............................................................................................................................. 54
ESCz Extended status request......................................................................................................... 55
5
CHAPTER 3 - Immediate commands........................................................56
Immediate commands......................................................................................................................... 56
<ABC> - Start of the abc Basic Compiler............................................................................................. 57
</ABC> - End of the abc Basic Compiler............................................................................................. 58
<ENCRYPTED LABEL...> - S tart of an ENCR YPTED label................................................................. 59
<ENCRYPTED JOB> - St art of an ENCRYPTED job .......................................................................... 60
</ENCRYPTED JOB> - End of an ENCRYPTED job .......................................................................... 61
; - Comment line .................................................................................................................................. 62
a - ASCII Dump Mode ......................................................................................................................... 63
c - Direct cut ........................................................................................................................................ 65
e - erase data ...................................................................................................................................... 72
f - formfeed.......................................................................................................................................... 73
j - job-ID............................................................................................................................................... 74
l - Change Language ( country ) .......................................................................................................... 75
m - set measuring unit......................................................................................................................... 77
p - pause Printer.................................................................................................................................. 79
q - query Printer................................................................................................................................... 80
r - reset to default values ..................................................................................................................... 82
s - set Date/Time ................................................................................................................................. 83
t - Run Printer Self-test ........................................................................................................................ 84
v - Firmware version............................................................................................................................ 89
x - Synchronous Peripheral Signal Settings......................................................................................... 90
z - print slashed / unslashed zero ........................................................................................................ 91
CHAPTER 4 - Label Format Commands..................................................92
A - Amount of Labels ........................................................................................................................... 93
B - Barcode Definition.......................................................................................................................... 95
Barcode overview list......................................................................................................................... 102
Available check digits: ....................................................................................................................... 104
Startpositions of Barcodes................................................................................................................. 105
Barcodes - printing direction .............................................................................................................. 105
B - Barcode 2 of 5 Interleaved ........................................................................................................ 106
B - Barcode 2 of 5 Interleaved ........................................................................................................ 107
B - Barcode Add-On2 ..................................................................................................................... 108
B - Barcode Add-On5 ......................................................................................................................110
B - Barcode Aztec - Code ................................................................................................................112
B - Barcode Codabar.......................................................................................................................114
B - Barcode Codablock F ................................................................................................................116
B - Barcode Code 39 .......................................................................................................................118
B - Barcode Code 39 FULL ASCII .................................................................................................. 120
B - Barcode Code 93 ...................................................................................................................... 122
B - Barcode Code 128 .................................................................................................................... 124
B - Barcode Data Matrix ................................................................................................................. 126
B - Barcode DBP - German Post Identcode ................................................................................... 128
5cab Produkttechnik GmbH & Co KG
6
B - Barcode EAN-8 / JAN-8 ............................................................................................................ 130
B - Barcode EAN-13 / JAN-13 ........................................................................................................ 132
B - Barcode EAN 128 / UCC 128 / GS1-128................................................................................... 134
B - Barcode EAN-18 / NVE / SSCC-18........................................................................................... 136
B - Barcode FIM ............................................................................................................................. 140
B - Barcode HIBC (Health Industry Barcode).................................................................................. 142
B - Barcode ITF-14 * / SCC-14 *..................................................................................................... 144
B - Barcode Maxicode .................................................................................................................... 146
B - Barcode Micro PDF 417............................................................................................................ 150
B - Barcode MSI (MSI Plessey) ...................................................................................................... 152
B - Barcode PDF 417 ..................................................................................................................... 154
B - Barcode Plessey ....................................................................................................................... 156
B - Barcode Postnet ....................................................................................................................... 158
B - Barcode PZN-Barcode * ........................................................................................................... 160
B - Barcode QR-Code .................................................................................................................... 162
B - Barcode RSS-14 ....................................................................................................................... 164
B - Barcode RSS-14 composite (CC-A).......................................................................................... 166
B - Barcode RSS-14 composite (CC-B).......................................................................................... 168
B - Barcode RSS-14 truncated ....................................................................................................... 170
B - Barcode RSS-14 truncated composite (CC-A).......................................................................... 172
B - Barcode RSS-14 truncated composite (CC-B).......................................................................... 174
B - Barcode RSS-14 stacked.......................................................................................................... 176
B - Barcode RSS-14 stacked composite (CC-A) ............................................................................ 178
B - Barcode RSS-14 stacked composite (CC-B) ............................................................................ 180
B - Barcode RSS-14 stacked omnidirectional................................................................................. 182
B - Barcode RSS-14 stacked omnidirectional composite (CC-A).................................................... 184
B - Barcode RSS-14 stacked omnidirectional composite (CC-B).................................................... 186
B - Barcode RSS limited................................................................................................................. 188
B - Barcode RSS limited composite (CC-A).................................................................................... 190
B - Barcode RSS limited composite (CC-B).................................................................................... 192
B - Barcode RSS expanded............................................................................................................ 194
B - Barcode RSS expanded composite (CC-A) .............................................................................. 196
B - Barcode RSS expanded composite CC-B................................................................................. 198
B - Barcode RSS expanded stacked .............................................................................................. 200
B - Barcode RSS expanded stacked half line ................................................................................. 202
B - Barcode RSS expanded stacked composite (CC-A) ................................................................. 204
B - Barcode RSS expanded stacked composite (CC-B) ................................................................. 206
B - Barcode UPC-A ........................................................................................................................ 208
B - Barcode UPC-E ........................................................................................................................ 210
B - Barcode UPC-E0 ...................................................................................................................... 212
C - Cutter Parameters ....................................................................................................................... 214
D - Global Object Offset .................................................................................................................... 218
E DBF ... - Define Files ( Extension DBF).......................................................................................... 219
E LOG ... - Define Files ( Extension LOG)......................................................................................... 220
E SQL - Define Files ( Extension SQL).............................................................................................. 222
E RFID - Define Files (Extension RFID) ............................................................................................ 223
F - Font Number................................................................................................................................ 224
F - Font Number................................................................................................................................ 225
G - Graphic Field Definition ............................................................................................................... 226
G - Graphic Definition - Circle............................................................................................................ 228
G - Graphic Definition - Line .............................................................................................................. 230
G - Graphic Definition - Rectangle..................................................................................................... 232
G - Graphic Definition - Option: Fill.................................................................................................... 234
G - Graphic Definition - Option Shade ............................................................................................... 235
G - Graphic Definition - Option: Outline ............................................................................................. 236
6
6cab Produkttechnik GmbH & Co KG
7
H - Heat, Speed, Method of Printing, Ribbon..................................................................................... 238
I - Image Field Definition.................................................................................................................... 239
J - Job S tart....................................................................................................................................... 242
M - Memory Card Access .................................................................................................................. 243
Memory card access with FTP connection: ....................................................................................... 245
M - Memory Card Access - load file from card................................................................................... 250
O - Set Print Options ......................................................................................................................... 255
O - Set Print Options ......................................................................................................................... 256
P - Set Peel-Off Mode ....................................................................................................................... 258
R - Replace Field Contents................................................................................................................ 259
S - Set Label Size.............................................................................................................................. 260
T - Text Field Definition ...................................................................................................................... 264
X - Synchronous Peripheral Signal Settings ...................................................................................... 274
7
Chapter 5: Special Content fields............................................................275
Time Functions ........................................................................................................... 277
[H12...] Print Hour in 12-hour form (1-12) ....................................................................................... 277
[H24...] Print Hour in 24-hour form (0-23) ....................................................................................... 278
[H012...] Print H0ur in 12-hour form (01-12) -always 2 digits .......................................................... 279
[H024...] Print H0ur in 24-hour form (01-24) -always 2 digits .......................................................... 280
[ISOTIME...] Prints the T ime in ISO st andard format..................................................................... 281
[MIN] Print MINutes (00-59)............................................................................................................ 282
[SEC...] Print SEConds (00-59) ...................................................................................................... 283
[TIME ...] Print actual TIME............................................................................................................. 284
[XM...] am/pm indicator .................................................................................................................. 285
Date Functions............................................................................................................ 286
[DA TE... ] Print actual D ATE........................................................................................................... 287
[DA Y... ] Print numeric DAY of the month (1-31)............................................................................. 289
[DA Y02... ] Print numeric 2-digit DAY of the month (01-31)............................................................ 290
[DOFY... ] Print numeric Day OF Year(001-366) ............................................................................ 291
[ISODATE:...] Prints date following the ISO specs ......................................................................... 292
[ISOORDINAL: ...] Prints date following the ISO specs ................................................................. 293
[WDAY... ] Print numeric WeekDAY(0-6) ....................................................................................... 294
[wday... ] Print complete weekday name........................................................................................ 295
[wday2... ] Print weekday name, 2 - digits shortened ..................................................................... 296
[wday3... ] Print weekday name, 3 - digits shortened ..................................................................... 297
[ISOWDA Y: ...] Print date following the ISO specs.......................................................................... 298
[WEEK... ] Print numeric WEEK (1-53).......................................................................................... 299
[WEEK02... ] Print numeric WEEK with 2 -digits (01-53) ................................................................ 300
[OWEEK... ] Print WEEK with Offset(1-53).................................................................................... 301
[mon... ] Print 3-character month name ......................................................................................... 302
[month... ] Print complete month name.......................................................................................... 303
[MONTH... ] Print 2-digit MONTH (1-12)........................................................................................ 304
[MONTH02... ] Print 02-digit MONTH (01-12)................................................................................ 305
[YY... ] Print 2-digit Year (00-99)..................................................................................................... 307
[YYYY... ] Print 4-digit Year (1970-2069) ....................................................................................... 308
Jalali Date functions .......................................................................................................................... 309
Suriyakati Date .................................................................................................................................. 309
[JYEAR... ] Print 4-digit Jalali Year ................................................................................................. 310
[JDAY...] Print Jalali-DAY ..................................................................................................................311
7cab Produkttechnik GmbH & Co KG
8
[JDAY02...] Print Jalali-DAY, 02 digits ............................................................................................. 312
[JMONTH...] Print Jalali-Month ....................................................................................................... 313
[JMONTH02...] Print Jalali-Month - 2 digits..................................................................................... 314
[JDOFY...] Print Jalali-Day OF Year ................................................................................................ 315
[jmonth... ] Print complete Jalali month name.............................................................................. 316
[JWDAY...] Print Jalali-Week-DAY .................................................................................................. 317
[SYEAR... ] Print 4-digit Suriyakati Year ......................................................................................... 318
8
Mathematical Functions............................................................................................. 319
[+:op1,op2, . . .] Addition................................................................................................................. 320
[-:op1,op2,...] Subtraction ............................................................................................................... 321
[*:op1,op2, . .] Multiplication............................................................................................................ 322
[/ :op1,op2] Division ........................................................................................................................ 323
[%: op1,op2] Modulo....................................................................................................................... 324
[|:op1,op2] Logical Or ..................................................................................................................... 326
[|:op1,op2] Logical Or ..................................................................................................................... 327
[&:op1,op2] Logical AND................................................................................................................. 328
[<: op1,op2] Comparision < Less than ............................................................................................ 329
[=: op1,op2] Comparision = Equal .................................................................................................. 330
[==: text1,text2] String Comparision == Equal................................................................................. 331
[>: op1,op2] Comparision > Greater than ....................................................................................... 332
[MOD10:x] Calculate the Modulo 10 check digit ............................................................................. 333
[MOD36:x] Calculate the Modulo 36 check digit ............................................................................ 334
[MOD43:x] Calculates the Modulo 43 Check digit.......................................................................... 335
[P: ... ] Print result in Price format .................................................................................................. 336
[R:x] Rounding method................................................................................................................... 337
Special Functions ....................................................................................................... 338
[?: ... ] LCD prompt ....................................................................................................................... 339
[ABC:x] Insert ABC value................................................................................................................ 344
[BIN:x{,y ...} ] Insert Binary data...................................................................................................... 345
[BIN16B:x{,y ...} ] Insert Binary data, 16 bit - Big Endian................................................................. 346
[BIN16L:x{,y ...} ] Insert Binary data, 16 bit - Little Endian............................................................... 347
[BIN32B:x{,y ...} ] Insert Binary data, 32 bit - Big Endian................................................................. 348
[BIN32L:x{,y ...} ] Insert Binary data, 32 bit - Little Endian............................................................... 349
[BITFIELD:... ] Bitwise encoded data field....................................................................................... 350
[C: ... ] Leading zero replacement................................................................................................... 351
[D:... ] Set number of Digits............................................................................................................ 353
[DBF:... ] Database file access ...................................................................................................... 354
[HEX:x ...] Hexadecimal conversion ............................................................................................... 355
[I: ...] Invisible fields ........................................................................................................................ 356
[JOBID] print JOB ID ..................................................................................................................... 358
[J: ... ] Justification ......................................................................................................................... 359
[LEN:x] Text Length detection......................................................................................................... 361
[LOWER:... ] Converts to lower case characters ........................................................................... 362
[L TRIM:... ] Trim data Left.............................................................................................................. 363
[name] Access a field with a name ................................................................................................. 364
[name,m{,n}] insert substring.......................................................................................................... 365
[RTMP... ] Read value from serial (TMP) file................................................................................... 366
[RTRIM:... ] Trim dat a Right........................................................................................................... 367
[RUSER... ] Read value from (user) memory.................................................................................. 368
[S:... ] Script style for numeric values............................................................................................. 369
[SER:...] - Serial numbering............................................................................................................... 370
[SQL:xx ] SQL database access..................................................................................................... 375
8cab Produkttechnik GmbH & Co KG
9
[SQLLOG:... ] SQL logging into database ...................................................................................... 376
[TRIM:... ] Trim data....................................................................................................................... 377
[U:x] Insert Unicode characters ...................................................................................................... 378
[UPPER:... ] Convert to upper case characters.............................................................................. 380
[WINF] Mark a line for writing into the info buffer............................................................................ 381
[WLOG] Write LOG file................................................................................................................... 382
[WTMP] Write value to serial (TMP) file ......................................................................................... 383
[WUSER... ] Write value to USER memory .................................................................................... 384
9
RFID Functions ........................................................................................................... 385
[LTAG ... ] Lock RFID TAG area ..................................................................................................... 386
[RTAG ... ] Read RFID TAG............................................................................................................ 387
[RTAGBIN ... ] Read RFID T AG binary ........................................................................................... 388
[TAGID] read T AG ID...................................................................................................................... 389
[WTAG ... ] Write RFID TAG ........................................................................................................... 390
Chapter 6: cab DataBase Connector .......................................................391
How it works: ..................................................................................................................................... 392
Supported Databases:....................................................................................................................... 392
cab Database Connector and SQLClient........................................................................................... 392
Installation ......................................................................................................................................... 393
Chapter 7: abc - a-Series basic compiler..............................................398
abc - a-Series basic compiler .......................................................................................................... 398
Requirements:................................................................................................................................... 398
Restrictions: ...................................................................................................................................... 398
Import differences to Yabasic PC versions: ....................................................................................... 399
T emporary restrictions/known bugs: .................................................................................................. 399
Window-Handling: ............................................................................................................................. 399
New functions compared to Yabasic:................................................................................................. 400
Restrictions compared to Yabasic:..................................................................................................... 400
abc - PEEK Variables: ....................................................................................................................... 401
abc - POKE Variables: ....................................................................................................................... 404
abc - Streams:................................................................................................................................... 406
abc - Modes: ..................................................................................................................................... 407
Notes:................................................................................................................................................ 408
Communication with Web Browsers:................................................................................................. 408
HTML ................................................................................................................................................ 408
ASCII T able ....................................................................................................................................... 422
Appendix A ................................................................................................422
Code 39 pattern chart........................................................................................................................ 423
Code 39 Full ASCII chart................................................................................................................... 424
Tips and Tricks .................................................................................................................................. 425
Appendix B:Tips and Tricks..................................................................... 425
V ariable day offset............................................................................................................................. 426
Hexadecimal counter (Base 16, 0-F) ................................................................................................. 427
9cab Produkttechnik GmbH & Co KG
10
10
Invisible field - depending on condition .............................................................................................. 428
Memory card „reload“ ........................................................................................................................ 429
Automatic start with pause................................................................................................................. 430
Using Replace sequence and split the content .................................................................................. 431
Leading zero suppression after calculation........................................................................................ 432
Replacing graphics dynamically......................................................................................................... 433
Appendix C - Character lists ....................................................................434
Character list Swiss 721 .................................................................................................................... 435
Character list Swiss 721 bold ............................................................................................................ 448
Character list Monospace.................................................................................................................. 462
Index ................................................................................................................................................. 473
Index...........................................................................................................473
10cab Produkttechnik GmbH & Co KG
11
Chapter 1: Introduction
Introduction
IMPORTANT : We highly recommend to read the introduction first !!
• The described commands and sequences are tested and approved with original cab printers. cab Produkttechnik can not guarantee that all functions are available on OEM products.
• All sample labels are created with a 300 dpi printer,
• All measurement s are in millimeters for the usage in international markets. Label positions have to be recalculated if the printer is set to „country = USA“, if no measurement command is transmitted.
• Some described functions are only available if your printer contains the actual firmware. We recommend to download and install the actual firmware release from our website at:
http://www.cabgmbh.com
• We tried our best to write an easy understandable programmer´s manual which should contain every possible function of cab printers. Multiple different methods have been used to make sure that every shown example works properly and a few proof reads have been done to avoid any error in this manual. Nevertheless - we would appreciate your comments, where more explanation is required and where we have to do things better. Every comment is welcome and will influence our future work. And if you find any error,- then please let us know. Thank you for your help !
11
Nomenclature, Syntax of the commands
• All commands are accepted when the line end identifier is transmitted, with the exception of ESC commands, they are processed as soon as the required character is received.
• Carriage returns are not displayed in the headlines and not in the example files of this manual, to keep a better overview. Carriage Returns (ASCII 13, HEX 0D) are only shown in the synt ax description in italic letters (CR ). You may use either CR (carriage return), LF (line feed) or CR/LF (carriage return/ line feed) (See also the ASCII table in the APPENDIX of this manual)
• It is not required to use special characters to create a label format. Data can be keyed in with a simple text editor.
• For a better overview it is allowed to add spaces or tabs within a command line. Numeric parameters accept additional zeros.
• Separators for the parameters are either semicolons or commas.
11cab Produkttechnik GmbH & Co KG
12
12
Usage of this manual
The commands are sorted in different sections. In each section we further sorted the commands in alphabetical order. We used following structure:
1. ESC commands
2. Commands which start with lower case letters
3. Commands which start with uppercase letters
4. Special content fields sorted by: a: Time functions b: Date functions c: Mathematical functions d: Special Functions e:RFID Functions
5. Description of the cab DataBase connector
6. Description of the abc - Basic compiler
7. Appendix A shows a few chart s and t ables
8.Appendix B contains some tips and tricks shown on special samples
9. Last but not least we added a Unicode character list of the internal
TrueT ype font s.
Special Notes and infos are shown in it alic characters where the "finger" point s to them.
The examples are mostly reduced to the minimum requirements to print a label, to keep it as simple as possible.
Not all commands are available or all printer types. This depends on if the described function needs additional equipment such as the RFID functions which are not available in every machine. Please referto the further documentation of your printer.
In all cases when it was possible we printed an example label, which helps to explain the function of each command. You may copy or type the sample in your editor to see how it works.
All examples have been tested and the printouts have been scanned. The original files have been copied into the sample text to make sure to keep the amount of mistakes on a minimum. Nevertheless - please inform us whenever you find anything wrong. We will correct that in the next release of this manual.
12cab Produkttechnik GmbH & Co KG
13
13
Print Positions:
The Home position or „Zero point“ of a label is shown on the picture below.The „Headline“appears first, as it is usual on all laser printers etc. Most users prefer to get the printed label „foot first“ out of the printer. This can easily be done when the „O R“ command is added to the shown examples. We did not add this command in the samples to keep a better overview . You may add this whenever it is required. „O R“ rotates the orientation of the label by 180 degrees. So all shown examples which do not contain the „O R“ command have been rotated for a better view in this manual.
feed direction (paper path)
Home position when the „O R“ command had been used.
Home position when the „O R“ command had been used.
Home position when the „O R“ command had been used.
Initial Home position
Initial Home position
13cab Produkttechnik GmbH & Co KG
14
14
Overview
The programming language of the cab Printers is based almost completely on ASCII characters. Together with the selectability of different codepages it is possible to connect to nearly each computer system.
The printers accept additionally all types of line end identifiers (CR, LF, CR/LF), so that the descriptions of labels can be created with the most simple text editors, such as „Notepad“ or „Wordpad“ - saved as plain text files.
Instruction types
cab printers are using basically three types of instructions
ESC instructions,
Instructions with lowercase letters and
Instructions with uppercase letters.
1. ESC instructions
are responsible for status queries, control functions, memory management etc. and are usually executed immediately , i.e. even if a printing job runs. They are not absolutely required to print labels, but they offer additional features and possibilities
Example:
ESC ? - Request for free memory. ESC c - Cancel Job ESC p0 - Ends printer pause state ESC s - Printer status request
2. Immediate Commands
Instructions with lowercase letters are used for adjustments and settings which must not have something to do with the actual printjob.
These are for example requests of fonts or graphics which have previously downloaded to the printer .
Example:
a - Activate the ASCII dump mode c - Immediate cut f - Formfeed t - Performs a test print
14cab Produkttechnik GmbH & Co KG
15
15
3. Label Format Commands
Instructions with uppercase letters are used to describe the label itself. This has a fix structure, beginning with the start command, the description of the label size and description of each object in the label. At the end of the label the printer expects the amount of labels.
Example:
cab printers use additionally to that 3 command types following special commands for special text formatting, calculations, comparisons etc.:
4. Special Content Fields
J - Job start S - Set label size H - Heat, speed, and printing method O - Set print options T - Text field definition B - Barcode field definition G - Graphic field definition I - Image field definition A - Amount of labels
Special content fields cab database connector commands abc - a-series basic compiler commands
are used within Label Format commands. They consist of instructions in squared brackets, [ ], which offers various data insertion and data manipulation functions.
Example:
A huge amount of more complex and powerful commands are explained later in this manual in the „Special Content fields“ section.
cab database connector command and „abc“ - commands will not be explained here. Please refer to the special sections in this manual.
On the next pages you will find a short training class which shall help you to become familiar with the cab printer programming language „JSCRIPT“. We recommend that you try this course first, before you start with your own projects.
[DATE] - Print date [/ :op1,op2] - Divide [>: op1,op2] - Greater than
15cab Produkttechnik GmbH & Co KG
16
16
Simple programming lesson
Target:
Learn how easy it is to teach your printer to do what you want. Understand the language structure of JScript by testing the following sample. Get the feeling what might go wrong if the syntax is not correct. Modify this sample with other items of this manual.
Create your first label:
1. Connect your printer to the PC, select „Country United Kingdom“ on the printer´s control panel.
The handling is explained in the operator´s manual (the language changes to „English“ and the measurements to „millimeters“ - as the label is designed in millimeters)
2. Start your preferred plain texteditor (we will use Notep ad for this example)
3. Key in following data and don´t forget to press the ENTER key on your keyboard after the „A 1“ in
the last line is keyed in.
Example:
m m J H 100 S l1;0,0,68,70,100 O R T 10,10,0,5,pt20;sample B 10,20,0,EAN-13,SC2;401234512345 G 8,4,0;R:30,9,0.3,0.3 A 1
Explanation of this example
(Details are described in the respective sections of this manual)
J Job start H 100 Heat (Speed) setting (100mm/sec) S l1;0,0,68,70,100 Size of the Label (68 x100mm, gap 2mm) O R Orientation Rotated by 180° T 10,10,0,5,pt20;sample Text line- font:Swiss bold, 20 pt B 10,20,0,EAN-13,SC2;401234512345 Barcode EAN 13, size SC 2 G 8,3.5,0;R:30,9,0.3,0.3 Graphic, Rectangle 30x9mm, 0.3mm A 1 Amount of labels (in this sample 1)
4. Save that file now with the name „sample1.txt“ in your root directory of Harddrive C:
16cab Produkttechnik GmbH & Co KG
17
17
5. Switch to the DOS - mode or to the command prompt (depending on your operating system
version)
6. At the command prompt key in: C:\> copy/b sample1.txt LPT1: ( LPT1: - if the printer is connected to the parallel port of the PC.) -Requires the optional parallel adapter . The result should be that the printer prints the label which is shown below. The better possibility is to transmit data via network connection with an FTP client. We recommend to download "NOTEP AD++" which is an open source text editor with a built in FTP client. Copy the file directly from the editor to the "execute" folder which is shown by the FTP client. When setting up your FTP connection you will be asked for the server name which is the IP address of your printer. Furthermore you have to key in the Login which is always "root" and the password which is the previously set PIN of your printer´s menu.
... and if it does not work as expected ? - Then following points might be the reason:
1. The printer receives no data:
a: The wrong interface or wrong transmission speed is selected on your printer.
- Check the interface settings in the setup menu of the printer
b: Your interface is blocked by another application. c: The cable might be defect- check the connecting cable
2. Printer receives data but shows „ribbon out“
a: No ribbon in the printer b: Ribbon is not fixed on the ribbon unwinder
3. Printer receives data but shows „Protocol error“ in its display
a: Transmitted data is wrong - this might be a missing comma or a accidentially set semicolon
instead of a comma or any other wrong data. S p aces after a command may cause a protocol error, too! Check your label dat a carefully.
17cab Produkttechnik GmbH & Co KG
18
Chapter 2: Command Overview
Command Overview
The following pages are showing lists of all available JScript printer commands Details are explained later in this manual.
18
18cab Produkttechnik GmbH & Co KG
19
19
ESC Commands
ESCESC Replaces ESC in binary data ESC!ESC! Hard reset ESC* Activate all RS 485 printers ESC. St art and S top value for binary dat a ESC: Start description of binary data*
ESC< Back feed of the material behind the photocell ESC? Request for free memory. ESCa Request for abc-status ESCc cancel printjob ESCend-of-data End description of binary data
ESCf formfeed (Equal to pressing „form feed“ on the navigator pad) ESCi Send value from the INF-memory ESCj Request for the latest printed job ESCl Request of synchronisation Info ESCp0 End printer ´s pause mode
ESCp1 Set printer into pause mode ESCs Printer status query ESCt total cancel of all jobs ESCz Extended status request
*) available for Hermes A only !
19cab Produkttechnik GmbH & Co KG
20
20
Immediate Commands
All Immediate commands are processed when a line end identifier is sent (CR, LF or CR/LF)
<abc> start of „abc“ (a-Series basic compiler) </abc> end of „abc“ (a-Series basic compiler) ; comment Comment line a set printer in aSCII dump mode c Direct cut
d t;name.... download graphic or font data
e t;name.... erase data
f form feed j job-ID l name Set language (country)
m unit Set measuring unit p status pause printer q b;name query bitmap font q d;name query dBase file on memory card q e;name query format file on memory card
q f query free memory q i;name query image availability q l;name query label file on memory card q m query memory type q p query peripheral types
q r query ribbon diameter q s;name query scaleable font availability q t query time and date r reset to default values s n set date/time
20cab Produkttechnik GmbH & Co KG
21
21
Immediate Commands
All Immediate Commands are processed when a line end identifier is sent (CR, LF or CR/LF)
t[x] Run printer self-test v Request firmware version x d;uo Set peripheral (x) bits directly x e;uo Set peripheral (x) error value
21cab Produkttechnik GmbH & Co KG
22
22
Label Format Commands
Label format commands are processed when a line end identifier is sent (CR, LF or CR/LF)
A [NO] n Amount of labels (end job/print) B [:name;] x, y , r, type,size,text Barcode field definition C cnt[,disp1[,disp2]] Set Cutter parameters C e Set Cutter to end-of-job D x,y Global Object Offset (Distance to margins)
E DBF;name Defines a DBF (database) file E LOG;name Defines a LOG file E RFID;... Define Files (Extension RFID ) E TMP;name Defines TMP (temporary) serial file E SQL;[IP of cabDatabaseconnector]:portnr Sets IP adress for SQL database access
F number;name Font number G [:name;] x, y , r; type:options, . . . Graphic field definition H speed[,h][,t][,r][,b] Heat, speed, and printing method I [:name;]x,y,r[,mx,my];imgname Image field definition J [comment] Job start
M c Memory card: content request M d type;name Memory card: delete file from card M f;name Memory card: format card M l type;[path]name Memory card: load file from card M r Memory card: repeat last label
M s type;name Memory card: store data on card M u type;[path]name uploads data to the host O [M,][R,][N,][p][T ,][U,] Set print Options P [disp] Set Peel-off mode R name;value Replace field contents
S [type:]yo,xo,length,dy ,wide. . . Set label Size
22cab Produkttechnik GmbH & Co KG
23
23
Label Format Commands
Label format commands are processed when a line end identifier is sent (CR, LF or CR/LF)
T [:name;] x,y ,r, font,size . . ;data Text field definition X y[;uo] Synchronous setting of peripheral (eXternal) signal
23cab Produkttechnik GmbH & Co KG
24
24
Special Content Fields
Time Functions
[H12] Print Hour in 12-hour form (1-12) [H24] Print Hour in 24-hour form (0-23) [H012] Print H0ur in 12-hour form (01-12) - always 2 digits [H024] Print H0ur in 24-hour form (01-24) - always 2 digits [ISOTIME] Prints the Time in ISO st andard format
[MIN] Print MINutes (00-59) [SEC] Print SEConds (00-59) [TIME] Print actual TIME in the format of the preset country [XM] am / pm indicator
Date Functions
[DATE{:+DD{,+MM{,+YY}}}] Print actual DA TE in the format of the preset country [DAY{:+DD{,+MM{,+YY}}}] Print numeric DAY of the month (1-31) [DAY02{:+DD{,+MM{,+YY}}}] Print numeric 2-digit DAY of the month (01-31) [DOFY{:+DD{,+MM{,+YY}}}] Print numeric Day OF Year(1-366) [ISODATE{:+DD{,+MM{,+YY}}}] Print ISO date
[ISOORDINAL{:+DD{,+MM{,+YY}}}] Print ISO ordinal [ODATE:+DD{,+MM{,+YY}}] Print DATE with Offset * [wday{:+DD{,+MM{,+YY}}}] Print complete weekday name (0 = sunday) * [WDAY{:+DD{,+MM{,+YY}}}] Print numeric WeekDAY(0-6)* [wday2{:+DD{,+MM{,+YY}}}] Print weekday name, 2 - digits shortened *
[wday3{:+DD{,+MM{,+YY}}}] Print weekday name, 3 - digits shortened* [ISOWDAY{:+DD{,+MM{,+YY}}}] Print numeric WeekDAY (1-7) [WEEK{:+DD{,+MM{,+YY}}}] Print numeric WEEK (1-53) [WEEK02{:+DD{,+MM{,+YY}}}] Print numeric WEEK with 2 - digits (01-53) [OWEEK:+WW] Print WEEK with Offset (1-53)
* (in the format of the preset country)
24cab Produkttechnik GmbH & Co KG
25
25
Special Content Fields
Date Functions (continued)
[mon{:+DD{,+MM{,+YY}}}] Print 3-character month name (i.e. jan)* [month{:+DD{,+MM{,+YY}}}] Print complete month name (i.e. january)* [MONTH{:+DD{,+MM{,+YY}}}] Print 2-digit MONTH (1-12) [MONTH02{:+DD{,+MM{,+YY}}}] Print 02-digit MONTH (01-12) (leading zeros, always 2 digits)
[YY{:+DD{,+MM{,+YY}}}] Print 2-digit Year (00-99) [YYYY{:+DD{,+MM{,+YY}}}] Print 4-digit Year (1970-2069)
* (in the format of the preset country)
25cab Produkttechnik GmbH & Co KG
26
26
Special Content Fields
Jalali Date Functions ( Arab date )
[JYEAR{:+DD{,+MM{,+YY}}}] Print Jalali-YEAR, 4 digits [JDAY{:+DD{,+MM{,+YY}}}] Print Jalali-DAY
[JDAY02{:+DD{,+MM{,+YY}}}] Print Jalali-DA Y, 02 digits [JMONTH{:+DD{,+MM{,+YY}}}] Print Jalali-MONTH [JMONTH02{:+DD{,+MM{,+YY}}}] Print Jalali-MONTH, 02 digits
[jmonth{:+DD{,+MM{,+YY}}}] Print Jalali-month, complete name [JDOFY{:+DD{,+MM{,+YY}}}] Print Jalali-Day OF Year [JWDAY{:+DD{,+MM{,+YY}}}] Print Jalali-Week DAY (1=saturday)
Suriyakati Date Functions ( official date in Thailand )
[SYEAR{:+DD{,+MM{,+YY}}}] Print Suriyakati-YEAR, 4 digits
26cab Produkttechnik GmbH & Co KG
27
27
Special Content Fields
Mathematical functions Field Calculations and Comparisons
[+:op1,op2. . ,] Addition [-:op1,op2] Subtraction [*:op1,op2. . ,] Multiplication [/:op1,op2] Division [%: op1,op2] Modulo
[|:op1,op2] Logical Or (Result 1, if minimum one operator is not equal to 0) [&:op1,op2] Logical And (Result 0, if min. one operator is 0)
[<: op1,op2] Comparison - Less than (1=TRUE, 0=FALSE) [=: op1,op2] Comparison - Equal (1=TRUE, 0=FALSE) [>: op1,op2] Comparison - Greater than (1=TRUE, 0=F ALSE)
[MOD10:x] Calculates and prints the Modulo 10 Check digit [MOD36:x] Calculates and prints the Modulo 36 Check digit [MOD43:x] Calculates and prints the Modulo 43 Check digit
[P:name,mn{o}] Print result in Price format [R:x] Rounding method [==:text1,text2] String comparision (1=TRUE, 0=FALSE)
27cab Produkttechnik GmbH & Co KG
28
28
Special Content Fields
Special functions (miscellaneous)
[?:x,y ,z,{D},{Lx},{Mx},{R},{J}] Prompt line on the printer´s display [ABC:x] Insert ABC value [BIN:x{,y ...}] Insert Binary data [C:fill{,base}] Leading zero replacement [D:m,n] Set number of Digits to print
[DBF:keyfield,keyvalue,entryfield] DataBase Field [HEX:x] Hexadecimal conversion [I{!}{:cond}] Invisible fields [JOBID] print JOB ID [J:ml] Justification
[LEN:x] Returns the Length of a variable [LOWER:x] Converts the input data in lower case characters [LTRIM:x] Trim data Left [name] Access a field with a name [name,m{,n}] Insert substring from another field
[RTMP{:x}] Read from a TMP (serial) file [RTRIM:x] Trim data Right [S:name] Numeric Script style [SER:start{incr,{freq}}] Insert SERial numbering [SPLIT:field,index] Splits t able values
[U:x] Insert Unicode character [UPPER:x] Converts the input data in upper case characters [WINF] Writes value into the „INF“ buffer [WLOG] Write to LOG file [WTMP] Write to TMP (temporary) serial file
28cab Produkttechnik GmbH & Co KG
29
29
Special Content Fields
RFID Functions
[LTAG...] Lock RFID TAG area [RTAG...] Read RFID TAG [RT AGBIN...] Read RFID T AG binary [T AGID] Read TAG ID [WTAG...] Write RFID TAG
29cab Produkttechnik GmbH & Co KG
30
30
Special Content Fields
Database Connector commands
[SQL:Select field from table where Searchvalue] SQL - Query function [SQLLOG:xx] SQL - Logging function
30cab Produkttechnik GmbH & Co KG
Loading...
+ 454 hidden pages