以编程方式设置条形码扫描仪的前缀/后缀
我想创建一个应用程序,我可以在其中设置要发送到条形码阅读器的前缀或后缀。条形码阅读器可以通过 USB 或 RS-232 端口连接到 PC。我的意思是,如果我有一个像 "4567"
这样的条形码,并且我在应用程序中设置它应该向条形码扫描仪发送像 "123"
这样的前缀,那么如果我将我的条形码 ("4567"
) 读取到文本编辑器中,它应该显示 "1234567"
。
我该怎么做?
更新:
我需要使用Symbol LS2208条码阅读器。使用编程指南,我能够在条形码前放置一个字符,但我需要 4 个(至少)。另一种可能性是在条形码前放置 3 个字符,但我无法使此方法起作用,如果可以,那么我应该以某种方式将第四个数字放在那里。
如果我错了,请纠正我,但不应该有可能以编程方式执行我想要的操作吗?我认为它应该像这样工作:连接到USB/串行端口。捕获用户是否使用条形码阅读器读取了某些内容。捕获后修改它,然后将其放在已读取的位置。
I want to create an application, where I can set, what prefix or suffix i want to send to the Barcode reader. The barcode reader may connect to the PC with USB or RS-232 ports. I mean if I have a barcode like "4567"
, and I set in my application that it should send a prefix like "123"
to the barcode scanner, than if I read my barcode ("4567"
) into a text editor, it should display "1234567"
.
How can I do this?
Update:
I need to use Symbol LS2208 Barcode Reader. Using the programming guide I was able, to put one character before the barcode, but I need 4 (at least). Other possibility is to put 3 charachters before the barcode, but I can't bring this method to work, and if I were able, then I should put the 4th digit there somehow.
Correct me if I'm wrong, but shouldn't be there a possibility to do programmatically what I want? I think it should work like this: connect to the USB/serial port. Capture if the user did read something with the barcode reader. After capturing modifying it, and then put it there where it has been read.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
根据 Symbol LS2208 产品参考指南,它说您最多可以设置四位数字的前缀和后缀。看起来 USB 接口就像键盘输入或串行输入(可配置)。
更新:这四位数字是特殊字符代码。也就是说,四位数字只能得到一个字符。
According to the Symbol LS2208 Product Reference Guide, it says you can set up to four digits for prefix and suffix. It looks like the USB interface just acts like a keyboard input or like a serial input (configurable).
Update: the four digits are a special character code. I.e. you only get one character for the four digits.
这可能无法回答您的问题,但无论如何。
我们使用Symbol条码阅读器(以前是串行,现在是USB转串口转换器)从串行端口读取。我们的代码是用 Java 编写的,并使用 Java 通信 API(读/写串行/并行端口)。然后,我们从串行端口获取输入并将其发送到 Swing 应用程序中具有焦点的窗口。由于应用程序可以访问入站流,因此我们可以根据需要修改该流。
This may not answer your question, but here goes anyways.
We use Symbol barcode readers (Used to be Serial, Now USB to Serial Port converters) reading from the serial port. Our code is written in Java and use the Java Communications API (Reads/Writes Serial/Parallel ports). We then take the input from the Serial Port and send it to the window that has the focus in a Swing Application. Since the application has access to the inbound stream we can modify the stream however we want.