SATO Europe NV makes no guarantee of any kind with regard to this material, including,
but not limited to, the implied guaranties of merchantability and fitness for a particular
purpose.
SATO Europe NV shall not be liable for errors contained herein or for any incidental consequential damages in connection with the furnishing, performance, or use of this material.
This document contains proprietary information which is protected by copyright.
All rights are reserved.
No part of this document may be reproduced or issued to third parties in any form whatsoever without the express permission of SATO Europe NV.
The information in this document is subject to change without notice.
This section presents the commands that are used with the SATO Series “e” and PRO
printers to produce labels with logos, bar codes and alphanumeric data. All of the
SATO Programming Language commands use the same syntax. Some commands
reference a physical point on the label using horizontal and vertical dot reference
numbers. The allowable range for these references is dependent upon the particular
printer to accomodate different print widths and resolutions. These differences are
noted in tables under the commandsaffected
The following information is presented in this section:
• The SATO Programming Language
• Selecting Protocol Control Codes
• Using Basic
• The Print Area
• Command Codes
THE SATO PROGRAMMING LANGUAGE
A programming language for a printer is a familiar concept to most programmers. It is
a group of commands that are designed to use the internal intelligence of the printer.
The commands, which are referred to as SATO Command Codes, contain
non-printable ASCII characters (such as <STX>, <ETX>, <ESC>) and printable
characters. These commands must be assembled into an organized block of code to
be sent as one data stream to the printer, which in turn interprets the command codes
and generates the desired label output. The programmer is free to use any
programming language available to send the desired data to the printer.
The command codes used by the printers are based upon “Escape” (1B
hexadecimal) sequences. Typically there are four types of command sequences:
<ESC>{Command}
These commands generally tell the printer to perform a specific action, like “clear the
memory.”
<ESC>{Command} {Data}
Commands with this format tell the printer to perform a specific action which is
dependent upon the following data, like “print X labels”, where the value for X is
contained in the data.
<ESC>{Command} {Parameter}
Section 1. Programming Concepts
Page 1-2SATO Programming Reference
These commands set the operational parameters of the printer, like “set the print
speed to 3.”
<ESC> {Command} {Parameter} {Data}
Some commands can contain both Parameter and Data elements, such as “print a
Code 39 symbol containing the data.”
SELECTING PROTOCOL CONTROL CODES
Protocol codes are the special control characters that prepare the printer to receive
instructions. For example, the <ESC> character tells the printer that a command code
will follow and the <ENQ> character asks for the printer status. There are two
pre-defined different sets of Protocol Control codes to choose from. Each set is made
up of six special characters. The Standard Protocol Control codes are non-printable
characters, and the Non-Standard Protocol Control codes are printable characters.
The Non-Standard set may be useful on host computers using protocol converters or
in an application where non-printable ASCII characters cannot be sent from the host.
This manual uses the Standard Protocol Control codes for all of the examples.
Alternately, the user may define and download a set of custom Protocol Control
Codes (see Appendix E).
The Protocol Control codes are selected by DIP switch DSW2-7.
USING BASIC
It may be useful to test your printer using a BASIC program on a PC. You may also
write your actual production programs in BASIC. Whatever the reason, if you will be
working in BASIC, some of the following hints may help you get started:
1. Set the WIDTH of the output device to 255 characters to avoid automatically
sending <CR> and <LF> characters after every line. The command string should
be continuous and uninterrupted by <CR> and/or <LF> commands. The examples
given in this manual are printed on separate lines because they will not fit on one
line and do not contain any <CR> and/or <LF> characters. If these characters are
needed, they are explicitly noted by the inclusion of <CR> and<LF> notations.
2. If you are using the printer’s RS232C interface, it is necessary to set the COM
porton on the PC such that the CTS and DSR signals will be ignored. Send your
OPEN “COM” statement in the following way:
OPEN “COM1:9600,E,8,1,CS,DS”AS #1
This sets the RS232C communication parameters of the host PC’s COM1 port for
9600 baud, Even parity, 8 Data bits, 1 Stop bit and directing the port to ignore the
CTS and DSR control signals.
3. You may want to minimize keystrokes and program size by assigning the
<ESC>character to a string variable since this character is used quite often.
The following two examples in BASIC show a typical example using thesehints. Both
of these examples use the Standard Protocol codes.
PRINTING WITH THE PARALLEL PORT
PRINTING WITH THE RS232C PORT
5 REM CL612 Parallel ExampleIdentifies the program as a CL612 parallel
port print label. The “REM” prevents this
data from being sent to the printer and
displays it only on thescreen.
10 E$=CHR$(27) Sets the “E$” string as an <ESC>character
20 WIDTH “LPT1”255 Sets the width of the output to 255
characters
30 LPRINT E$;"A";Sends an “<ESC>A” command code tothe
LPT1 parallel port
40 LPRINT E$;"H400";E$;"V100";E$;"XL1SATO"; Sends the data “SATO” to be to be placed
400 dots horizontally and 100dots
vertically on the label and printed in the
“XL” font.
50 LPRINT E$;"Q1"; Instructs the printer to print one label.
60 LPRINT E$; “Z”; Tells the printer that the last commandhas
been sent. The printer can nowcreate and
print the job.
REM CL612 RS232 ExampleIdentifies the program as a CL612e
RS232C port print label. The “REM”
prevents this data from being sent to
the printer and displays it only on the
screen.
10 E$=CHR$(27)Sets the“E$”string as an
<ESC>character.
Section 1. Programming Concepts
Page 1-4SATO Programming Reference
THE PRINT AREA
The maximum print area for the different printer models is listed in Table 1. Many of
your label applications may not require labels that fill the entireprint area, therefore it
is important to understand how to work with labelsthat do not use the entire print area.
The goal is to help you avoid printing where no label exists, which may lead to print
head damage, not to mentionfrustration when you cannot see the printed output.
The diagram below illustrates the maximum print area and a sample 2 inch wide by 3
inch long label placed within this area. As can be seen, your label will be oriented
against the inside left edge of the printer as viewed from the front of the printer. The
normal reference point is located at the H1, V1 position of the print area in the normal
print orientation (no rotation).
OPEN COM1:9600,N,8,1,CS,DS AS #1 Opens the COM1 port for output and
sets the parameters as 9600 baud, No
parity, 8 Data bits, 1 Stop bit and
instructs the port to ignore the CTS and
DSR control signals.
30 PRINT #1,CHR$ (2);Sends an <STX> (ASCII Code a
decimal “2”) to the printer instructing it
to prepare to receive a message.
50 PRINT #1,E$;"A"; Sends an “<ESC>A” command code to
Print Port #1 opened by statement 20
above.
60 PRINT #1,
E$;"H400";E$;"V100";E$;"XL1SATO";
Sends the data “SATO” to be placed
400 dots horizontally and 100 dots
vertically on the label and printed in
the“XL” autosmoothed font.
50 PRINT #1, E$;"Q1";Instructs the printer to print a quantity of
one label.
60 PRINT #1, E$; “Z”;Tells the printer that the last
commandhas been sent. The printer
can nowcreate and print the job.
70 PRINT #1,CHR$ (3);Sends an <ETX> (ASCII Code decimal
“3”) to the printer telling it that this is the
end of the message.
Identifies the program as a CL612e
RS232C port print label. The “REM”
prevents this data from being sent to
the printer and displays it only on the
screen.
Section 1. Programming Concepts
SATO Programming ReferencePage 1-5
l
There are three methods available to make sure your printed output will appear
correctly on your label. They are as follows:
1. Media Size Command. Use the <ESC>A1 Media Size Command. This command
specifies the width and length of the label. The printer will automatically calculate
the correct offsets for printing labels of that size. However, if you specify a label
size with this command, the labels loaded should match the size specified to correctly position the label.
2. Base Reference Point Command. Send the <ESC>A3 Base Reference Point
command as part of your data to the printer to set a new base reference point for
your label.
Calculate the distance (in dots) from the normal base reference point to the closest edge of the label.
For an M-8400RVe 8 dpmm printer , this would be:
LABEL WIDTH = 2" X 25.4 MM/IN X 8 DPMM = 406 DOTS
The new Base Reference Point then becomes:
NEW BASE REFERENCE POINT = MAXIMUM PRINT WIDTH - LABEL WIDTH
= (832 DOTS) - (406 DOTS) = 426 DOTS
Issue the Base Reference Point command <ESC>A3 after the Start command in
your data stream.
<ESC>A<ESC>A3H0426V0001. . . . . .
This resets the reference point for all the following data.
3. Add the correct offset to all horizontal commands. Use the normal base refer-
ence point from the print area and use the horizontal position for each field to
properly locate it on the label.
Calculate the distance (in dots) from the normal base reference point to the closest edge of the label.
For an M-8400RVe 8 dpmm printer:
Label Width = 2" x 25.4 mm/in x 8 dpmm = 406 dots
New Base Reference Point = Maximum Print Width - Label Width
= (832 dots) - (406 dots) = 426 dots
Each <ESC>H command would have the value “426” added to it to correctly position each field.
Note: The <ESC>A3 Base Reference Point command can also shift the reference
point in a negative direction (toward the outside edge of the label).
The Command Code subsection contains a sample label output for each command
code. These samples reflect how the printed information would appear on a five inch
wide label. If you want to test any of the sample label outputs and are using labels
less than five inches in width, we suggest that you add the Base Reference Point
command to the data stream in order for the images to print on your labels.
You must be careful not to print off the label surface as the label provides a heat sink
Section 1. Programming Concepts
SATO Programming ReferencePage 1-7
for the print head elements. Doing so will cause irrepairable damage to the head. This
damage is not covered under the print head warranty. The addition of the Base
Reference Point command to the sample data stream may help to adjust the print for
your labels. See the following two examples or refer to the Base Reference Point
command description.
For example, the following illustrates a sample data stream for a M-8400RVe printer
and the resulting label assuming a 4 inch wide label:
If you are using a 2 inch wide label, the entire image may not appear on your label. By
adding the following Base Reference Point command to the second line of the data
stream, the base reference point will be changed, causing theimage to be shifted over
toward the inside of the printer where it can beprinted on the narrower label.
The image is moved horizontally to the right 2 inches (406 dots) so that itcan be
printed on a 2 inch wide label. For more information, see the Base Reference Point
command description.
Section 1. Programming Concepts
Page 1-8SATO Programming Reference
ROTATED FIELDS
The M-8400RVe printer can rotate each print field in 90° increments using the Rotate
command.
• <ESC>% - The field rotates, but the base reference point for the field remains
the same.
The following data stream will rotate the print field but will not change the base
reference point of the field:
There are some types of commands that must have a value specified before a label
can be printed. If the data stream does not contain these commands, a default value
is assumed. The commands and the corresponding default values are:
COMMANDDEFAULTNOTE
Print Rotation 0°(1)
Vertical Reference Point0 (1)
Horizontal Reference Point0 (1)
Character Pitch 2 (1)
Base Reference Point H=0, V=0 (2)
Character Expansion1(1)
Print Darkness-(1)(3)
Print Speed (DSW2-8 = On)-(2)(3)
Print Speed (DSW2-8 = Off)-(2)(3)
Proportional SpacingEnabled(1)
Cutter CommandDisabled (1)
Section 1. Programming Concepts
Page 1-10SATO Programming Reference
NOTES:
1. The settings for these commands will revert to the default value when the printer
receives an <ESC>Z or an <ESC>*.
2. The values transmitted with these commands will remain in effect until a new
command is received.
3. This default setting is printer dependent.
OPPOSITE HAND”SE” PRINTERS
The standard “Se” print engine is referred to as a“right-hand”printer (i.e., when facing
the Control Panel, the label comes out from left to right). The M-8485Se, M-8460Se
and M-8490Se are also available in a “left-hand” (i.e., the label comes out right-to-left)
version. The M-8459Se is only available in the standard Right-Hand configuation.
The only difference in the print area is the horizontal base reference point for the
label.With the standard “Se” printer, the reference point is the first print position
nearest the inside frame. With the “left-hand” version, the reference point is the first
print position away from the frame. The same command stream sent to both printers
should print an identical label except the image may be shifted because of the relative
positioning of the label under the print head.
SECTION 2.
COMMAND CODES
This section contains the basic Command Codes for the SATO “e” and PRO Series
printers. Commands for the oprions and specialized functions are provided in the
following sections. Commands must be sent to the printer in an organized fashion in
order for the label(s) to print.
The purpose of this section is to:
• Explain the different commands and provide examples of their usage.
• To provide a detailed reference for programming the printers.
Each command begins on a separate page with its own heading. A uniform layout is
used to help you find key information about each command. For each Command
Code in this section, there will be a sample data input stream to the printer and the
expected print output. By studying the examples, you can learn how to use the
particular command within a whole block of printer code. Pay particular attention to
the “Special Notes” with each command to learn other important information.
The subject commands are highlighted in bold letters in the Reference Sheets. There
are two parts of most, but not all, commands. The first is the command character
which immediately follows the <ESC> code. It is always an upper case alpha or a
special character (such as an “&” or a “%”). It is never a lower case alpha character. If
the command requires additional variable information, it is represented by a group of
lower case alpha characters immediately following the command character. For
example, if an aaaabb is listed following the basic command, the printer will look for
six characters immediately following the command. The first four would represent the
value of aaaa and the next two the value of bb.
The maximum number of characters defined in a parameter is represented by the
number of characters shown in the command structure. For example, a command
followed by an aaaa can have up to four characters. In general, commands with only
one parameter following the command can be entered without the leading zeroes.
However, certain commands require the exact number of matching characters. A
command with two parameters listed following the command code without a comma
delimiter, such as aaaabbbb require the exact number of digits to be entered. If the
value of aaaa is “800” and the value of bbbb is “300”, then the parameters must be
entered as “08000300”. It is recommended that you make it a practice to always enter
leading zeros to prevent any mistakes.
NOTE: These examples assume the use of the Standard Protocol Command
Codes, a parallel interface and a 5 inch wide label in a M-8400RVe printer.
The labels for all other printers will be similar, but, because of different
resolutions and print widths may be larger or scaled differently.
An alphabetical listing of the command codes is contained in Appendix A:Command
Code Quick Reference.
SATO Programming ReferencePage 2-1
Section 2: Command Codes
Bar Codes
Command Structure1:3 narrow/wide bar ratio: <ESC>Babbcccd
2:5 narrow/wide ratio: <ESC>BDabbcccd
1:2 narrow/wide bar ratio: <ESC>Dabbcccd
a= 0 Codabar
1 Code 39
2 Interleaved 2 of 5 (I 2/5)
3 UPC-A / EAN-13
4 EAN5 Industial 2 of 5
6 Matrix 2 of 5
7 reserved
8 reserved
9 reserved
A MSI
B reserved
C Code 93
D reserved
E UPC-E
F Bookland
G Code 128
I UCC 128
bb= Number of dots (01-12) for narrow bar and narrow
space
ccc= Bar height in dots (001-999)
d= UCC 128 only. Not used for other bar code types
0 No human readable text
1 Human readable at top
2 Human readable at bottom
Example: <ESC>BD103200
Placement: Immediately preceding data to be encoded
Default: None
Command Function To print bar code images on a label. With this command, there are 14
standard bar code symbologies available to be printed and three two
dimensional symbols (see Section 5. Two Dimensional Symbols). Each of
the bar code symbologies are unique, and it is important to know the
differences. See Appendix B for specific information on using each
individual bar code symbol.
SATO Programming ReferencePN 9001096 Rev. APage 2-3
Special Notes 1. UPC and EAN bar codes are not affected by the different types of
narrow to wide ratios. Instead, the <ESC>D command adds
descender bars to these codes where needed to meet UPC specifications. The <ESC>BD command puts desender bars and human
readable text below the symbol.
2. The Code 128, UCC 128, MSI, and Code 93 bar codes are not
affected by the narrow to wide ratios.
3. The Codabar, Code 39, Industrial 2 of 5, and Matrix 2 of 5 bar codes
are affected by the Character Pitch command. This command must
be placed before the Bar Code command.
4. Because of their unique characteristics, two-dimensional (2D) symbols are covered separately.
5. For UCC128, the FNC1 code is automatically inserted and the Mod
10 and Mod 103 check digits are automatically calculated. For the
MSI bar code, the check digit is not automatically calculated.
6. The <ESC>D and <ESC>BD commands are not valid for the MSI,
Code 128, Code 93, UPC-E, Bookland, UCC128 and Postnet symbologies.
SATO Programming ReferencePN 9001096 Rev. APage 2-7
Section 2: Command Codes
Bar Codes, Expansion
Command Structure<ESC>BWaabbb
aa=Expansion factor by which the width of all bars and
spaces will be increased (01-12)
bbb= Bar height by dot (004-999 dots)
Example: <ESC>BW02100
Placement:Immediately follows the <ESC>BT command and
precedes data to be encoded.
Default: None
Command Function This command works together with the <ESC>BT command to specify an
expansion factor and the bar code height for the particular symbol being
printed.
Input to Printer
Printer Output
Special Notes 1. This command must be preceded by the Variable Ratio Bar Codes
2. The following bar codes will be affected by the Character Pitch command: Codabar, Code 39, Interleaved 2 of 5, Matrix 2 of 5.
Page 2-8SATO Programming Reference
Section 2: Command Codes
Bar Codes, Variable Ratio
Command Structure<ESC>BTabbccddee
a=Bar Code Symbol:
bb= Narrow space in dots (01-99)
cc= Wide space in dots (01-99)
dd= Narrow bar in dots (01-99)
ee= Wide bar in dots (01-99)
0 Codabar
1 Code 39
2 Interleaved 2 of 5
5 Industrial 2 of 5
6 Matrix 2 of 5
Example: <ESC>BT101030103
Placement: Following print position commands and preceding
<ESC>BW
Default: Current setting
Command Function To print a bar code with a ratio other than those specified through the
standard bar code commands (B,BD, and D). This is done through
individual control of each of the bar code elements (bars, spaces) as
shown above. Remember that this command only applies to the five bar
code types shown.
SATO Programming ReferencePN 9001096 Rev. APage 2-9
Section 2: Command Codes
Special Notes 1. This command must be immediately followed by the <ESC>BW Bar
Code Expansion command.
2. You may use only one variable ratio bar code per label.
3. If the data specified in this command is incorrect, the command is
ignored and the ratio used will be based on the previous setting.
Page 2-10SATO Programming Reference
Section 2: Command Codes
Base Reference Point
Command Structure<ESC>A3H-aaaa-Vbbbb
-
aaaa
bbbb
Example:
Placement: Preceding all images that are based on the new base
Default:Current V and H offset setting in the printer
Command Function To establish a new base reference point for the current label. The base
reference point is the top left corner or ìoriginî from where all print position
commands are based. This command may be very helpful when using
labels less than four inches wide to place images on the printable label
surface. It may also be used to move images past preprinted fields on a
label.
Input to Printer <ESC>A<ESC>L0202
<ESC>H0025<ESC>V0025<ESC>WB0MNORMAL REFERENCE POINT
<ESC>A3H0300V0075
<ESC>H0100<ESC>V0050<ESC>WB0MNEW REFERENCE POINT
<ESC>Q1<ESC>Z
This character is optional. When present, it specifies
=
that The horizontal offset is in the negative direction. If
it is left out the offset direction is positive.
Horizontal Print Offset (-Hmax to +Hmax)
=
Vertical Print Offset (-Vmax to +Vmax)
=
<ESC>A3H100V0050
reference point
configuration
Printer Output
SATO Programming ReferencePN 9001096 Rev. APage 2-11
Section 2: Command Codes
Special Notes 1. Use of this command will set the Vertical/Horizontal Offset setting of
the printer configuration until a new Base Reference Point command
is issued or the setting is changed from the operator panel.
2. This command may be used more than once in a print job.
3. An alternative to using this command is to make changes to your current Horizontal and Vertical Print Position commands.
Example: Let us say the current base reference point is H=1, V=1 and
you wish to move all the fields on your label downward vertically by
150 dots. You could either (1) add the Base Reference Point
command or (2) change all the vertical position commands by an
additional 150 dots.
4. For a more detailed example of the Base Reference Point command,
see Section 1. Print Area.
5. The "Se" print engines can print as close as 2 mm to the inside edge
of the label.
6. The printers will not “wrap” (i.e. if any part of a character or image
extends beyond the last print dot position, it will disappear and not be
visible on any part of the label).
7. See Table 1 in Section 1. Programming Concepts for values of Hmax
and Vmax.
Page 2-12SATO Programming Reference
Section 2: Command Codes
Characters,Custom-Designed
Command Structure Store Command: <ESC>Tabcc
Recall Command: <ESC>Kab90cc
a=1 16x16 matrix
2 24x24 matrix
b= Specifies the character encoding method for the data
stream
H Hexadecimal characters
B Binary characters
cc= Memory location to store/recall the character. Valid
memory locations are 21 to 52 (counting in Hex) or “!”
or “R” in Binary.
(data)=Data to describe the character
Example: <ESC>T1H3F
<ESC>K1H903F
See Appendix C for a more detailed explanation
Placement: The Store command is typically sent in its own data
stream to the printer, between the Start/Stop
commands. The Recall command is sent in a
secondary data stream to print the character, and
follows any necessary position or size commands.
Default: None
Command Function To allow for the creation, storage, and printing of custom characters, such
as special fonts or logos. Up to 50 individual characters may be stored in
the custom character volatile memory.
Printer InputSee Appendix C for a detailed explanation.