Epson SE450 manual Programming Overview, Programming the LabelWriter Printer

Page 11

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 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

Image 11
Contents Technical Reference Copyright Contents Page Character Codes Configuration Menu Printer Specifications This page intentionally left blank for double-sided printing Introduction This page intentionally left blank for double-sided printing RS-232 Settings Configuring the Host Computer for RS-232 Serial InterfaceRS-232 Cabling RS-232 Signal LevelsProgramming the LabelWriter Printer Programming OverviewBit Character Parameters Resetting the PrinterCommand Parameters Character EvaluationConversions Print Modes Font SpecificationsObjects Orientation Raster ModeText Objects Landscape ModeBarcode Objects Line Objects Graphic ObjectsAlphabetical Command List Command ReferenceESC L Position Control Commands by FunctionGS DC2 GS DC3 GS RS GS US Font ControlPrintable Characters BarcodesMiscellaneous 20h FFh Printable Characters CommandsRaster Compatibility CR Carriage Return DC4 Cancel Double Wide ModeESC B Set Dot Tab ESC a Return Printer StatusESC a Return Hardware Status ESC D Set Bytes per Line ESC c Set Print Temperature to LowESC d Set Print Temperature to Medium ESC E Form Feed ESC e Set Print Temperature to DefaultESC i Set Printing Speed to Barcode ESC g Set Print Temperature to HighESC F 1 n Feed n Lines ESC h Set Print Speed to FastESC M Set Font to 12 cpi ESC L Set Feed LengthESC P Set Font to 16 cpi ESC T Set Font to 7 cpi ESC Q Set Top MarginESC S Set Font to 20 cpi ESC U Set Font to 10 cpi ESC W Wrap Data ESC V Return Firmware RevisionESC Y Set Vertical Starting Position ESC X Set Horizontal Starting PositionESC z Set 136 x 203 dpi ESC * Reset to DefaultsESC @ Reset to Power-up Condition ESC y Set 203 x 203 dpiETB Raster Mode Compressed Graphics FF Form Feed GS DC2 Set Font to Double Height GS a Starting Position of Bar CodeGS d Feed n Text Lines GS DC3 Cancel Double HeightGS k Print Barcode GS h Set Barcode HeightUPC-A Data Matrix BarcodeSupported Square Data Matrix Symbol Sizes Supported Rectangular Data Matrix Symbol Sizes Commands Command Reference GS l Draw Line in Landscape Mode Least significant byte of the line length in dots GS L Set Feed Length GS q Print UPC/EAN Checksum GS RS Set Inverse Print ModeReturns GS S Return Printer StatusGS t Set Characters per Line in Landscape GS T Select Line Wrap/Truncate ModesGS u Set Characters per Line in Portrait GS US Cancel Inverse Print ModeGS W Set Bar Code Element Width GS V Set Print OrientationGS w Set Barcode Module Width GS ~ Enter Debug ModeGS * Landscape Mode Graphics LF Line Feed SO Set Font to Double Wide ModeHT Horizontal Tab SYN Raster Mode Graphics Using the Caret Feature Caret FeatureActivating the Caret Feature Command Reference Char Character CodesCharacter Codes CharName \ back slash DEL Name Decimal Hex Binary Caret Feature Character Codes 251 1111 252 253 254 255 This page intentionally left blank for double-sided printing Configuration Menu Configuration Menu Print Head Specifications Printer SpecificationsHardware Specifications Interface SpecificationsPrinter Specifications Serial Interface Specifications USB SettingsThis page intentionally left blank for double-sided printing