Dymo 1761334 Technical Reference - Page 12

Resetting the Printer, Command Parameters, Character Evaluation, 16-Bit Character Parameters

Page 12 highlights

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

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
  • 53
  • 54
  • 55
  • 56
  • 57
  • 58
  • 59
  • 60
  • 61
  • 62
  • 63
  • 64
  • 65
  • 66
  • 67
  • 68
  • 69
  • 70
  • 71
  • 72
  • 73
  • 74
  • 75
  • 76

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