4-11
Similarly, a parameter cannot be given a value of 32 (for
example) by sending the ASCII character represented by ‘3’ and
the ASCII character represented by ‘2.’
By referencing the ASCII table, you will notice that the space
character has a decimal value of 32. Therefore, to set a parameter
to a value of 32, you should send a space character.
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 was done to ensure backwards compatibility with the
original LabelWriter SE 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/8
th
of a
millimeter, a value of 255 would place the object only a little over
31mm from the left margin. To allow for longer distances to be
specified, two 8-bit characters are used to specify the value, by
combining them into one 16-bit character. Though the
calculations are all done within the LabelWriter, it is important to
understand how the characters are handled.
The decimal value of the first character that is sent (usually noted
as n1) is multiplied by 256. The decimal value of the second
character sent (usually noted as n2) is then added to this.