2
I’m trying to make a button that sends a command to open the cash drawer connected to the Tanca TP-650 printer. Below is the method I’m trying.
public static void abrirGaveta(bool flag)
{
if (flag == true && Properties.Settings.Default.ImpressoraGaveta == 1)
{
//Metoto para abrir a gaveta
const int charCode = 27;
const int charCode2 = 251;
const int charCode3 = 227;
var specialChar = Convert.ToChar(charCode);
var specialChar2 = Convert.ToChar(charCode2);
var specialChar3 = Convert.ToChar(charCode3);
string cmdText = "" + specialChar + specialChar2 +"22|" + specialChar3;
string driver = "TANCA TP-650";
string comandoAbertura = cmdText;
RawPrinterHelper.SendStringToPrinter(driver, comandoAbertura);
}
}
No error, but it also does not open the drawer.
Are you sure you’re sending the correct code for this?
– João Martins
so, this one I’ve tried with several codes I’ve been finding on the internet. I’m hoping that someone here has done.
– Gabriel Henrique
And is it connected on the printer output anyway? It is not serial?
– Bacco
The drawer is connected to the printer. The printer is USB
– Gabriel Henrique
Have you looked at the example in C# that they have on the page? http://www.tanca.com.br/drivers.php?cat=19&sub=54
– João Martins
@Bacco Consegui!
– Gabriel Henrique
Good that solved. Post the solution in the field below, so help other visitors. It is good to put the code and explain where the error was, there in addition to collaborate with those who face the problem in the future, can still make some dots on the site to whisk the post.
– Bacco