如何通过 USB 查询 Zebra 打印机磁卡读卡器
我想编写一个简单的 C# 应用程序来收集 Zebra 打印机磁卡读卡器的输出。 (型号 RW420)我的设备唯一接口是 USB。 CPCL 语言为此指定了一个 MCR
命令,但我不知道如何通过 .NET 向打印机发出此命令。在线文档和支持人员都无法告诉我。有人有想法吗?
I'd like to write a simple C# app to collect the output of a Zebra printer's magnetic card reader. (Model RW420) My only interface to the device is USB. The CPCL language specifies an MCR
command for this purpose, but I cannot figure out how to issue this command to the printer via .NET. Neither the online documentation nor support staff can tell me. Does anyone have an idea?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您需要编写本机代码才能从 USB 读回(使用 pInvoke)。您需要找到其中包含 Zebra 供应商 ID 的 USB 设备路径。您可以将此设备路径传递给 CreateFile
请参阅:MSDN 创建文件
You need to write native code in order to read back from USB (using pInvoke). You need to find the usb device path with Zebra's vendor ID in it. You would pass this device path to CreateFile
see: MSDN Create File
请注意,RW420 手册(第 29 页)指出:
我们这里有联网的 Zebra 打印机,所以我最好的猜测是,如果您可以按照您想要的方式通过 USB 进行通信,那么将会有一个串行(或并行)端口可供与 Zebra 的 USB 驱动程序进行通信。首先查看 Windows 中的设备管理器。如果是这种情况,您应该能够与打印机进行标准串行通信,并按照 CPCL 手册查询磁条阅读器(请参阅 CPCL 手册第 10-23 页)
Please note that the RW420 manual (page 29) states:
We have networked Zebra printers here, so my best guess is that if you can communicate over USB, in the way you intend, there will be a serial (or parallel) port exposed to talk to given by Zebra's USB driver. Start by looking in the Device Manager in Windows. If this is the case, you should be able to do standard serial communications to the printer, and follow the CPCL manual for querying the magstripe reader (see page 10-23 of the CPCL manual)