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
<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
How it works: ..................................................................................................................................... 392
Communication with Web Browsers:................................................................................................. 408
HTML ................................................................................................................................................ 408
ASCII T able ....................................................................................................................................... 422
Appendix A ................................................................................................422
Appendix C - Character lists ....................................................................434
Character list Swiss 721 .................................................................................................................... 435
Character list Swiss 721 bold ............................................................................................................ 448
Character list Monospace.................................................................................................................. 462
Index ................................................................................................................................................. 473
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
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)
JJob start
H 100Heat (Speed) setting (100mm/sec)
S l1;0,0,68,70,100Size of the Label (68 x100mm, gap 2mm)
O ROrientation Rotated by 180°
T 10,10,0,5,pt20;sampleText line- font:Swiss bold, 20 pt
B 10,20,0,EAN-13,SC2;401234512345Barcode EAN 13, size SC 2
G 8,3.5,0;R:30,9,0.3,0.3Graphic, Rectangle 30x9mm, 0.3mm
A 1Amount 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
ESCESCReplaces 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.
ESCaRequest for abc-status
ESCccancel printjob
ESCend-of-dataEnd description of binary data
ESCfformfeed (Equal to pressing „form feed“ on the navigator pad)
ESCiSend value from the INF-memory
ESCjRequest for the latest printed job
ESClRequest of synchronisation Info
ESCp0End printer ´s pause mode
ESCp1Set printer into pause mode
ESCsPrinter status query
ESCttotal cancel of all jobs
ESCzExtended 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)
; commentComment line
aset printer in aSCII dump mode
cDirect cut
d t;name....download graphic or font data
e t;name....erase data
fform feed
jjob-ID
l nameSet language (country)
m unitSet measuring unit
p statuspause printer
q b;namequery bitmap font
q d;namequery dBase file on memory card
q e;namequery format file on memory card
q rquery ribbon diameter
q s;namequery scaleable font availability
q tquery time and date
rreset to default values
s nset 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
vRequest firmware version
x d;uoSet peripheral (x) bits directly
x e;uoSet 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] nAmount of labels (end job/print)
B [:name;] x, y , r, type,size,textBarcode field definition
C cnt[,disp1[,disp2]]Set Cutter parameters
C eSet Cutter to end-of-job
D x,yGlobal Object Offset (Distance to margins)
E DBF;nameDefines a DBF (database) file
E LOG;nameDefines a LOG file
E RFID;...Define Files (Extension RFID )
E TMP;nameDefines TMP (temporary) serial file
E SQL;[IP of cabDatabaseconnector]:portnrSets IP adress for SQL database access
F number;nameFont 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];imgnameImage field definition
J [comment]Job start
M cMemory card: content request
M d type;nameMemory card: delete file from card
M f;nameMemory card: format card
M l type;[path]nameMemory card: load file from card
M rMemory card: repeat last label
M s type;nameMemory card: store data on card
M u type;[path]nameuploads data to the host
O [M,][R,][N,][p][T ,][U,]Set print Options
P [disp]Set Peel-off mode
R name;valueReplace 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 . . ;dataText 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 *
[|: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...]ReadRFID 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
You need points to download manuals.
1 point = 1 manual.
You can buy points or you can get point for every manual you upload.