LPT POS printer alternate feed

I have an ancient POS printer Axhiohm A470 http://www.racoindustries.com/axa470.htm. Windows 7 64bit doesn't detect this printer and drivers don't exist. Only way to print (text mode only) is to send print job directly to LPT. After some digging I found that it's pretty easy. Only thing you have to do is correctly create file LPT1 and write to it.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#include <iostream>
#include <conio.h>
#include <windows.h>


int main(int argc, char* argv[])
{
    HANDLE hComm = CreateFileA("LPT1", GENERIC_READ | GENERIC_WRITE,
                       0, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0);

    if (hComm == INVALID_HANDLE_VALUE)
        return 1;

    char str[] = { "   Hello from your printer\n" };

    DWORD bytesWritten;
    unsigned char data;

    BOOL nError = WriteFile(hComm, str, sizeof(str), &bytesWritten, NULL);

    if (nError)
        std::cout << "Data sent" << std::endl;
    else
        std::cout << "Failed to write data " << GetLastError() << std::endl;

    _getch();
}

Now I would like to take one step further and send print job to second feeder. First one is roll of paper inside the printer (prints receipt). This one prints by the code above (it's called validation or something like that). Second one is a slit that is used to put in another receipt. I don't know how to send print job there.
If you think you can help me but don't understand what am I saying (it sounds a little bit cryptic) just ask and I try to make it more clear.
Last edited on
Isn't that usually done with a mechanical sensor on the device? As in you set a sheet of paper into the feed and it knows to grab from there instead of the paper tray for the next print job.
The thing is that the there are two pieces that have to open first before you can put receipt in to validate. I guess, the printer has to receive some command to do that but I have no idea what that would be.

EDIT:
I found out that it might be achieved by sending specific command to printer http://www.codeproject.com/Questions/169760/Print-and-send-commands-to-receipt-printer. I have no idea what command for that printer would be :(

EDIT:
So I finally found that what I need is Escape Sequences. Unfortunately they are nowhere to be found for this particular printer.
Last edited on
Topic archived. No new replies allowed.