Connecting to a receipt printer

Anybody has an answer on how to communicate a receipt printer? I'm creating a POS (POINT OF SALE) and i have to communicate my delphi application (delphi 7.0) to the receipt printer. what line of command should i use for this? like printing the strings inside my TRichEdit component out to the receipt printer. The printer also has a self cutting capability, how should i do this? what code should i write in order to command the printer to cut the receipt.

Thank you in advance.
girlswants_meAsked:
Who is Participating?
 
VoodoomanCommented:
There is no TComponent in Delphi for Serial Comms.

You need to source one.

If you have any version of VB there is a Comm control available, you can wrapper it.

Look on the Internet for a freeware Comm Control for Delphi.

Here is a delphi Library - I haven't tried it but this is something like you need. http://www.delphi32.com/vcl/2092/

You can also do it with Win API - don't ask me how - get a good book on the API like VB Programmers Guide to the Windows API.


Voodooman
0
 
girlswants_meAuthor Commented:
Anybody??
0
 
geobulCommented:
Hi,

Read the printer's manual. Everything (all the commands+parameters) is there. What brand/model is your printer?

Regards, Geo
0
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
VoodoomanCommented:


Hi

You are asking a very difficult problem.

Firstly, this is serial comms and they are very tricky.  You need to have a comm control (or library) that can open the port that you are connected to.

You then need to use the control to send the Escape sequence (usually #27 if I remember correctly) to the port and then you must close the port.

Closing the port is very important and causes people huge problems.  If you don't close the port after use you will not be able to use it again until you restart windows or you have a utility that can close it.

If you have Visual Basic you will have the Comm Control ActiveX that you can use, otherwise I was going to recommend http://www.greenleafsoft.com/CatalogPage.asp?sku=GCX&upd=NO but find that the price is crazy since I bought it.

Epson and Microsoft have a free toolkit that you can download to help you control the printer/drawer/ and display.  The last I looked it was a 6mb download - free to anyone.

This kit took Microsoft and Epson 2 years to develop, so doing it yourself needs a lot of experiment and persisatnce.  I made a Visual Basic AcitveX to do this myself.

Hi Geobul, the Epson Control Set is pretty much standardised and as you say, it's in the book.  What are not standardised however are the cables.  There are many different Serial configurations (v.surprising).  You are going nowhere unless you get the Display, Drawer, Printer and Cables from the same supplier, who needs to be knowledgeable.  You also need the books to setup the dipswitches so that you get the right configuration.

I respecfully suggest that you go back to basics. RTFM, stick some buttons and a comm control on a form and try just to send something to the display alone.  Once you get this working you can move onto the drawer etc.

There is no easy solution to this apart from a lot of hard work.


Voodooman
0
 
geobulCommented:
The two questions pointed in
http://www.experts-exchange.com/Programming/Programming_Languages/Delphi/Q_21386980.html
could be helpful.

Voodooman, I agree with you. I'm a programmer in a bank ;-)
0
 
VoodoomanCommented:

Roger that Geobul

I have 10 years contract experience with VB and SQLServer and have worked as DBA with SQLServer.

I am working tonight (10pm here) on one of my own projects.

If you don't want to do the time ... you aren't gonna be a good programmer...... no free rides...


Voodooman
0
 
girlswants_meAuthor Commented:
What are "escape" codes? Can you give me an example of that using delphi syntax? Assuming you know the kind of printer...
0
 
VoodoomanCommented:

With whatever comm control you are using

mycomm.port='Com1';
mycomm.portopen;

mycomm.send '#27';

mycomm.port close;

depends your comm control how you open and close the port and how you send it.

What you send depends on your printer - you need the manual for this, although Epson is pretty standard

Example:

#13 is carriage return

#10 - Prints the data in the buffer and  and line feeds


so logically

mycomm.port='Com1';
mycomm.portopen;

mycomm.send 'Voodoman Rules'; //put data in the buffer

mycomm.send '#10'; //clear the buffer and lien feed

mycomm.port close;

You really need to do a lot of homework on this - there are no easy fixes.

Voodooman
0
 
girlswants_meAuthor Commented:
is mycomm.send 'Voodoman Rules' and
mycomm.send '#10' valid syntax for delphi 7?

0
 
girlswants_meAuthor Commented:
What "T" component should i use for your "mycomm"?
0
 
girlswants_meAuthor Commented:
ANYOTHER ANSWERS?
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.