Jump to content

receipt printer & cash drawer


Recommended Posts

hi autoit community
after while of use autoit for my own purpose
i decide to use it in work
now i design a program to restaurant but i have problem with "receipt printer & cash drawer"
i don't now haw thy work
so can you help me please
thanks

Link to comment
Share on other sites

Hello!

It would help greatly if you where to provide what code you might have to give us an Idea of what issue you are dealing with. 

i design a program to restaurant but i have problem with "receipt printer & cash drawer"

i don't now haw thy work

by other word, how i can do like this ?

c76070646677562.jpg

Link to comment
Share on other sites

Lol @ "carholder signature"... You fix cars at the restaurant? :)

Seriously though... Please make your question more specific. You say you designed a program, and you ask how to do receipts. That indicates that you probably have some code already and you are running into some problem(s) building or printing the receipts. Please post the code that you have trouble with so other people can offer suggestions on what you can do to fix it. And/or explain what you are trying to do exactly (like, I have this data that looks like this, and I am trying to generate a receipt with the following logic, but I can't figure out how to X or Y).

Your question sounds like this: hi, I just started driving a car, how do I use AutoIt to replace my radio?

Edited by SadBunny

Roses are FF0000, violets are 0000FF... All my base are belong to you.

Link to comment
Share on other sites

Is this code related? 

You get the acct/cardholder through those card readers...not much I can tell about it, but those companies may hand their sdk for this kind of receipt softwares..

CashDrawer ID are internal IDs just for the "manager" know from who it came from :)

Heroes, there is no such thing

One day I'll discover what IE.au3 has of special for so many users using it.
C'mon there's InetRead and WinHTTP, way better
happy.png

Link to comment
Share on other sites

Receipt printers are just small dot matrix printers, virtually identical to the ones used back in the 1980's. They either use tiny metal pins to strike an ink ribbon against the paper or there's a row of tiny heat elements to make marks on the paper. The ones that hit the paper can do multipart forms where there's a carbon-copy of several layers.

It can be controlled by standard dot matrix printer commands. You need to have the manual for the printer model to know how to control it, though many of them accept Epson print control codes by default, as that was once a very common dot matrix standard.

You may be able to print by simply sending raw data to LPT1 (parallel port) or COM1 (serial port). Though you want to avoid getting Windows and its spooler in the way as you want direct device control without using a "print driver".

Dot matrix printers have no concept of a page, they just print lines. You send output to the printer and it prints until the data buffer is empty. The default state of the printer is to simply print characters using a built-in character font.

If you want graphics you need to send control codes (looks like Escape-X Escape-G, etc) to tell the printer switch to graphic output, and then you need to send dot patterns representing a vertical line of 9-12 dots, then another vertical line, etc all the way across the line. Large graphics are built up from many strips one after the other.

When you're done with sending dot patterns for graphics, you send more control codes (Escape-P Escape-R etc) to go back to basic character printing.

 

In the rare event that your receipt printer has a Windows print driver, then you just print to it like from any other Windows program, formatting text and graphics to fit within a "page frame", and send the complete frame to the printer, and the driver handles graphic data automatically.

Though trying to print a full-size page on a 10cm wide roll will be shrunk so small it will be unreadable, and it likely doesn't have any better than 150dpi so it'll just be a smudge on the paper. Need to use custom page sizes that match the actual printing width of the printer, and then the output will look correct.

 

Cash drawers are real simple. There's a power cord that triggers an unlock solenoid, and the drawer is pushed out by a spring. There are any number of ways to do to this, such as a serial port control board that looks for a specific command and fires the solenoid. It can also be triggered directly via the often unused serial / parallel control lines (CTS / DTR).

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...