beautypg.com

Resetting the printer, Command parameters, Character evaluation – Epson LABELWRITER SE450 User Manual

Page 12: Bit character parameters

background image

Programming Overview

PRINT #1, “HELLO WORLD”

In a nutshell, that’s all there is to controlling the LabelWriter printer. Any formatting or
special effect that you may need for your output can be specified simply and easily by
sending the appropriate command characters and the data to be printed.

The next few sections cover the ins, outs, and general information that you should know
before programming the LabelWriter printer.

Resetting the Printer

Each print job should begin with a printer reset command. This ensures that the printer
always begins in a known state. The command characters used to reset the LabelWriter
printer are ESC (decimal value 27) followed by * (decimal value 42).

Command Parameters

When sending a command, all of the command characters and parameters that make up a
command must be sent, without intervening characters. This is especially important when
using the barcode and graphics commands. Sending fewer characters than specified for the
command will either cause the command to fail or result in subsequent data being lost.

Character Evaluation

Most of the parameters that are sent to the LabelWriter printer are evaluated based on their
decimal value. It is very important to have a good understanding of what this means.

The ASCII character that is represented by a ‘3’ does not have a decimal value of 3 (the
character '3' has a decimal value of 51, as listed in the character code table).

Some people find it easy to think of the ASCII table as a table of 8-bit BYTE values, and
these byte values represent the characters shown in the table. Since a SPACE character has a
value of 32 decimal, a byte value of 32 decimal needs to be sent to represent a space in
character output.

Some commands accept parameters by either their decimal value or the representative
character. For example, the set print orientation command (GS V) interprets both a NULL
(ASCII decimal value of 0) and the ‘0’ character as meaning the same thing. This ensures
backwards compatibility with the original LabelWriter SE printer and should not be
assumed to be true for all commands in general.

16-Bit Character Parameters

The maximum value a single 8-bit character can represent is 255. Some commands, though,
can take values that are greater than 255.

The set horizontal starting position command (ESC X), for example, specifies a distance (in
dots) that the next text object will print from the left margin. Because a dot is only 1/8th of
a millimeter, a value of 255 would place the object only a little over 31 mm from the left
margin.

6