ProgrammingOverview
PRINT #1, “HELLO WORLD”
In a nutshell, that’s all there is to controlling t he LabelWriter printer. Any formatting or
special effect that y ou may need for yo ur output can be specified simply and easily by
sending the appropriat e command characters and the data to be print ed.
The next few sectio ns cover the ins, o uts, and general in formation that you should kno w
before programming the LabelW riter printer.
Resetting the Printer
Each print job should begin with a print er reset command. This ensures that the printer
always begins in a known stat e.The co mmandch aractersused t o resetth eLab elWriter
printer are ESC (decimal value 27) followed by * (decimal value 42).
Command Parameters
When sending a command, all of th e command characters and pa rametersth at make up a
command must be sent, wit hout intervenin g characters. This is especially important when
using the barcod e and graphics co mmands. Sending fewer characters than specified for the
command will either cause the command to fail or result in subsequ ent data being lost.
Character Evaluation
Most of the parameters that are sent to the Label Writer printer are evaluated based on thei r
decimal value. It is very important to have a good understanding o f what this means.
The ASCII character that is represented by a ‘3’ does not have a d ecimal value of 3 (the
character '3' has a decimal v alue of 51, as liste d in the cha racter code table).
Some people find it easy to thi nk of the ASCII table as a table of 8-bi t BYTE values, and
these byte values represent the ch aracterssho wn in the table. Since a SPACE character has a
value of 32 decimal, a byte val ue of 32 decimal needs to be sent to represent a space in
character output.
Some commands accept parameters by either th eir decimal value or the represent ative
character. For example, the set p rint orientation command (GS V) interprets bot h a NULL
(ASCIIdeci mal value of 0) and the ‘0’ character as meanin g the same thing . This ensures
backwards compatibil ity with t he original Label Writer SE printer and shou ld not be
assumed to be true for all commands in general.
16-BitCharacter Pa rameters
The maximum value a single 8-bit ch aractercan represent is 255. Some commands, though,
can take value s that are greater than 255.
The set horizontal starting positio n command (ESC X), for example, specifies a distance (in
dots) that the next tex t object will print from the left margin. Becau sea d ot is only 1/8th of
a millimeter, a value of 255 would place the object only a little o ver 31 mmfrom the left
margin.
6