简体   繁体   English

USB串行通信提供奇怪的输出

[英]USB-Serial communication giving strange output

I'm trying to get data from a mercury analyzer (Seefelder-Messtechnik Hg Analyzer 3000) that gives output to a 9-pin R232 serial port to my OSX 10.10 laptop. 我正在尝试从汞分析仪(Seefelder-Messtechnik汞分析仪3000)获取数据,该数据将输出提供给OSX 10.10笔记本电脑的9针R232串行端口。

I've followed the steps described here to install the PL-2303 driver: http://pbxbook.com/other/mac-tty.html 我已按照此处描述的步骤安装PL-2303驱动程序: http : //pbxbook.com/other/mac-tty.html

The device manual ( http://www.seefelder-messtechnik.com/V71-3-02-21e.pdf ) lists the communication protocol as "9600 Baud, 8 data bit, 1 stop bit, no log, no parities". 设备手册( http://www.seefelder-messtechnik.com/V71-3-02-21e.pdf )列出的通信协议为“ 9600波特,8个数据位,1个停止位,无日志,无奇偶校验”。

I attempt to read from the device by using the 'screen' command: 我尝试使用“屏幕”命令从设备读取:

screen /dev/tty.usbserial 9600

The result is a string of seemingly non-sensical characters that print to the screen in a regular interval: 结果是一串看似无意义的字符,它们以规则的时间间隔打印到屏幕上:

8b4 b 8b48bs 8G 8b 8 8 8 < 8 8 b KW \\b 8b b b b KW K 8b \\G < 8 8b " ΁ [؁ ؉ bG 3 ˁ G \\K [W pb 8 ΁8ʱ \\pa ʁ ct 8 h¡ 38b 8 q ؁ \\ 8 bS 8b8 8 q X 8 < £8 2 8 ؖ ؖ ؖ 8bS \\ ܉ ؖ [S 8 s fq 8 8fq S ܊ b b ؉ \\ S K ݎ S b b S S \\ KS S ؊ \\S 1S \\b S ؉ \\ ذ KS \\ S  bS ؉ 1S ؊ [؂ ز ؉\\ ؂ ز \\ i $\\ $ \\ 8 $ \\ \\ 8b4 b 8b48bs 8G 8b 8 8 8 <8 8 b KW \\b 8b b b b KW K 8b \\G < 8b " ΁ [؁ ؉ bG。 3 G \\K [W pb 8 ΁8ʱ \\ ct 8 h¡ 38b 8 q ؁ \\ 8 bS 8b8 8 q X 8 < £8 2 8 ؖ ؖ ؖ 8bS \\ ܉ ؖ [S 8 s fq 8 8fq ܊ b b。 ؉\\ SKݎSbbSS \\ KSS؊ \\ S1S \\将bS؉\\ذKS \\SbS؉1个S؊[؂ ز؉\\؂ز\\ I $ \\ $ \\ $ 8 \\\\ ܂ زXk B 7 \\k \\X < 8Xkz Yj L H \\ ]j ،k: Yj ؈ ܂زXkB7 \\ķ\\ X <8XkzYjLH \\] J,K: YJ؈

I've also tried using 'minicom' rather than screen, and get a different ("?]???ܰ??Yk??2"), but also non-sensical result. 我也尝试过使用'minicom'而不是屏幕,并得到了不同的结果(“?] ???ܰ?? Yk ?? 2”),但也没有意义。 I saw that there was another SO query similar to mine that remains unsolved: weird characters displayed during serial communication OSX 我看到还有另一个类似于我的SO查询仍未解决: 串行通信OSX期间显示的奇怪字符

Any tips? 有小费吗? It looks to me that I'm not interpreting the output correctly, but I don't know what to try next. 在我看来,我没有正确解释输出,但是我不知道下一步该怎么做。

The solution was to read from the machine at a higher baud rate (~57600), despite what the manual and online reference said. 解决方案是从机器上以更高的波特率(〜57600)进行读取,尽管手册和在线参考资料中有说明。 Reading at 57600 baud made the result plain-text and usable. 以57600波特读取时,结果纯文本且可用。 Thanks for your ideas! 感谢您的想法!

I've followed the steps described here to install the PL-2303 driver 我已按照此处描述的步骤安装PL-2303驱动程序

I've also had occasional electrical ground problems with Prolific USB-RS232 adapters. Prolific USB-RS232适配器偶尔也会出现电气接地问题。 Problem would manifest as garbled data that looked similar to a baud rate issue or what you posted. 问题将表现为看起来像波特率问题或发布内容的乱码数据。

You can check if it's a ground issue by measuring for continuity between the ground pin (pin #5) on the DE-9 (aka DB-9) side of the Prolific adapter and the ground pin of the USB side (pin #4, "far left", of the A connector). 您可以通过测量Prolific适配器的DE-9(又称DB-9)侧的接地引脚(#5)和USB侧的接地引脚(#4, A连接器的“最左侧”)。 You'll probably measure infinite resistance with a multimeter. 您可能会用万用表测量无限电阻。 Try the same with a FTDI USB-RS232 adapter, and instead I get a dead short between the ground pins as expected. 使用FTDI USB-RS232适配器尝试相同的操作,相反,接地引脚之间的短路完全达到了预期。

Be sure to plug the instrument's and PC's power supplies into the same power strip. 确保将仪器和PC的电源插入同一电源板。
As a last resort try grounding the instrument's chassis/case with the PC using copper wire 作为最后的方法,请尝试使用铜线将仪器的机箱/机箱与PC接地。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM