DEHAN POS-58A User manual

All specifications are subjec to change without notice
POS-58A
Receipt Printer
User Manual
ted


PD02-058 User Manual ·1·
1 INTRODUCTION ....................................................................................................................................2
1.1 POS-58A Receipt Printer...............................................................................................................2
1.2 Feature............................................................................................................................................2
1.3 Outline............................................................................................................................................2
1.4 Caution...........................................................................................................................................2
2 SETTING UP THE PRINTER..................................................................................................................3
2.1 Unpacking......................................................................................................................................3
2.2. Main frame....................................................................................................................................3
2.3. Connecting the printer...................................................................................................................3
2.3.1 RS232 INTERFACE...........................................................................................................4
2.3.2 PARALLEL INTERFACE..................................................................................................5
2.3.3 USB INTERFACE..............................................................................................................5
2.3.4 ETHERNET INTERFACE .................................................................................................5
2.4 Connect the cash drawer................................................................................................................6
3 USING THE PRINTER............................................................................................................................7
3.1 Control Panel .................................................................................................................................7
3.2 Online and Offtline ........................................................................................................................7
3.3 Feed paper......................................................................................................................................7
3.4 Setting the print density.................................................................................................................7
3.5 Setting the baudrate........................................................................................................................7
3.6 Enter the test mode.........................................................................................................................8
3.7 Enter the debug mode ....................................................................................................................8
3.8 Install the paper roll .......................................................................................................................8
3.9 Tear off paper.................................................................................................................................9
4 ESC/POS PRINTING COMMAND SET...............................................................................................10
4.1 Set of Command...........................................................................................................................10
4.2 Command detail...........................................................................................................................12
4.2.1 Print Commands................................................................................................................12
4.2.2 Line spacing setting command.......................................................................................12
4.2.3 Character command .......................................................................................................13
4.2.4 Bit Image Command.........................................................................................................15
4.2.5 Cash drawer control command..........................................................................................17
4.2.6 Key control command.......................................................................................................17
4.2.7 Init command ....................................................................................................................17
4.2.8 Status Command ...............................................................................................................17
4.2.9 Bar Code Command..........................................................................................................18
4.2.10 Print Posiiton and Page Command..................................................................................20
5. Sample Programming.............................................................................................................................23
APPENDIXA:CODE PAGE...................................................................................................................24
APPENDIXB:International characters....................................................................................................26
APPENDIXC:Arabic characters.............................................................................................................27

·2·PD02-058 User Manual
1 INTRODUCTION
1.1 POS-58A Receipt Printer
POS-58A is designed for use for use with electronic instruments such as ECR,POS,banking
equipment,computer peripheral equipment,etc.
1.2 Feature
High Speed printing: 90mm per second
Low noise thermal printing.
Interface: RS-232(POS-58AS),Parallel(POS-58AP),USB(POS-58AU)
12V or 24V cash drawer interface.
Barcode printing is possible by using a barcode command.
Different print densities can be selected by PC S/W
1.3 Outline
Printing Method: Thermal
Paper Width: 57.5mm
Paper Diameter: 55mm
Resolution: 203DPI
Printing Speed: Up to 90mm/s
Barcode Supported: I25,UPC-A,UPC-E,EAN-8, EAN-13,Codebar,Code39,
Code93,Code128,Code11,MSI
Font: ASCII(12x24),(8x16))
Graphic printing: Direct bitmap printing
Page mode printing
Paper Sensor: Photo-sensor
Head tempeture detection: Thermistor
Communication Interface: RS232,PARALLEL,USB,ETHERNET optional
Cash drawer interace: Support 12V/24V cash drawer
Power supply: 9V,3A
Power <1W(Idle)
45W(printing)
Head Life: 50km
Printing width: 48mm
Operation condition: 5~45℃,20~90%RH(40℃)
Storage condition: -40~60℃,20~93%RH(40℃)
Dimension: 168x108x81
Weight: 0.370kg
1.4 Caution
Some semiconductor devices are easily damaged by static electricity. You should turn the printer
“OFF”, before you connect or remove the cables on the rear side, in order to guard the printer
against the static electricity. If the printer is damaged by the static electricity, you should turn the

PD02-058 User Manual ·3·
rinter “OFF”.
This Apparatus complies with class “A” limits for radio interference
THE PRINTER
hese items. If any items are damaged or missed,please
co
p
2 SETTING UP
2.1 Unpacking
our printer box should include tY ntack your dealer for assistance.
2.2.Mainframe
Accord nication cable to the printer.
2.3. Connecting the printer
ing to the printer type, connect the correct commu
POS-58A-S RS232
POS-58A-L PARALLEL
POS-58A-U USB
POS-58A-E ETHERNET

·4·PD02-058 User Manual
You can connect up the three cable to the printer. They all connect to the connector panel on
the bac
ash drawer cable
ote: Before connecting any of the cable, make sure that both the printer and the host are
2.3.
OS-58AS use RS232 intreface to connect the printer and host computer. It use DB9
/DTR,XON/XOFF flow control protocol.
k of the printer:
Commucation cable
C
Power supply connector
N
turned off.
1 RS232 INTERFACE
P
RS232 interface, support RTS/CTS,DSR
Connect the printer as following picture:
RS232 PIN definition:
PIN SIGNAL IO DEFINITION
1 DCD NC
2 RxD O end the printer status to PCUT S
3 TxD IN Receive command and data from PC
4 DTR NC
5 GND --- GND
6 DSR OUT
ON: Paper is ready
r or No power
OFF: No Pape
7 RTS NC
8 CTS OUT Clear to send
9 RI NC

PD02-058 User Manual ·5·
INTERFACE
POS-58AP use tanda a
Parallel pin d nition:
2.3.2 PARALLEL
8 bit s rd p rallelinterface. It use DB25 male socket.
efi
PIN SIG LNA IO DEFINITION
1 / pulse. The printer will latch the
sition edge.
STB IN
Latch strobe
data at the po
2 D1 IN DATA BIT0(LSB)
3 D2 IN DATA BIT1
4 D3 IN DATA BIT2
5 D4 IN DATA BIT3
6 D5 IN DATA BIT4
7 D6 IN DATA BIT5
8 D7 IN DATA BIT6
9 D8 IN DATA BIT7 (MSB)
10 /ACK OUT
The printer acknology, indicate that the printer
g.
has fineshed one byte data readin
11 B OUT
he printer busy signal,When it is high, the
USY T
printer can not receive data from PC
12 PE OUT
P
t
aper error signal, When it is high, indication
hat the printer is out of paper.
13 SEL O onnect to 5V by a 47K resistorUT C
14 NC -
15 ERR OUT
ERROR, When it is low, the printer is in
errorstatus. It can be caused by out of paper or
the printer head tempreture
16-17 NC ---
18-25 GND ---
2.3.3 USB INTERFACE
POS-58AU use the B-Type USB interface as the followed picture.
e USB driver first. When the driver is installed, the
computer will add one virtual COM port, such COM3, COM4 etc. RS232 COM
para
2.3.4 ETHERNET INTERFACE
POS-58AE use RJ45 socket. The communication cable is not provided by the printer.
The IP address of the printer can be setted up be PC S/W.
In order to use the USB type, please install th
It can be used the samle as RS232. The printer and computer must select the same
metres.

·6·PD02-058 User Manual
2.4 Connect the cash drawer
The printer use RJ-11 6line socket., support most 12V/24V cash drawer. Connecting the cash
drawer as the followed picture:
Cash drawer socket definiction:
PIN DEFINITION IO
1 GND
2 Cash drawer open control IN
3
4 +24V POWER
5 Cash drawer open control IN
6
NOTE:
Use a drawer the matches the printer specification. Using an improper drawer may
damage the drawer as well as the printer.

PD02-058 User Manual ·7·
Must not connect the telegphone line to the cash drawer.
he “LINE” buttons will toggle the printer with on “online”, “offline”mode.
“offline” mode, the printer receive and handle the command send by PC, discard the send
r, the printer will enter “offline”.
the “FEED” button, the printer will feed the paper by 20mm.
e paper.
3. gle the printer density. POS-58A can select 3 level
elease the “online” button, POS-58A will save the current density.
rease.
audrate setting is only effective with POS-58AS and POS-58AU.
n. Don’t release it.
ton.
6. e baudrate. POS-58A support the follows baudrate:
5200
epower up the POS-58A.
The default value is 9600.
3 USING THE PRINTER
3.1 Control Panel
3.2 Online and Offtline
T
NOTE:
When powered up, the printer will stay in the “online” mode.
When in “online” mode, the printer receive and handle the data and command send by PC.
When in
by PC.
When the printer is out of pape
3.3 Feed paper
Pressing
NOTE:
When the printer is out of paper, the printer will not feed th
3.4 Setting the print density
1. Power up the printer
2. Press the “online” button, not released.
Press the “feed” button to tog
densities.(Low、Middle、High).
4. R
Note:
When selecting the high level, the printing will desc
3.5 Setting the baudrate
B
1. Remove the paper roll. Power down.
2. Press the “feed” butto
3. Power on POS-58A
4. Release the “feed” but
5. Install the paper roll.
Press the “online” to toggle th
9600,19200,38400,57600,11
7. R
Note:

·8·PD02-058 User Manual
3.6 Enter the test mode
The test mode use to test the printer printing function.
1. Power down.
2. Install the paper roll.
3. Press the “feed” button. Don’t release it.
4. Power up.
POS-58A will print the printing test page.
3.7 Enter the debug mode
Debug mode allow experienced users to see exactly what data is coming to the printer. This can
useful in finding software problems. When you turn on the debug mode, the printer prints all
commands and data in hexadecimal format along widht a guide section to help you find specific
command.
1. Remove the paper roll. Power down
2. Press the “feed” button, Don’t release it.
3. Power up POS-58A
4. Release the “feed” button.
5. Install the paper roll.
In debug mode, POS-58Awill prints all commands and datas in hexadecimal format as follows:
1B21 001B 2602 4040 .!..&.@@
4040 020D 1B44 0A14 @@...D..
1E28 2828 0001 0A41 .(((...A
0D42 0A43 4343 4445 .B.CCCDE
Note:
In debug mode, POS-58AS, POS-58AU will change the baudrate with “online” key. Make sure the
baudreate is your want please.
3.8 Install the paper roll
POS-58A has easy-loading paper mechanism. Installing or Replacing the paper roll as follows:
1. Open the paper roll cover by pulling up the fastener. see fig2-1
2. Remove the used paper roll core if there is one.
3. Insert the paper roll as shown 2-3, 2-2.
4. Be sure to note the correct direction that the paper comes off the roll.
5. Pull out a small amount of paper, as shown 2-4, Then close the cover.
6. Install OK. as shown 2-5.

PD02-058 User Manual ·9·
3.9 Tear off paper
Tear off the paper as shown

·10·PD02-058 User Manual
4 ESC/POS PRINTING COMMAND SET
4.1 Set of Command
Type Command Name
LF Print and line feed
Print Command ESC J Print and Feed n dots paper
ESC 2 Select default line spacing
ESC 3 n Set line spacing
Line spacing
Command ESC a n Select justification
ESC ! n Select print mode(s)
ESC SO Turn double width on
ESC DC4 Turn double width off
ESC { n Turn upside-down printing mode on/off
ESC B n Turn inverting printing mode on/off
ESC % n Select/Cancel user-defined characters
ESC & Define user-defined characters
ESC ? Cancle user-defined characters
ESC R n Select and internation character set
Character
Command
ESC t n Select character code table
ESC * Select bit-image mode
GS * Define downloaded bit image
Bit Image Command
GS / Print downloaded bit image
Cash drawer
command ESC p Generate cash drawer control pulse
Key Control
Command ESC c 5 Enable/disable panel buttons
Init Command ESC @ Initialize printer
ESC v Transmit paper sensor status
ESC u Transmit peripheral device status
Status Command
GS a Enable/Disable AutomaticStatus Back(ASB)
GS H Select printing position of human readable
characters
GS h Set bar code height
GS w Set bar code width
Bar Code Command
GS k Print bar code
ESC L Setlect page mode
FF Print and return to standard mode(in page mode)
ESC FF Print data in page mode
CAN Cancel print data in page mode
ESC W … Set printing area in page mode
Print Posiiton
and Page Command
ESC $ nL nH Set absolute print X position

PD02-058 User Manual ·11·
GS $ nL nH Set absolute print Y position
ESC \ nL nH Set relative print X position
GS \ nL nH Set relative print Y position
GS L nL nH Set left margin
GS W nL nH Set printing area width

·12·PD02-058 User Manual
4.2 Command detail
POS-58A printer use ESC/POS command set.
The printing command is descripted as followed format:
CMD Function
ASCII List by ASCII characters
Decimal List by decimal characters
Format
Hexadecimal List by hexadecimal characters
Description Command function description
Example Command use example
4.2.1 Print Commands
LF Print and line feed
ASCII LF
Decimal 10
Format
Hexadecimal 0A
Description LF prints the data in the print buffer and feeds one line.
When the print buffer is empty, LF feeds one line.
ESC J n Print and feed paper
ASCII ESC J n
Decimal 27 74 n
Format
Hexadecimal 1B 4A n
Description n = 0-255。
ESC J prints the data in the print buffer and feeds n dots.
The command will not change the setting set by command ESC 2,ESC 3.
4.2.2 Line spacing setting command
ESC 2 Select default line spacing
ASCII ESC 2
Decimal 27 50
Format
Hexadecimal 1B 32
Description ESC 2 sets the line space to default value (30dots)
ESC 3 n Set line spacing
ASCII ESC 3 n
Decimal 27 51 n
Format
Hexadecimal 1B 33 n

PD02-058 User Manual ·13·
scription n = 0-255
ESC 3 n sets the line spacing to n dots.
The de
De
fault value is 30
ESC a n Select align mode
ASCII ESC a n
Decimal 27 97 n
Format
Hexadecimal 1B 61 n
Description ed in the standard mode.
≤ 50
Align right: n=2,50
The command is only us
0 ≤ m ≤ 2 or 48 ≤ m
Align left: n=0,48
Aligh middle: n=1,49
4.2.3 Character command
ESC ! n Select print mode
ASCII ESC ! n
Decimal 27 33 n
Format
Hexadecimal 1B 21 n
Description
lt value is 0. This command is effective for all characters.
:Character font 12x24 selected
d
Double Height mode not selected
d
ed
BIT6:
IT7: 1:Underline mode selected
0:Underl d lected
ESC SO Select Double Width mode
The defau
BIT0: 0
1:Character font 8x16 selecte
BIT1:
BIT2:
BIT3: 1:Emphasized mode selected
0:Emphasized mode not selected
BIT4: 1:Double Height mode selected
0:
BIT5: 1:Double Width mode selecte
0:Double Width mode not select
B
ine mo e not se
ASCII ESC SO
Decimal 27 14
Format
Hexadecimal 1B 0E
n Select Double Width mode
To tur l f, use LF or DC4 command.
Descriptio
n doub e width of
ESC DC4 Disable Double Width mode
Format ASCII ESC DC4

·14·PD02-058 User Manual
Decimal 27 20
Hexadecimal 1B 14
ion Disabl le ode Descript e Doub Width m
ESC { n Set/Cancel Character Updown mode
ASCII ESC { n
Decimal 27 123 n
Format
Hexadecimal 1B 7B n
scription n=1:Enable Updown mode
n=0:Disable Updown Mode
Defaul e
De
t valu is 0
ESC B n Turn white/black reverse printing mode on/off
ASCII ESC B n
Decimal 27 66 n
Format
Hexadecimal 1B 42 n
scription n=1:Enable white/black reverse mode
n=0:Disable white/black reverse mo
Defaul e
De
de
t valu is 0
ESC % n Enable/Disable User-defined Characters
ASCII ESC % n
Decimal 27 37 n
Format
Hexadecimal 1B 25 n
1:Enable User-defined character
n
Description n=
=0:Disable User-defined character
ESC & s Define User-defined characters
ASCII ESC & s n m w d1 d2 … dx
n m w
Format
Decimal 27 38 s n w m d1 d2 … dx
Hexadecimal 1B 26 s n w m d1 d2 … dx
De tion scrip
character.
3(24dots)
th 0~8(s=2),0~12(s=3)
n: User-defined character startin
efi d charact s ending code
dx format:
d7
The command is used to define user-defined
s=2 or 3,32≤ n ≤ m < 127
s: Character height bytes, =2(16dots); =
w: Character wid
g code BIT 7
BIT 6
BIT 5
BIT 4
BIT 3
m: User-d ne er
dx:data,x=s*w
s=3
d1 d4
d2 d5 d8
d3 d6 d9 BIT 2
d36 BIT 1
dx
BIT 0
s=2
d3 d5
d1

PD02-058 User Manual ·15·
d16d2 d4 d6
Disable user-defined character ESC ? n
ASCII ESC ? n
Decimal 27 37 n
rmat
Hexadecimal 1B 25 n
Fo
Description
ESC ? n u ed characters, printer will use the interal character.
Select an internal character set
disable ser-defin
ESC R n
ASCII ESC R n
Decimal
rmat
cimal
27 82 n
Fo
Hexade 1B 52 n
De tion scrip
inter cter llows:
Denmark II
1:France 6:Italy 11:Spain II
ermany 7:Spain1 12:Latin America
:U.K. 8 13:Korea
4:Denma 9
Select character code table
Select an nal chara set n as fo
0:USA 5:Sweden 10:
2:G
3 :Japan
rk 1 :Norway
ESC t n
ASCII ESC t n
Decimal n
rmat
adecimal n
27 116
Fo
Hex 1B 74
De tion scrip
a page n he character code table as follows::
8:862
2:852 6:863
858
d1 d2…dk Select bit-image mode
Select from t
0:437 4:860
1:850 5:861
3:857 7:
4.2.4 Bit Image Command
ESC * m nL nH
ASCII ESC * m nL nH d1 d2 … dk
Decimal 27 42 m nL nH d1 d2 … dk
Format
1B 2A m nL nH d1 d2 … dk
Hexadecimal
Descrip
mand selects a bit image mode using m for the number of dots specifed by
)
tion
This com
(nL+nH*256
m =0,1,32,33。
nL=0-255

·16·PD02-058 User Manual
nH=0-3
dx
k
k
Th ws:
1: 8dots double density,203dpi
31:24 dots single density,102dpi
32:24 dots 03dpi
The bit imag user-defined character.
Print downloaded bit image
=0-255
= nL+256*nH (m=0,1)
= (nL+256*nH)*3 (m=32,33)
e modes selected by m are as follo
0:8dots single density,102dpi
double density,2
e format is the same as
GS / n
ASCII GS / n
Decimal 29 47 n
Fo
Hexadecimal 1D 2F n
rmat
Description
image using the mode specified by n as
specified in the rt e d i y when there is
no data in the p buffer ommand i d if a d d bit image has not
been defined.
n=0-3、48 Spec mode
Ver I Hori PI
This command prints a downloaded bit
cha .In standard mod , this comman s effective onl
rint . This c s ignore ownloade
-51: ify bit image
n Bit Image Mode tical DP zontal D
0,48 Normal 203DPI 203DPI
1,49 Double width 203DPI 101DPI
2,50 Double height 101DPI 203DPI
3,5 Q 1DPI 101DPI 1 uadruple 10
n=65-68: P o
rint log 1-4
GS * x y d1…dk Define downloaded bit image
ASCII GS * x y d1 … dk
Decimal 29 42 x y d1 … dk
Format
a
Description s ded bit image by using x*8 dots in the
8 dots in the vertical direction. Once a
n en define, it is avaiable until
ESC & or ESC @ is executed
x=1~48(width),y=1~255(height),x×y < 1200, k=x×y×8
Hex decimal 1D 2A x y d1 … dk
Thi command defineds a downloa
horizontal direction and y*
dow loaded bit image has be
¾Another definition is made
¾
¾The power is turned off
¾The printer is reset

PD02-058 User Manual ·17·
4.2.5 Cash d
ESC p m n1 n2 Generate pulse
n1 n2
rawer control command
ASCII ESC p m
Decimal 27 112 m
Format
n1 n2
Hexadecimal 1B 70 m n1 n2
Description
Sen ls cified connector pin. It is used to open the cash
dr
l pulse is send to. 0:pin2, 1:pin5
. (unit:2ms)
4.2.6 Key
ESC c 5 n Enable/Disable the panel key
ASCII ESC c 5 n
d a pu e to the spe
awer.
m:specia the pin the
n1,n2:pulse on & off time
control command
Dec 2 3 n
Hexade 1 5 n
Description el key
n=0 ault)
imal 7 99 5
Format
cimal B 63 3
n=1,Disable the pan
,Enable the panel key(Def
4.2.7 Init com
ESC @ Initialize the printer
C @
mand
ASCII ES
Decimal 27
Format
64
Hexadecimal 1B 40
Description Initializes the printer.
¾ri er is cleared.
¾m to default value.
n dard mode
¾
4.2.8 Status C
ESC v Transmit aper sensor status
ASC ESC v
The p nt buff
Reset the para
¾retur to stan
Delete user-defined characters
ommand
p
II
Decim 27 118
Format
Hexadecim 1B 76
al
al
Description Transm the status of t aper sensor as yte of data.
POS-58 not supports this command.
The sta s byt
Bi Func on Value
its he p 1 b
AP
tu e definition:
t ti

·18·PD02-058 User Manual
0
1
2 NO PAPER 1
3 MECHANISM ERROR 1
4 0 0
5
6 PRINTER TEMPERAUTRE OVER 1
7
GS a n Enable isable omatic Status Back(ASB)
ASCII GS a
/D Aut
n
Decim
Format
H cimal 1D 61
Description POS-58A nd
n ini
Value
al 29 97 n
exade n
P don’t support this comma
tion as follows:
def
Bit Func on ti 0 1
0 0
1
2 Disable/Enable ASB Disable Enable
3-4
5
l set busy
n R status
USY
Disable Enable
Disab e/Enable
whe in ERRO
RTS=B
6-7
When ASB is enabled, the printer will send the changed status to PC
ESC u Transmit peripheral devices status
ASCII ESC u
Decimal 27 117
Format
Hexadecimal 1B 75
ion POS-58A don’t sup
Return s finetion:
bit0
POS-58A always return 0 back.
Descript port this command.
statu bytes de
: Drawer status.
bit4: 0
4.2.9 Bar Code Command
GS H n Select printing position of human readable characters
ASCII GS H n
Decimal 29 72 n
Format
Hexadecimal 1D 48 n
Table of contents