串口问题? [英] Serial Port Problem?

查看:97
本文介绍了串口问题?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我必须与施耐德电气的智能继电器沟通。

一切正常,但在某些时候串行通信失败。

即程序挂起。 />
调试时我发现ei 在serial-> Read或serial-> Write,这件事就发生了。



我尝试使用Labview进行相同的通信,但仍遇到同样的问题。



即使我设置了读写超时。这就像在这个随机事件中 - 进入无限超时。



通讯电缆是SR2USB01...... USB转串口转换器

I have To communicate with "Schneider Electric's Smart Relay".
Everything works fine, but randomly at some point serial communication fails.
i.e program hangs.
While debugging i found that either at serial->Read or serial->Write,this thing happens.

I tried the same communication using Labview and still faced the same problem.

Even though I have set read and write timeouts.It's like during this random event -it goes to infinite timeout.

The communication cable is "SR2USB01" ... A USB to serial converter

推荐答案

USB / SERIAL设备上的驱动程序是一个FTDI芯片,驱动程序被窃听,它们因此而臭名昭着。



如果你看看Windows更新,它可能是你没有下载的可选更新或转到USB转换器网站,他们可能有更新的驱动程序转换器。在某些USB转换器驱动程序上,它们也有可以玩的怪异设置。



您可以通过在PC上关闭DTR线来恢复问题一旦你得到超时但你似乎总是丢失字符,所以它没用,除非你有CRC通信协议和阻止发送来修复数据错误。



这个问题驱使我们多年来我们的CNC控制器软件很疯狂,最后我们迁移到以太网端口上的telnet,只是为了摆脱USB到串口转换器的愚蠢问题。
The driver on the USB/SERIAL device is an FTDI chip and the driver is bugged they are notorious for it.

If you look at windows update it's probably an optional update you haven't downloaded or go to the USB converter website they probably have a updated driver for the converter. On some of the USB converter drivers they also have weird setting stuff you can play with.

You can recover the problem by taking the DTR line down and up on the PC once you get the timeout but you always seem to lose characters so it's useless unless you have CRC communication protocol and block sending to fix the data error.

That problem drove us mad on our CNC controller software for years and in the end we migrated to telnet on ethernet port just to get away from the stupid problems of USB to serial converters.


这篇关于串口问题?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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