Dymo LabelWriter® SE450 Label Printer Technical Reference - Page 11

Programming Overview, Programming the LabelWriter Printer

Page 11 highlights

Chapter 3 Programming Overview This chapter includes the information needed to control the LabelWriter SE450 printer correctly using ASCII Escape commands (referred to as ESC commands throughout this reference guide). Both basic and advanced topics are explained so that you understand how the LabelWriter SE450 printer works. Programming the LabelWriter Printer The first step in controlling the LabelWriter SE450 printer is to understand how the printer works. As an ASCII-based printer, the LabelWriter SE450 printer accepts 8-bit ASCII characters as both data and commands. The ASCII character table shows the relationship between the 8bit values and the characters they represent. The ASCII Table contains both "Printable" characters (with values 32 - 127 decimal) which are normally just printed, and non-printable, control commands that the printer interprets as action commands (form-feed for example). As the printer reads character input from the controlling device, it interprets the data as characters to be printed, or commands, and acts accordingly. This means that sending data and commands to the printer is usually as simple as transmitting the characters from your program to the port to which the printer is connected. A simple program to print 'Hello World' on the LabelWriter printer might look as follows if written in BASIC. OPEN "COM1:9600,n,8,1" FOR OUTPUT AS #1 PRINT #1, "HELLO WORLD" The "OPEN..." line above opens the selected COM port for printing and initializes the communication settings while the "PRINT..." line sends the data to the printer. Commands can be sent to the printer in exactly the same way. For example, if you wanted to change the font which "Hello World" was printed into a 7-characters-per-inch font, you could look in this manual and find that the required command characters to do this are ESC and T. ESC refers to the Escape character. By checking the ASCII character table, you would find that the ESC character has a decimal value of 27. With this information, you can construct the following program to print 'Hello World' in a 7-characters-per-inch font. OPEN "COM1:9600,n,8,1" FOR OUTPUT AS #1 PRINT #1, CHR$(27); "T"; 5

  • 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
This chapter includes the information needed to control the LabelWriter SE450 printer
correctly using ASCII Escape commands (referred to as ESC commands throughout this
reference guide). Both basic and advanced topics are explained so that you understand how
the LabelWriter SE450 printer works.
Programming the LabelWriter Printer
The first step in controlling the LabelWriter SE450 printer is to understand how the printer
works.
As an ASCII-based printer, the LabelWriter SE450 printer accepts 8-bit ASCII characters as
both data and commands. The ASCII character table shows the relationship between the 8-
bit values and the characters they represent.
The ASCII Table contains both "Printable" characters (with values 32 - 127 decimal) which
are normally just printed, and non-printable, control commands that the printer interprets as
action commands (form-feed for example).
As the printer reads character input from the controlling device, it interprets the data as
characters to be printed, or commands, and acts accordingly. This means that sending data
and commands to the printer is usually as simple as transmitting the characters from your
program to the port to which the printer is connected.
A simple program to print ‘Hello World’ on the LabelWriter printer might look as follows if
written in BASIC.
OPEN “COM1:9600,n,8,1” FOR OUTPUT AS #1
PRINT #1, “HELLO WORLD”
The "OPEN..." line above opens the selected COM port for printing and initializes the
communication settings while the "PRINT..." line sends the data to the printer.
Commands can be sent to the printer in exactly the same way. For example, if you wanted
to change the font which “Hello World” was printed into a 7-characters-per-inch font, you
could look in this manual and find that the required command characters to do this are ESC
and T. ESC refers to the Escape character. By checking the ASCII character table, you
would find that the ESC character has a decimal value of 27. With this information, you can
construct the following program to print ‘Hello World’ in a 7-characters-per-inch font.
OPEN “COM1:9600,n,8,1” FOR OUTPUT AS #1
PRINT #1, CHR$(27); “T”;
5
Chapter 3