4. Index of figures____________________________________________________________ 52
5. Index of tables_____________________________________________________________ 53
CDL – Programmer Manual
2. T
In order to work, thermal printers require some commands that use a specific syntax.
The CDL language comprises a series of commands formed by printable characters (with the
exception of SOH and STX): this means that they can be used with any kind of computer.
The print file to be sent to the printer may be a text file (written using any editor); alternatively the
instructions may be sent by programming language (e.g. Basic) or the label may be prepared on
screen using WYSIWIG1 software or a word processor that, using a driver, converts the label into
instructions that can be understood by the printer. In the latter case, the user does not need to know
the programming language and can ignore sections 2.1 (page 4) and 2.3 (page 36) which serve only
to fully explain the functions and potentials of the machine.
This kind of software2 is very powerful and permits even users who are not very expert to create
labels using only a mouse and a keyboard. On the other hand, if you wish to optimise machine
performance, it may be more efficient to program the printer using the CDL language described
below.
HE PROGRAMMING LANGUAGE
2.1 The commands
In particular, the software commands can be classed as follows (see fig. 1).
1
What You See Is What You Get.
2
See the respective installation and operating manuals.
4
5
CDL commands
CDL – Programmer Manual
Immediate commands (SOH)
These commands, preceded by the ASCII characters SOH (0110, 01H), are immediate that is
they are executed as soon as they are received, and take priority over other commands.
They act “at high level” e.g. to reset the printer, to request its status or to disable the
interpreter.
Imm ediate comm an ds
System com m and s
SOH
STX
Label definition comm ands
STX L
Local setting com m and s
S p e c ia l c o m m a nd s
O b jec t d e finition co m m ands
Geometric figures
Alphanumeric fields
Barcod es
Graph ic im ag es
fig. 1 – Command hierarchy
System Commands (STX)
These commands are preceded by the ASCII characters STX (0210, 02H) and are executed in
the order in which they are received: only immediate commands (SOH) can “queue jump”.
Label definition commands (STX L)
STX L is an “opening” command (you close with E, X or s(A/B/C/D/E)nn...n) for the
label “building” operations. That is the instructions that permit you to creat e the label
are enclosed within STX L and E (X or s(A/B/C/D/E)nn...n).
In particular, the commands defining the label parameters can be classified as
follows:
CDL – Programmer Manual
Local setting commands
Special commands
For each label it is possible to set local parameters such as the temperature of
the head, the print speed or the number of labels to be printed. These
parameters are, precisely,
local
that is valid only for the current label or job.
These commands, despite the
STX
prefix, are not system commands.
Object definition commands
The actual label is made up of a group of objects, the nature of which may
differ:
Geometric figures (lines and boxes)
Alphanumeric fields (characters or numbers)
Bar codes
Graphic images
The object definition commands must respect a well defined syntax (see sect.
2.1.2.1.3 on page 19) with which the desired characteristics are defined (e.g.
orientation, position, size etc.).
2.1.1 Immediate (SOH) commands
SOH # - Reset
Resets the printer just as if it had been turned off and on again: it empties the buffers and initialises
the memory. The effect is that all the variables are reset to their default values and any data stored in
the registers are cancelled. Obviously, the images and labels stored in the flash memory remain,
since it is not volatile.
After the command it is advisable to wait for the response3 (
in series, or 3-4 sec, before entering other commands.
CR T
) from the printer if it is connected
SOH A – Printer status (alphanumeric string)
The printer sends the computer4 a sequence of 8 characters indicating its status. Each position has
an exact meaning as shown in the table below:
3
Only the RS 232 serial interface is two-way, therefore this command is effective only when the printer is connected to
the computer by means of a serial interface.
4
Only the RS 232 serial interface is two-way, therefore this command is effective only when the printer is connected to
the computer by means of a serial interface.
6
CDL – Programmer Manual
7
Position Query
1 Is the command interpreter busy?
2 Is the paper feed empty?
3 Is the ribbon out (if thermal transfer printing is enabled)?
4 Is a job being printed?
5 Is it busy?
6 Is it off-line?
7 Is the label present?
8 Always N
The reply character is Y if the result of the query is positive, N if it is negative.
SOH B - On-line
Switches the printer status from on-line to off-line and back. It behaves exactly like the ON-LINE
button on the control panel.
SOH C - Cancel
This has the same effect as the CANCEL button on the front panel: the machine finishes printing
the current label and cancels the remaining labels (in the current job).
SOH D – Disabling the immediate command interpreter
After this command the printer will ignore all immediate commands.
Logos and graphic images are likely to contain SOH characters that could be erroneously interpreted
by the printer. Before loading logos, you therefore need to enter this command to inhibit the
immediate command interpreter; when loading ends it will be automatically enabled again.
SOH E – Number of labels still to be printed
The four digits that the printer transmits5 to the computer indicate the number of labels that still
have to be printed.
SOH F – Printer status (1 hexadecimal byte)
The printer sends the computer6 a byte, giving the status, in which each bit has the following
meaning:
5
Only the RS 232 serial interface is two-way, therefore this command is effective only when the printer is connected to
the computer by means of a serial interface.
6
Only the RS 232 serial interface is two-way, therefore this command is effective only when the printer is connected to
the computer by means of a serial interface.
CDL – Programmer Manual
Position Query
1 Is the command interpreter busy?
2 Is the paper feed empty?
3 Is the ribbon out (if thermal transfer printing is enabled)?
4 Is a job being printed?
5 Is it busy?
6 Is it
7 Is the label present?
8 Always 0
off-line
?
Bit 1 is a positive answer, bit 0 is a negative answer.
2.1.2 System (STX) commands
Some of these commands set parameters that can also be changed from the configuration menu: in
any case the software commands overwrite the configuration parameters and are valid until the next
reset or until the machine is switched off.
STX a – Enabling of reply characters
This command enables the printer to send the computer
RS (30
characters.
The RS character is sent7 in reply after each label is printed, the US character is sent in reply after
each batch of labels has been printed.
10
1E
,
H
) and
US (31
10
,
1F
) reply
H
STX cnnnn – Form length
When labels without references are used (without gaps, black tick marks or holes) the printer has to
be told how long the label to be printed is. Before starting to print the labels, you need to enter this
command, where
each feed, the paper will advance by
nnnn
is the form length expressed in hundredths of an inch. From that moment, at
nnnn
hundredths of an inch8.
When the form length differs from 0, it is implicitly assumed that labels without references are
being used and therefore the paper sensor is enabled only to signal whether or not there is paper (it
does not detect any gaps or black tick marks).
STX c0250
e.g.
sets the form length at 2.5 inches.
STX Ennnn – Number of labels still to be printed
After saving the label to be printed, use the
labels indicated by the current
STX Ennnn
desired quantity.
e.g. with
STX E0020,
20 labels are printed.
STX G
command that follows to stamp the number of
command where
nnnn
is the number indicating the
7
Only the RS 232 serial interface is two-way, therefore this command is effective only when the printer is connected to
the computer by means of a serial interface.
8
After an
8
STX m
(see releva nt paragraph),
nnnn
is read as tenths of a millimetre.
CDL – Programmer Manual
9
STX e – Paper sensor in transmission mode
After receiving this command, the sensor works in transmission mode (for paper sensor use and
operating modes see the user’s manual for the printer).
STX F - Form feed
It advances the paper of a label just as the FEED button on the control panel does: if a job is being
printed, the form feed is queued and executed at the end of it.
STX fnnn - Back feed
To tear the label off at the gap or cut it with the automatic cutter, once printing is completed, the
paper must advance just enough to reach the right position, and must then return before the next
label is printed.
With this command, the last label printed is made to advance beyond the print head by
hundredths of an inch9, then before the next one is printed the paper returns the same distance to
keep the printing aligned with the label itself.
The amount by which the paper advances depends on the kind of emulation used (for this, see the
user’s manual for the printer used): that is the actual back feed is the difference between
REFERENCE OFFSET
of the emulation that is being used.
nnn
nnn
and the
STX G – Print label
The label “closed” by the X command (see sect. 2.1.2.1.1 on page 13) is not printed immediately
but is held in the memory until the
STX G
command arrives.
STX Ennnn
indicates the number of
labels remaining to be printed (if it is missing, only one label is printed).
STX Isfnn...n – Load graphic images
Graphic images must be loaded into the RAM (volatile) or flash (non-volatile) memory before they
can be printed. To do this, use the
s
is the drive where the image is to be loaded. It may be
A: RAM10 (volatile) drive
B: Flash (non-volatile) drive of the base machine
C: Current11 drive
D: Flash drive of expander card n° 1 (see the user’s manual for the printer used)
E: Flash drive of expander card n° 2
f
is the image format. It may be
P: PCX format
p: “flipped” PCX format (mirror image)
B: BMP format
9
After a
10
Drive A of volatile memory (RAM) is available o nly when it is present (in an expander card) (for this, see the user’s
manual for the printer that is used).
11
The current default drive is B (flash) and A (RAM) when it is present (in an expander card). It is possible to change
the current drive using the
STX m
command (see relevent paragraph),
STX Xa
STX Isfnn...n
command, see relevant paragraph.
command where
nnn
is read as tenths of a millimetre.
CDL – Programmer Manual
b: “flipped” BMP format
I: IMG format
i: “flipped” IMG format
F: FRG format
nn...n is the name you want to give to the image and by which it can be recalled in the label
definition (it can be different from the original name of the graphic file). It is an
alphanumeric string of no more than 8 capital characters ending with the character CR.
Immediately after entering this command, you must send the graphic file to be loaded to the printer.
This file may contain characters that could be misinterpreted by the immediate command interpreter
and for this reason the command must be preceded by SOH D (see sect. 2.1.1 on page 6) to
temporarily disable the interpreter.
e.g.
SOH D disables the immediate command interpreter
STX IAPxxx1 the graphic file that follows is in PCX (P) format and is loaded in RAM (A)
with the name xxx1.
STX J - Off-line after a label
After this command, the printer goes off-line after printing each label.
STX L – Label definition mode
This command “opens” the label definition mode (see sect. 2.1.2.1 on page 13). That is, all the
instructions included within the commands STX L and E (X or s(A/B/C/D/E)nn...n) are used to
“build” the label, or define which fields must be included, their size and where they must be placed.
STX Mnnnn – Maximum label length
If, after the paper has advanced by nnnn hundredths of an inch12, the machine does not find gap (a
black tick mark or a hole), it will signal an error. The default value for this advance is 10 inches but
it can be changed so that the printer will signal an error earlier.
e.g. with STX M0255 and a label height of 2.5 inches, an error will be signalled if there is no gap
within 2.55 inches (that is there is no label).
STX m – Metric system
After this command, all numerical parameters are read as tenths of a millimetre and no longer in
hundredths of an inch. To return to hundredths of an inch you must enter STX n.
STX n – Imperial system
After a STX m command, you can return to the default system in which all numerical parameters are
read as hundredths of an inch by entering STX n.
12
After an STX m command (see relevant paragraph), nnnn is read as tenths of a millimetre.
10
CDL – Programmer Manual
11
STX Onnnn – Vertical offset
To move the whole label lengthwise with respect to the direction of the printing, you can enter a
vertical offset. The four digit number
nnnn
gives the offset in hundredths of an inch13 “according” to
the emulation used (for this, see the user’s manual for the printer used).
STX O0225
e.g.
(if you use the
REFERENCE
OFFSET
210
) gives an offset of 15 hundredths of an
inch, that is the printer, before starting to print, will advance the paper by 15 hundredths of an inch
and the printing will appear 15 hundredths of an inch “higher up” than “normal”.
If the offset is positive, it will take effect from the first label, if it is negative, from the second
onwards.
STX o – Immediate cut
When the automatic cutter is fitted and enabled, this command activates an immediate cut.
STX P – Dump mode
After this command, the printer goes into
dump
mode. This means that the command interpreter is
disabled and all characters received by the printer are printer as hex adecimals: t o exit th is mode the
printer must be switched off and on again. The command is equivalent to pressing both the ONLINE and FEED buttons when it is switched on (for further information, see the user’s manual for
the printer used) except that it does not print a test label.
STX p - Off-line after a batch of labels
This command causes the printer to go
off-line
paragraph, after each batch of labels it prints.
, unlike with the
STX J
command, see relevant
STX Q – Cancel all
This is equivalent to the commands
including RAM and flash memories.
STX qA
STX qB
+
STX qD
+
STX qE
+
: it cancels all the drives
STX q(A/B/C/D/E) - Cancel drive
This command “cleans” drives A, B, C, D, E14 respectively. The result is that all the images or
labels previously saved are cancelled. Cancelling the non-volatile flash memory may take several
seconds.
STX qB
e.g.
cancels the non-volatile flash memory of the base machine.
STX r – Paper sensor in reflection mode
After receiving this command, the sensor will operate in reflection mode (for the use of sensor
operating modes, see the user’s manual for the printer used).
13
After an
14
Volatile memory drive A (RAM), and flash memory drives D and E (non-volatile) are only available when present (in
an expander card) (for further information, see the user’s manual for the printer used).
STX m
command (see relevant paragraph),
nnnn
is read as tenths of a millimetre.
CDL – Programmer Manual
STX Sn – Feed speed
The paper advance speed can be selected by pressing the FEED button. The n (from A to O)
corresponds to the following table:
n Speed (ips15)
A 2
B 2
C 2
D 2,5
E 3
F 3,5
G16 4
H 4,5
I 5
J 5,5
K17 6
L 6,5
M 7
N 7,5
O18 8
e.g. After entering
STX SG
, the feed speed is 4 inches per second.
STX T – Print test
It prints a test label like the one printed by pressing the ON-LINE and FEED buttons when the
printer is switched on (for further information, see the user’s manual for the printer used) without
going into dump mode and without printing the configuration.
STX Unnss...s – Fill register
It fills register nn (two-digit number) with the alphanumerical string
CR
). The string
ss...s
may differ in length from the one previously saved in register nn.
ss...s
(which must end with
STX Vn – Enable cutter and present sensor
According to the number given at n the cutter or the present sensor are enabled/disabled as in the
following table:
e.g. STX V4 enables the present sensor and disables the cutter.
STX v - RS 232 port configuration
It prints the configuration of the RS 232 port as it appears on the test label.
STX Xa – Current drive
With this command you can select the current drive C (see i commands STX Iafnn...n and
s(A/B/C/D/E)nn...n) as the volatile RAM memory (a=A) or as the non-volatile flash memory (a=B, D o E)19.
e.g. STX XA selects drive C as the volatile RAM memory.
STX Z – Print test and configuration
It prints the configuration and the test label in the same way as when you press the ON-LINE and
FEED buttons when the printer is switched on (for further information, see the user’s manual for the
printer used) without, however, going into dump mode..
2.1.2.1 Label definition commands (STX L)
They are included between the STX L and the E (or X or s(A/B/C/D/E)nn...n) commands. They are
not generally preceded by any particular character (neit her STX or SOH) and “end” with the CR20
character.
2.1.2.1.1 Local setting commands
These commands permit you to set a number of local label parameters like temperature, print speed
and label quantity.
:nnnn – Cut command
Like the cnn command below (see), nnnn is the number of labels printed before the cutter operates
(if it is fitted and enabled). Unlike the cnn command which can contain only two digits, this
command accepts up to four digits.
19
The default current drive is B. The A when the RAM is installed (in an expander card). Drives A, D and E are
available only on expander cards.
20
The line terminator can be replaced, in label definition mode, by another character with the command T (see sect.
2.1.2.1.1 on page 13) which is a local command and therefore is valid only for the current label.
CDL – Programmer Manual
An - XOR mode/transparent mode
.
XOR mode
the superimposed
21
n=1
the printer is
When two objects are superimposed on the label, if the printer is in
part appears white, while if it is in
set in
XOR mode
, if
n=2
transparent mode
in
When you want to obtain “reverse” text, you must use
transparent mode
.
this part appears black. If
XOR mode
Cnnnn – Horizontal offset (of columns)
When you want to move the whole label to the right (positive offset) without having to recalculate
all the column co-ordinates you can use the
Cnnnn
command in which
nnnn
are the four digits
indicating the column from which printing must begin.
e.g.
C0015
adds
15
to all the column co-ordinates and the labels appears transversally offset by 15
hundredths of an inch22 to the right.
cnn – Cut command
Like the command
:nnnn
, here too
automatically cuts the paper with the optional cutter (which must be enabled). Unlike
command accepts only two digits.
e.g. with
c02
the cutter operates every two labels that are printed.
nn
indicates the number of labels to be printed before the printer
:nnnn,
this
Dhv – Dot size
The dots (the smallest points that the printer can print) can be “grouped” in couples to form a larger
dot. That is, you can enlarge each dot horizontally (h) and/or vertically (v) as in fig. 2.
21
Default setting.
22
After an m (see relevant paragraph), 15 tenths of a millimetre.
14
CDL – Programmer Manual
15
D11
D12
D21
D2223
D31
D32
fig. 2 – Dot sizes
The effect is that all the objects on the label can be expanded horizontally and/or vertically using
only one command.
D11 gives the highest resolution (on this subject, see the user’s manual for the printer used).
E – Label definition mode terminator
On receiving this command, the printer prints the current label and exits the label definition mode.
G – Register memory
The field preceded by this command is saved in the first free register. The registers are filled in
succession from A to Z and their value is retrieved with the command STX Sn, see relevant
paragraph.
In practice each field is saved in registers A-Z even without using the command G: the registers are
filled in succession starting from the first alphanumerical field of the label definition commands.
The current G command only makes the memorisation explicit, highlighting it.
Hnn – Head temperature
To achieve optimum print quality, it may be necessary to modify the default temperature set with
the HEAD TEMPER. SELECTION parameter (on this subject, see the user manual for the printer
used) using this command Hnn. For this purpose, nn may vary from 00 to 20. The optimum
temperature depends on the type of ribbon and on the type of surface: as an indication, you should
start with a temperature of 10 increasing it until you find the one that gives the best results.
23
Default setting.
CDL – Programmer Manual
This command, since it is a label definition command, is a local command that is effective only on
the current label: the default value is the one set by the HEAD TEMPER. SELECTION parameter
mentioned above.
m – Metric system
After this command, the co-ordinates are read as tenths of a millimetre instead of hundredths of an
inch. To return to hundredths of an inch, you need to enter a subsequent command n.
n – Imperial system
After an m command, with a current n command the printer returns to the imperial system in which
all numerical parameters are read in hundredths of an inch (this is the default setting).
Pa – Printing speed
You can select the label printing speed with this command.
Since it is a label definition command, it is local.
a may be set at the following speeds:
a Speed (ips24)
A 2
B 2
C 2
D 2,5
E 3
F 3,5
G25 4
H 4,5
I 5
J 5,5
K26 6
L 6,5
M 7
N 7,5
O27 8
e.g. with command PG the printer prints the current label at a speed of 4 ips.
pa – Backfeed speed
With this command you can select the label backfeed speed (see command STX fnnn).
Since it is a label definition command, it is local.
a may be set at the following speeds:
24
Inches per second.
25
Default and max. speed.
26
Default speed for models with expander card.
27
Max. speed for models with expander card.
16
Loading...
+ 37 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.