我遇到Epson财务打印机的问题,我需要向Epson TM-T88IV打印机发送命令。问题在于扩展,教程内容如下:
比特0-2'000' - Factura是一个消费者决赛。
'001' - Factura con derecho一个crédito财政 '010' - Notadecrédito是一个消费者决赛 '011' - Notadecréditoconderecho一个crédito财政 '100' - Factura是ITBIS的最后一个外部投资者 '101' - Factura con derecho acréditocounancialconexoneracióndeITBIS Bit 3 Reservado(保留)。
位4-5'00' - Utilizar fuente predeterminada。(默认情况下)
'01' - Utilizar fuente tipo A.(字体A型)
'10' - Utilizar fuente tipo B.(字体B型)
'11' - Reservado。
位6-8'000' - 没有realizar copias。 (无复印件) '001' - Realizar una copia。 (1-拷贝) '010' - Realizar dos copias。 (2-拷贝) '011' - Realizar tres copias。 (3-份数) '100' - Realizar cuatro copias。 (4-份数) '101' - Realizar cinco copias。 (5-份数) '110' - Realizar seis copias。 (6-份数)
问题是在C#上创建格式,因为所有示例都在VB.NET中 我不知道我是否需要将所有位都设置为十六进制或者像字符串一样发送它。 如果它像十六进制那样,我如何将这些字符串解析为十六进制。
这是我到目前为止所做的:
bAnswer = oEpsonFP.AddDataField("\x0\x1");//COmmand to open the ticket
bAnswer = oEpsonFP.AddDataField("\x0\x1");//Extension
bAnswer = oEpsonFP.AddDataField("001");
bAnswer = oEpsonFP.AddDataField("0");
bAnswer = oEpsonFP.AddDataField("0001");
bAnswer = oEpsonFP.AddDataField("0001");
bAnswer = oEpsonFP.AddDataField(billInfo.ncf);
bAnswer = oEpsonFP.AddDataField(billInfo.client_name);
bAnswer = oEpsonFP.AddDataField(billInfo.client_rnc);
bAnswer = oEpsonFP.AddDataField(billInfo.ncf);
bAnswer = oEpsonFP.SendCommand();
foreach (Items item in billInfo.items)
{
//Configuration of the item
bAnswer = oEpsonFP.AddDataField("\xA\x2");
bAnswer = oEpsonFP.AddDataField("\x0\x0");
bAnswer = oEpsonFP.AddDataField("\x0\x0");
bAnswer = oEpsonFP.AddDataField("\x0\x0");
bAnswer = oEpsonFP.AddDataField("\x0\x0");
//Description of the item
bAnswer = oEpsonFP.AddDataField(item.description7);
bAnswer = oEpsonFP.AddDataField(item.description8);
bAnswer = oEpsonFP.AddDataField(item.description9);
bAnswer = oEpsonFP.AddDataField(item.description10);
bAnswer = oEpsonFP.AddDataField(item.description11);
bAnswer = oEpsonFP.AddDataField(item.description12);
bAnswer = oEpsonFP.AddDataField(item.description13);
bAnswer = oEpsonFP.AddDataField(item.description14);
bAnswer = oEpsonFP.AddDataField(item.description15);
bAnswer = oEpsonFP.AddDataField(item.item_name);
bAnswer = oEpsonFP.AddDataField(item.amount.ToString());
bAnswer = oEpsonFP.AddDataField("18.00");
bAnswer = oEpsonFP.SendCommand();
}
//Add Subtotal
bAnswer = oEpsonFP.AddDataField("\xA\x3");
bAnswer = oEpsonFP.SendCommand();
//Add Payment
bAnswer = oEpsonFP.AddDataField("\xA\x5");
bAnswer = oEpsonFP.AddDataField("\x0\x0");
bAnswer = oEpsonFP.AddDataField("001");
bAnswer = oEpsonFP.AddDataField(billInfo.total);
bAnswer = oEpsonFP.AddDataField("");
bAnswer = oEpsonFP.AddDataField("");
bAnswer = oEpsonFP.AddDataField("");
bAnswer = oEpsonFP.SendCommand();
//Add tip
bAnswer = oEpsonFP.AddDataField("\xA\x13");
bAnswer = oEpsonFP.AddDataField(billInfo.tip);
bAnswer = oEpsonFP.SendCommand();
//Close
bAnswer = oEpsonFP.AddDataField("\xA\x6");
bAnswer = oEpsonFP.AddDataField("\xA\x1");
bAnswer = oEpsonFP.AddDataField("0");
bAnswer = oEpsonFP.AddDataField("");
bAnswer = oEpsonFP.AddDataField("0");
bAnswer = oEpsonFP.AddDataField("");
bAnswer = oEpsonFP.AddDataField("0");
bAnswer = oEpsonFP.AddDataField("");
bAnswer = oEpsonFP.SendCommand();