|
-
Jan 27th, 2009, 06:15 AM
#1
Thread Starter
Junior Member
[2008] ESC codes using PrintDocument
Using VB2008 Express I am redesigning a POS application.
(originally written in VPRO/5 (http://www.basis.com/))
One of the problems I encounter is to send the hexadecimal
value 1B70000532 (open the cashdrawer), to a CITIZEN CT-S2000 printer.
I use the Printdocument object
Private Sub Receipt_PrintPage(ByVal sender As Object, _
by val e As System.Drawing.Printing.PrintPageEventArgs) _
Handles Me.PrintPage
e.Graphics.DrawString("Name of Shop", _
_titleFont, Brushes.Black, 20, 20)
Dim yPos As Single = 100
Using img As Image = Image.FromFile("E:\winksys 2009 \citizen_logo.jpg")
e.Graphics.DrawImage(img, 20, 60)
yPos += img.Height
End Using
e.Graphics.DrawString("detail 01", _detailFont, Brushes.Black, 20 ,yPos)
yPos += e.Graphics.MeasureString("detail 01", _detailFont).Height
+++++++++++++++++++++++++++++++++
INSERT code to open Cash Drawer
hex string 1B 70 00 05 32
+++++++++++++++++++++++++++++++++
End If
End Sub
Thanks for replying
-
Jan 30th, 2009, 08:18 AM
#2
Re: [2008] ESC codes using PrintDocument
I got your e-mail. I don't reply to problems posted in e-mails or PM's - so I'm going to post your question here for others to review.
I don't know the answer to your questions below. The only time I've used a thermal printer and cash drawer they came with a very nice set of classes that managed the hardware through object and property calls. Why are you using ESC sequences??
--------------------------------------------------------
Hi there, perhaps you could help me out ?
VB2008 lacks direct printing. So after adding the
Microsoft.VisualBasic.Powerpacks.VS reference i imported
Microsoft.VisualBasic.PowerPacks.Printing.Compatibility.VB6
This provides the Printer.Print() method to send control commands to
the line thermal printer, urgently needed in a POS application.
Some commands do work fine,like chr(&HA) = line feed, others do not
like chr(&H9) = horizontal TAB. Ofcourse is this functionality available
in the PrintDocument object, so no problem.
The most needed command is to open the cash drawer.
The manual for the printer (CITIZEN CT-S2000) provides :
[Sample Program Quick Basic]
LPRINT CHR$(&H1B) + "p"
LPRINT CHR$(0); ?Selects pin No. 2.
LPRINT CHR$(5); ?Sets ON time to 10 ms
LPRINT CHR$(50); ?Sets OFF time to 100 ms
In VB2008 (actually VB6) this would be
Printer.Print (CHR(&H1B) & "p" & chr(0) & chr(5) & chr(50))
Unfortunally no result.
Using VB2008 Express i am redesigning a POS application.
originally written in VPRO/5.
VPRO/5 is an object oriented bussiness BASIC by BASIS International
(http://www.basis.com/)
Years ago I encountered the same problem in VPRO/5 .
Print $1B70000550$ ''($....$ represents HexString)
no result.
This was solved by using mnemonic's to start/end
an "open transparacy" mode to send the string unaltered
by the driver direct to the printer.
Print 'BO',$1B70000550$,'EO'
cashdrawer kicked !!
Would there be a function/solution like that in VB6 / VB2008 ?
-
Jan 30th, 2009, 09:38 AM
#3
Thread Starter
Junior Member
Re: [2008] ESC codes using PrintDocument
Thx for replying. I understand your advise is to obtain softwarehelp from the manufactory. I'll contact them.
-
Jan 30th, 2009, 10:33 AM
#4
Re: [2008] ESC codes using PrintDocument
Actually - I think that POS namespace is in VS 2005 and later releases.
Have you looked for it?
-
Jan 30th, 2009, 11:53 AM
#5
Thread Starter
Junior Member
Re: [2008] ESC codes using PrintDocument
As you have understood i am new in VB2008. I looked for Windows.PointOfService namespace in the add reference (tab .net) in the IDE of VB2008. No result. Thx for replying.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|