Search code examples
c#printingpoint-of-salepos-for-.net

How to use DirectIO() with Pos for .NET


we are using the CUSTOM VKP80III Printer. We want to send a command with the DirectIO Method of the PosCommon base clase. But I'm a little bit stumped on how to do that, in the command manual of the printer I found the following page:

VKP80III Commands Manual

What we want to is send n = 5 to eject the ticket. My question is, if the definition of our DirectIO() looks like this:

object DirectIO(int command, int data, object obj);

Which values do the different parameters need and can I send this all in one command or do I need to send multiple?


Solution

  • After contacting the vendor we got the following answer:

    To have the printer eject a ticket, you can send the Eject command by using DirectIO method and the 1D6505 command.

    So we tried the following:

    printer.DirectIO(0, 0, "1D6505");
    

    But this didn't do anything. After some digging we found some sourcecode for the sample application where we found some code. After inspecting the code we found that we have to convert the Hex values to ASCII and use this as a parameter for the DirectIO method. In the end it looked like this:

    string buffer = ConvertHex("1D6505", _logger);
    printer.DirectIO(0, buffer.Length, buffer);