SATO WS4 Series Owner's manual

WS4 SERIES
Programming Reference
WS408DT / WS412DT
WS408TT / WS412TT
WS4-r01-27-01-17PR
© 2017 SATO Corporation. All rights reserved.

Contents-2
Contents
1. Introduction.................................................................................................................... 1
2. Default Settings.............................................................................................................. 1
3. Font List.......................................................................................................................... 2
4. Command List................................................................................................................ 4
5. How to Read the Command Manual............................................................................. 8
6. Control Command........................................................................................................ 10
ESC+A Start Data Transfer ..................................................................................................... 10
ESC+Z End Data Transfer....................................................................................................... 11
ESC+Q Number of Pages........................................................................................................ 12
ESC+ID Job ID Number........................................................................................................... 13
ESC+WK Job Name................................................................................................................ 14
7. Print Position Command ............................................................................................. 15
ESC+H Horizontal Print Position.............................................................................................. 15
ESC+V Vertical Print Position.................................................................................................. 16
8. Edit Command.............................................................................................................. 17
ESC+P Character Pitch........................................................................................................... 17
ESC+L Character Expansion................................................................................................... 18
ESC+PS Proportional Pitch ..................................................................................................... 19
ESC+PR Release Proportional Pitch....................................................................................... 20
ESC+% Rotation...................................................................................................................... 21
ESC+F Sequential Number ..................................................................................................... 22
ESC+FW Rule / Grid Print....................................................................................................... 23
ESC+( Inversed Color Print...................................................................................................... 24
ESC+& Store Form Overlay..................................................................................................... 25
ESC+/ Recall Form Overlay..................................................................................................... 26
ESC+WD Partial Copy............................................................................................................. 27
ESC+J Journal Print................................................................................................................ 28
9. Font Command............................................................................................................. 29
ESC+XU XU Font.................................................................................................................... 29

Contents-3
ESC+XS XS Font .................................................................................................................... 31
ESC+XM XM Font................................................................................................................... 33
ESC+XB XB Font .................................................................................................................... 35
ESC+XL XL Font..................................................................................................................... 37
ESC+OA OCR-A Font ............................................................................................................. 39
ESC+OB OCR-B Font ............................................................................................................. 41
ESC+$ Outline Font Design..................................................................................................... 43
ESC+$= Outline Font Print ...................................................................................................... 44
ESC+RD CG Font ................................................................................................................... 47
ESC+U U Font......................................................................................................................... 50
ESC+S S Font......................................................................................................................... 52
ESC+M M Font........................................................................................................................ 54
ESC+WB WB Font .................................................................................................................. 56
ESC+WL WL Font................................................................................................................... 58
10. Barcode Command.................................................................................................... 60
ESC+B Barcode (Ratio 1:3)..................................................................................................... 63
ESC+D Barcode (Ratio 1:2)..................................................................................................... 65
ESC+D~ESC+d Barcode (HRI Font) ....................................................................................... 67
ESC+BD Barcode (Ratio 2:5) .................................................................................................. 68
ESC+BT Barcode Ratio........................................................................................................... 70
ESC+BW Barcode Print by Specified Ratio ............................................................................. 71
ESC+BI GS1-128 (UCC/EAN128).......................................................................................... 74
ESC+BC CODE93................................................................................................................... 76
ESC+BG CODE128 (128A, 128B, 128C)................................................................................. 78
ESC+BF UPC add-on barcode (BOOKLAND) ......................................................................... 82
ESC+BP POSTNET ................................................................................................................ 84
ESC+EU Composite Symbol ................................................................................................... 86
ESC+BL UPC-A Barcode (No HRI).......................................................................................... 89
ESC+BL~ESC+d UPC-A Barcode (Font Designation)............................................................. 90
ESC+BM UPC-A Barcode (with HRI)....................................................................................... 92

Contents-4
11. 2D Code Command.................................................................................................... 93
ESC+2D10 PDF417 ................................................................................................................ 93
ESC+2D12 Micro PDF............................................................................................................. 96
ESC+2D20 MAXI Code ........................................................................................................... 99
ESC+2D30 QR Code (Model 2)............................................................................................. 101
ESC+2D31 QR Code (Model 1)............................................................................................. 105
ESC+2D50 Datamatrix (ECC200).......................................................................................... 131
ESC+2D51 GS1 Datamatrix .................................................................................................. 133
ESC+BQ QR Code................................................................................................................ 134
ESC+BV MAXI Code............................................................................................................. 159
ESC+BK PDF417.................................................................................................................. 161
ESC+BX DataMatrix.............................................................................................................. 164
ESC+DC Datamatrix (Data)................................................................................................... 165
ESC+FX Datamatrix (Sequential Number)............................................................................. 166
12. Graphic Command................................................................................................... 168
ESC+G Graphic Print............................................................................................................. 168
ESC+GM BMP File Print........................................................................................................ 169
ESC+GP PCX File Print......................................................................................................... 170
13. System Command.................................................................................................... 171
ESC+CS Print Speed............................................................................................................. 171
ESC+#E Print Darkness ........................................................................................................ 172
ESC+A1 Media Size.............................................................................................................. 173
ESC+A3 Base Reference Point............................................................................................. 174
ESC+EP Print End Position................................................................................................... 175
ESC+~(NULL) Multi Cut......................................................................................................... 176
ESC+CT Cut Number Unit..................................................................................................... 177
ESC+NC (EJ) Eject and Cut.................................................................................................. 178
ESC+~A Cut Number Unit..................................................................................................... 179
ESC+~B Eject and Cut.......................................................................................................... 180
ESC+* Clear Memory ............................................................................................................ 181

Contents-5
ESC+C Reprint...................................................................................................................... 182
ESC+PG Register Printer Operation...................................................................................... 183
ESC+PC Register Printer Operation...................................................................................... 186
ESC+LD User Download....................................................................................................... 188
ESC+PO Offset ..................................................................................................................... 189
ESC+IG Sensor Type............................................................................................................ 190
ESC+PH Print Method........................................................................................................... 191
ESC+PM Print Mode ............................................................................................................. 192
ESC+IK Media Feed Control.................................................................................................. 193
ESC+I2 Serial Interface......................................................................................................... 196
ESC+I3 LAN interface............................................................................................................ 197
ESC+W1 IP Address............................................................................................................. 198
ESC+W2 Subnet Mask.......................................................................................................... 199
ESC+W3 Default Gateway .................................................................................................... 200
ESC+WI IP Address Setup.................................................................................................... 201
ESC+TW Option Waiting Time .............................................................................................. 202
ESC+TK Forced Tear off....................................................................................................... 203
14. Memory Card Commands........................................................................................ 204
ESC+CC Card Slot................................................................................................................ 204
ESC+FM Format Memory Card............................................................................................. 205
ESC+&S Store Form Overlay ................................................................................................ 206
ESC+&R Recall Form Overlay............................................................................................... 208
ESC+YS Store Format........................................................................................................... 209
ESC+/N Store Field............................................................................................................... 212
ESC+YR Recall Format......................................................................................................... 213
ESC+/D Print Field ................................................................................................................ 214
ESC+GI Store Graphic .......................................................................................................... 215
ESC+GR Recall Graphic ....................................................................................................... 216
ESC+GT Store BMP file ........................................................................................................ 217
ESC+GC Recall BMP file....................................................................................................... 218

Contents-6
ESC+* Clear (Memory card).................................................................................................. 219

1
1. Introduction
This document includes the command specifications of the WS4 series.
(1) WS408DT: Head density 203(dpi) / Direct thermal printer
(2) WS408TT: Head density 203(dpi) / Thermal transfer & Direct thermal printer
(3) WS412DT: Head density 300(dpi) / Direct thermal printer
(4) WS412TT: Head density 300(dpi) / Thermal transfer & Direct thermal printer
Command language used in this document is based on the SBPL(SATO Barcode Printer Language).
2. Default Settings
Default setting of the printers are listed below.
WS4 series
Item
Range
Default
Print speed
2-6 ips (203 dpi), 2-4 ips (300 dpi)
5 ips (203 dpi), 4 ips (300 dpi)
Darkness range
A, B
A (fixed)
Print darkness
1-5
3 (DT), 2 (TT)
Pitch offset
[-99, 99]
+0
Zero slash
w/ zero slash, w/o zero slash
w/o zero slash
Proportional/Fixed pitch
Propotional pitch, fixed pitch
Propotional pitch

2
3. Font List
Built-in fonts for the WS4 series are as follows.
Built-in fonts
Font
Font type
Command
Pitch
OCR-A ( 8dot/mm)
Bitmap 15×22 dots
OA
Fixed
OCR-B ( 8dot/mm)
Bitmap 20×24 dots
OB
Fixed
OCR-A (12dot/mm)
Bitmap 22×33 dots
OA
Fixed
OCR-B (12dot/mm)
Bitmap 30×36 dots
OB
Fixed
XU
Bitmap 5× 9 dots [Helvetica]
XU
Fixed/Proportional
XS
Bitmap 17×17 dots [Univers Condensed Bold]
XS
Fixed/Proportional
XM
Bitmap 24×24 dots [Univers Condensed Bold]
XM
Fixed/Proportional
XB
Bitmap 48×48 dots [Univers Condensed Bold]
XB
Fixed/Proportional
XL
Bitmap 48×48 dots [Sans Serif]
XL
Fixed/Proportional
U
Bitmap 5× 9 dots
U
Fixed
S
Bitmap 8×15 dots
S
Fixed
M
Bitmap 13×20 dots
M
Fixed
WB
Bitmap 18×30 dots
WB
Fixed
WL
Bitmap 28×52 dots
WL
Fixed
Outline
Outline font
$(Designation of shape)
$=(Designation of print)
Fixed/Proportional
CG Times
True Type font
RD
Fixed/Proportional
CG Triumvirate
True Type font
RD
Fixed/Proportional

3
Expanded font
Built-in fonts can be expanded by a factor of 1 to 12.
Example: A font in a size of 5 dots in width and 9 dots in height is expanded by a factor of 3. The resulting font has a width of 15 dots
and a height of 27 dots.
The following are the input methods of width and height parameters.
Width x Expansion factor = Width parameter setting value
Height x Expansion factor = Height parameter setting value
The command <L> controls the font expansion factor, and the parameter is specified by the magnification.
Example: If setting the factor to: <L>0304, the character is expanded by a factor of 3 in horizontal direction (width) and a factor of 4
in vertical direction (height).
If the command <L> is specified, the pitch between characters becomes wider as well.
Fixed pitch / Proportional pitch
As for XU~XL font, outline font and CG font, either fixed pitch or proportional pitch can be selected. Use the Proportional Pitch
command <PS> and the Proportional Pitch Release command <PR> for the settings of proportional pitch.
Depending on the font, the width of the proportional pitch differs. On the other hand, the width of alphanumeric becomes narrow by
specifying the proportional pitch.
As for the fixed pitch, the character width is according to the relevant font size selected.
Difference between outline font and bitmap font
The height and the width of bitmap font are predefined. The height of the bitmap font is a little bit larger than the width.
The bitmap font is the largest one in the font matrix.
For the font type and size, refer to the font list on the previous page.
As for the outline font, if setting the height and the width of the font properly, the smooth scaling algorithm of the printer allows you to
create a well balanced font. It is also possible to select some style options such as gray scale and shadow settings.

4
4. Command List
Category
Command
Restriction
Control
Start Code
<A>
Stop Code
<Z>
Print Quantity
<Q>
Job ID Number
<ID>
Job name
<WK>
Print position
Horizontal Print Position
<H>
Vertical Print Position
<V>
Modification
Character Pitch
<P>
Character Expansion
<L>
Proportional Pitch
<PS>
Release Proportional Pitch
<PR>
Rotation (Fixed Base Reference Point)
<%>
Sequential Numbering
<F>
Rule / Grid print
<FW>
Inversed Color Print
<(>
Store Form Overlay
<&>
Recall Form Overlay
</>
Partial Copy
<WD>
Journal Print
<J>
Font
XU Font
<XU>
XS Font
<XS>
XM Font
<XM>
XB Font
<XB>
XL Font
<XL>
OCR-A Font
<OA>
OCR-B Font
<OB>
Outline Font design
<$>
Outline Font print
<$=>
CG Font
<RD>
CG Times, CG Triumvirate only
U Font
<U>
S Font
<S>
M Font
<M>
WB Font
<WB>
WL Font
<WL>

5
Category
Command
Restriction
Barcode
Barcode (Ratio 1:3)
<B>
Barcode (Ratio 1:2)
<D>
Barcode (HRI)
<D>~<d>
Barcode (Ratio 2:5)
<BD>
Barcode Ratio
<BT>
Barcode Ratio by Specified Ratio
<BW>
GS1-128 (UCC/EAN128)
<BI>
CODE93
<BC>
CODE128
<BG>
UPC Add-on Barcode
<BF>
POSTNET
<BP>
GS1 DataBar Composite Symbol
<EU>
UPC-A Barcode (No HRI)
<BL>
UPC-A Barcode (with HRI)
<BL>
~<d>
UPC-A Barcode (with HRI)
<BM>
2D code
PDF417
<2D10>
Micro PDF
<2D12>
MAXI code
<2D20>
QR Code (Model 2)
<2D30>
QR Code (Model 1)
<2D31>
DataMatrix (ECC200)
<2D50>
GS1 DataMatrix
<2D51>
QR code
<BQ>
MAXI code
<BV>
PDF417
<BK>
DataMatrix
<BX>
DataMatrix (Data)
<DC>
DataMatrix (Sequential number)
<FX>

6
Category
Command
Restriction
Graphic
Graphic print
<G>
BMP File print
<GM>
PCX File print
<GP>
System
Print Speed
<CS>
Print Darkness
<#E>
Media Size
<A1>
Base Reference Point
<A3>
Print End Position
<EP>
Multi cut
<~>
Cut Number Unit
<CT>
Eject and Cut
<NC>
Cut Number Unit
<~A>
Eject and Cut
<~B>
Clear
<*>
Reprint
<C>
Register Printer Operation
<PG>
Register Printer Operation
<PC>
User Download
<LD>
Offset
<PO>
Tear-off Offset: -60 to +99 dots
Sensor Type
<IG>
Print Method
<PH>
Print Mode
<PM>
Media Feed Control
<IK>
Serial Interface
<I2>
LAN Interface
<I3>
IP Address
<W1>
Subnet Mask
<W2>
Default Gateway
<W3>
IP Address
<WI>
Option Waiting Time
<TW>
Forced Tear Off
<TK>

7
Category
Command
Restriction
Memory card
Card Slot
<CC>
Format Memory Card
<FM>
Store Form Overlay
<&S>
Recall Form Overlay
<&R>
Store Format
<YS>
Store Field
</N>
Recall Format
<YR>
Print Field
</D>
Store Graphic
<GI>
Recall Graphic
<GR>
Store BMP File
<GT>
Recall BMP File
<GC>
Clear (Memory card)
<*>

8
5. How to Read the Command Manual
7.2 Modification
Available for
WS4 series
ESC+L
Hex code
ESC
L
Parameter
<1B>16
<4C>16
aabb
Initial setting
aa=01, bb=01
Persistence of
the command
When printer is powered-off
Set parameter will not be retained
Validity in a job
Parameter set will be retained until next valid setting
Validity after a job
Parameter set will be the initial value for the next job
[Function]
Specifying the print expansion factor.
[Format]
<L>aabb
● Parameter
a [Horizontal expansion factor (width)] = validity range : 01 to 12
b [Vertical expansion factor (height)] = validity range : 01 to 12
[Coding example] Horizontal expansion factor (width): 4, Vertical expansion factor (height): 3
<A>
<V>100<H>200<P>3<L>0403<OA>ABCD
<Q>2
<Z>
[Notes]
1. The pitch between the characters is equally enlarged. When setting the inter character pitch <P>, the preset horizontal
expansion factor <L> will be valid for the inter character pitches <P> thereafter.
2. If enlarging graphics, put in expansion factor <L> just before the graphic print command.
[Tips]
1. When using the expansion function, be careful not to fall out of the printing range. Therefore, select a correct print format.
[Valid command]
WS4 series
Font
<X20>
<X21>
<X22>
<X23>
<X24>
<OA>
<OB>
<K1>
<K2>
<K3>
<K8>
<K9>
<k1>
<k2>
<k3>
<k8>
<k9>
Modification
<P>
<RF>
Graphic
<G>
<GM>
Font Expansion
1)
3)
4)
8)
9)
10)
11)
12)
13)
14)
5)
7)
6)
2)

9
1) Command identification.
[Control], [Print position], [Modification], [Font], [Barcode], [2D code], [Graphic], [System], [Memory card] and [Calendar].
2) Command availability depending on printer model.
[] indicates unavailable commands.
Example) Commands only available for the WS4 series as shown below.
Available for
WS4DT series
WS4TT series
3) Command name
4) Command code
5) Command as HEX code
6) Command describing parameters. () indicates that omission is possible
7) Default command value
8) Persistence of the Command
● When printer is powered off
(1) Set Parameter will be retained
(2) Set parameter will not be retained (Set parameter will not be retained)
(3) Command settings will not be retained (Command setting will not be retained)
● Validity in a job
(1) Retained until next valid setting
(2) Set parameter will be retained
(3) Becomes invalid after execution
● Valid after a job
(1) Set parameter will be the default value for the next job<a>.
(2) Set parameter will be retained until next valid setting
(3) Becomes invalid after execution
(4) Becomes invalid after execution
9) Command function outline
10) Command, necessary parameter
<L>aabb indicates the ESC+L (<1B>16<4C>16) command with the parameters aa and bb
11) Example for command input
If putting out a code via RS-232C to a printer connected, the programming will be done in BASIC language:
12) Explanation of commands and parameters
13) Tips when using the command
14) Other commands which will be influenced by using the specific command
10 ESC$=CHR$ (&H1B)
20 OPEN “COM1: 9600, N, 8, 1, RS, BIN”FOR OUTPUT AS #1
30 PRINT #1, ESC$; “A”;
40 PRINT #1, ESC$; “V100”; ESC$; “H200”;
50 PRINT #1, ESC$; “P3”; ESC$; “L0403”;
60 PRINT #1, ESC$; “OAABCD”;
70 PRINT #1, ESC$; “Q2”;
80 PRINT #1, ESC$; “Z”;
90 CLOSE #1
100 END

10
6. Control Command
Control
Available for
WS4 series
ESC+A Start Data Transfer
ESC+A
Hex code
ESC
A
Parameter
<1B>16
<41>16
None
Default setting
None
Persistence of
the command
When printer is powered off
Command setting will not be retained.
Validity in a job
Becomes invalid after execution
Validity after a job
Becomes invalid after the job
[Function]
Start code. Data transfer defaultized.
[Format]
<A>
[Coding example]
<A>
<V>100<H>200<P>2<L>0202<OA>ABCD
<Q>2
<Z>
[Notes]
1. Defaultizes item. Command is used always at beginning of an item.
2. Always use data transfer start <A> and data transfer end <Z> as a set.
[Important]
1. Except for some system commands, all command settings will be set to default value.
2. If not starting data transfer with <A>, the print will not be executed.
Start Data Transfer

11
Control
Available for
WS4 series
ESC+Z End Data Transfer
ESC+Z
Hex code
ESC
Z
Parameter
<1B>16
<5A>16
None
Default setting
None
Persistence of
the command
When printer is powered off
Command settings will not be retained.
Validity in a job
Becomes invalid after execution
Validity after a job
Becomes invalid after the job
[Function]
Stop code. Data transfer terminated.
[Format]
<Z>
[Coding example]
<A>
<V>100<H>200<P>2<L>0202<OA>ABCD
<Q>2
<Z>
[Notes]
1. Terminates item. Command is used always at the end of an item.
2. Always use data transfer start <A> and data transfer end <Z> as a set.
[Important]
1. If not ending data transfer with <Z>, the print will not be executed.
End Data Transfer

12
Control
Available for
WS4 series
ESC+Q Number of Pages
ESC+Q
Hex code
ESC
Q
Parameter
<1B>16
<51>16
aaaaaa
Default setting
aaaaaa=1
Persistence of
the command
When printer is powered off
Set parameter will not be retained
Validity in a job
Becomes invalid after execution
Validity after a job
Becomes invalid after the job
[Function]
Defines number of pages to be printed.
[Format]
<Q>aaaaaa
● Parameter
a [Number of pages] = Valid range : 1 - 999999
[Coding example] 2 pages to be print
<A>
<V>100<H>200<P>2<L>0202<OA>ABCD
<Q>2
<Z>
[Notes]
1. The data between start data transfer <A> and end data transfer <Z> is regarded as one page. <Q> defines how many pages of
the same content shall be printed out.
2. Command is put in before the end data transfer <Z> command.
[Important]
1. Print out of the same information will be done for pages specified. If the appearance of a serial number is set <F>, then this
number will be of consecutive order.
2. If specifying with a multi-cut <~>, the defined number of pages will be multiplied by cut number.
Number of Pages

13
Control
Available for
WS4 series
ESC+ID Job ID Number
ESC+ID
Hex code
ESC
ID
Parameter
<1B>16
<49>16<44>16
aa
Default setting
aa=<20>16
Persistence of
the command
When printer is powered off
Set parameter will not be retained
Validity in a job
Set parameter will be retained until next valid setting
Validity after a job
Becomes invalid after the job
[Function]
Defines job ID for status return
[Format]
<ID>aa
● Parameter
a [Job ID number] = Valid range : 00 - 99
[Coding example] Job ID number: 01
<A>
<ID>01
<V>200<H>100<P>0<$>B,100,100,6
<$=>SATOPRINTER
<Q>2
<Z>
[Notes]
1. If using a status return in the transfer protocol, the job ID number can be set in the telegram.
2. The status can be confirmed by putting out a status request (ENQ).
3. This command is set within the item, between start data transfer <A> and end data transfer <Z>.
[Important]
1. Activates when status return transfer protocol is used and status request (ENQ) is received during printing (incl. QTY≠0, offline,
error).
2. If status return transfer protocol is used, and status request is received while not printing (QTY=0, start up, no data received),
space (20H) will be set and returned as status.
3. If defining a job ID number several times during one item (between start data transfer <A> and end data transfer <Z>), the last
definition will be valid.
4. For more details, refer to the “Interface Specifications”.
Job ID Number

14
Control
Available for
WS4 series
ESC+WK Job Name
ESC+WK
Hex code
ESC
WK
Parameter
<1B>16
<57>16<4B>16
aaaaaaaaaaaaaaaa
Default setting
aaaaaaaaaaaaaaaa=<20>16
Persistence of
the command
When printer is powered off
Set parameter will not be retained
Validity in a job
Set parameter will be retained until next valid setting
Validity after a job
Becomes invalid after the job
[Function]
Defines job name for status return
[Format]
<WK>aaaaaaaaaaaaaaaa
● Parameter
a [Job name] = ASCII-CODE 16 digits
[Coding example] Job name: SATO
<A>
<WK>SATO
<V>200<H>100<P>0<$>B,100,100,6
<$=>SATOPRINTER
<Q>2
<Z>
[Notes]
1. If using the status 4 as transfer protocol, the job name can be set in the telegram.
2. The status can be confirmed by putting out a status request (ENQ).
3. This command is set within the item, between start data transfer <A> and end data transfer <Z>.
4. This command can be used together with Define job ID number <ID>.
[Tips]
1. Activates when status return transfer protocol is used and status request (ENQ) is received during printing (incl. QTY≠0, offline,
error).
2. If status return transfer protocol is used, and status request is received while not printing (QTY=0, start up, no data received),
space (20H) will be set and returned as status.
3. If defining a job ID name several times during one item (between start data transfer <A> and end data transfer <Z>), the last
definition will be valid.
4. For particulars, refer to the [Interface Specification].
Job Name
Other manuals for WS4 Series
1
This manual suits for next models
4
Table of contents
Other SATO Printer manuals