Python条码扫描器串行触发器 [英] Python barcode scanner serial trigger

查看:189
本文介绍了Python条码扫描器串行触发器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在用配置为串行设备的python霍尼韦尔4600条码扫描器弄乱.一切都很好,我可以用它读取条形码,但是我想测试串行触发器选项,而不是一直按触发器. 手册中对此功能非常简短,仅需在设备上写入"SYN T CR"即可激活串行触发器

I'm messing around with a Honeywell 4600 barcode scanner in python, configured as a serial device. All is well and I can read barcodes with it, but I would like to test the serial trigger option instead of pressing the trigger all the time. The manual is very brief on this feature and only states "SYN T CR" has to be written to the device to activate the serial trigger

ser.write('SYN T CR')

似乎没什么作用.

有人可以指出我正确的方向吗?谢谢!

Can someone point me in the right direction? Thank you!

推荐答案

之所以会发生这种情况,是因为您将写在文档中的抽象表达式编码为原始输出数据.

This happens because you coded the abstract expression written in the document as raw output data.

文档代表3个字节的数据传输.

The document represents 3 bytes of data transmission.

'SYN'和'CR'是以下十六进制数字.
'SYN'= \ x16
'CR'= \ x0d或转义序列\ r

'SYN' and 'CR' are the following hexadecimal numbers.
'SYN' = \x16
'CR' = \x0d or escape sequence \r

'T'是普通的ASCII字符.
空格用于分隔文档中的数据,而不是要发送的数据.

'T' is an ordinary ASCII character.
Whitespace is used to separate the data in the document, not data to send.

您应该这样写.请尝试.

You should write like this. Please try it.

ser.write(b'\x16T\r')

或者,也许甚至可能需要给它加上前缀.
将数据发送到霍尼韦尔通过虚拟com端口的Xenon 1902条码读取器

Alternatively, perhaps even you may need to prefix it.
Send data to Honeywell Xenon 1902 barcode reader via virtual com port

在这种情况下,请尝试以下传输方式.

In that case, please try the following transmission.

ser.write(b'\x16M\r\x16T\r')

这篇关于Python条码扫描器串行触发器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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