POS探险未发现在C#连接到系统的任何设备 [英] pos explorer is not finding any device connected to the system in C#

查看:247
本文介绍了POS探险未发现在C#连接到系统的任何设备的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的系统,您好我已经安装了星TSP100刀(TSP143)打印机驱动程序和测试打印机,其打印一切。但现在我想通过处理在C#代码,如剪纸,打开打印机,打印正常等打印机..我用下面的代码来实例化打印机。当我查询打印机返回null。



任何建议或帮助,如果我错了我要去。
谢谢



 公共静态DeviceCollection GetPrinters()
{
PosExplorer探险=新PosExplorer( );
返回explorer.GetDevices(DeviceType.PosPrinter,DeviceCompatibilities.OposAndCompatibilityLevel1);
}

公共静态DeviceInfo GETPRINTER(字符串名称)
{
如果(String.IsNullOrEmpty(名))
返回NULL;

PosExplorer探险=新PosExplorer();
返回explorer.GetDevice(DeviceType.PosPrinter,名);
}
PosExplorer探险= NULL;
DeviceInfo设备= NULL;
PosPrinter打印机= NULL;
DeviceCollection打印机= GetPrinters();

DeviceInfo printers2 = GETPRINTER(星TSP100刀(TSP143));


解决方案

这听起来像正在发送的不正确的命令。该TSP100不同于打印机的明星的阵容休息。它需要接收光栅指令。该其他打印机默认会接受行模式



在这里引用它们的编程手册:的 http://www.starmicronics.com/support/Mannualfolder/linemode_cm_en.pdf



第87页:展会你如何初始化光栅模式



第90页:钱箱



页92:进料/剪切


Hi I have installed Star TSP100 Cutter (TSP143) printer driver in my system and tested the printer, Its printing everything. But Now i want to handle the printer through code in c# such as cut paper, Open Printer, Print normal etc.. I have used the below code to instantiate the printer. When i query for the printer it returns null.

Any suggestions or help if i am going in wrong way. Thanks

public static DeviceCollection GetPrinters()
    {
        PosExplorer explorer = new PosExplorer();
        return explorer.GetDevices(DeviceType.PosPrinter, DeviceCompatibilities.OposAndCompatibilityLevel1);
    }

    public static DeviceInfo GetPrinter(string name)
    {
        if (String.IsNullOrEmpty(name))
            return null;

        PosExplorer explorer = new PosExplorer();
        return explorer.GetDevice(DeviceType.PosPrinter, name);
    }
PosExplorer explorer = null;
                DeviceInfo device = null;
                PosPrinter printer = null;
                DeviceCollection printers = GetPrinters();

                DeviceInfo printers2 = GetPrinter("Star TSP100 Cutter (TSP143)");

解决方案

It sounds like the incorrect command is being sent. The TSP100 differs from the rest of the printers in Star's line up. It needs to receive raster commands. The other printers generally accept line mode by default.

Reference their programming manual here: http://www.starmicronics.com/support/Mannualfolder/linemode_cm_en.pdf

Page 87: Shows you how to initialize raster mode

Page 90: Cash Drawer

Page 92: Feed/Cut

这篇关于POS探险未发现在C#连接到系统的任何设备的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆