Title
Rev.
Page
HMC-060, HMK-060 Release 2
Ver2.0
P.50
6-3) Sample program
This sample program is based on VB6.00.
If you want to use the paper type (line mode),
please print the string without the coordinate, and the ticket type (page mode).
Private Sub Command1_Click()
MSComm1.CommPort = 1
'Printerport
MSComm1.Settings = "9600,n,8,1"
'SET RS-232C
MSComm1.PortOpen = True
MSComm1.Handshaking = comRTS
‘ RTS flow control
MSComm1.RTSEnable = True
MSComm1.Output = CHR$(&H1B) & "L"
' set page mode
MSComm1.Output = CHR$(&H1B) & "T" & CHR$(1) ' page toward
' coordinate and string printing’
MSComm1.Output = CHR$(&H1B) & "W" & "0104" & "1120"
‘ x,y coordinate
MSComm1.Output = "ABCD" & CHR$(&H0D)
MSComm1.Output = CHR$(&H1B) & "W" & "0136" & "1120"
‘ x,y coordinate
MSComm1.Output = "Korean" & CHR$(&H0D)
'--------- BARCODE --------------------------------
MSComm1.Output = CHR$(&H1B) & "W" & "0376" & "0688"
MSComm1.Output = CHR$(&H1D) & "h" & CHR$(40)
' barcode height
MSComm1.Output = CHR$(&H1D) & "k" & CHR$(5)
' barcode type
MSComm1.Output = "010001200307311439" & CHR$(0)
' barcode data
' -------- PAGE AREA PRINTING ---------------------
MSComm1.Output = CHR$(&H1B) & CHR$(&HC)
' print page area
' ---------- CUTTING POSITION ----------------------
MSComm1.Output = CHR$(&H1A) & "b" & CHR$(1)
' search forward black mark
MSComm1.Output = CHR$(&H1B) & "J" & CHR$(80)
' adjust cutting position
MSComm1.Output = CHR$(&H1B) & "i”
' full cutting
'---------- ADJUST NEXT PRINT POSITION ------------
MSComm1.Output = CHR$(&H1A) & "b" & CHR$(3)
' search backward black mark
MSComm1.Output = CHR$(&H1B) & "j" & CHR$(110)
' back feeding
‘----------- PAGE AREA CLEAR AND TO STANDARD MODE --------------
MSComm1.Output = CHR$(&H1B) & "S"
‘ return to standard mode and clear page area
MSComm1.PortOpen = False
End Sub