使用USB到串行转换器的串行通信 [英] Serial communication using USB to serial converter

查看:140
本文介绍了使用USB到串行转换器的串行通信的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我们的一个应用程序中,我们为用户提供了一种通过串行端口传输文件的功能.
当我们使用RS232到RS232连接时,一切都正常工作
但是,当我们使用USB到RS232转换器进行操作时,我们会观察到以下内容
1.操作中的重试次数变高
2.波特率较高时,数据传输时间不变.
我们是否需要做出任何特殊规定来处理此问题

In one of our applications we provide a facility to user to transfer a file via serial port.
Every thing works fine when we use a RS232 to RS232 connection
But when we carry out the operation using a USB to RS232 converter, we observe the following
1. Number of retries in the operation become high
2. At higher baud rates there is no change in the time taken for data transfer
Is there any special provision we need to make to handle this issue

推荐答案

我经常使用外部USB到RS232转换器来控制具有RS232连接的产品,所以我没有. t注意到任何问题.我使用与通过RS232直接连接时相同的通讯例程(使用WriteFile和ReadFile).我使用固定速率无法对波特率发表评论,但我没有发现重试的任何问题.

我已将通讯设置为1个停止位,没有流量控制,没有重叠*波特38400.这些是我使用的超时设置:-
I often use an External USB to RS232 Converter to control products with RS232 connections and I haven''t noticed any problems. I use the same comms routines (using WriteFile and ReadFile) as when it is connected via RS232 directly. I can''t comment on the baud rate as I use a fixed rate but I have not noticed any problems with retries.

I have the comms set to 1 stop bit, no flow control, not overlapped * baud 38400. These are the timeout settings that I use:-
CommTimeOuts.ReadIntervalTimeout=50;
CommTimeOuts.ReadTotalTimeoutMultiplier=1;
CommTimeOuts.ReadTotalTimeoutConstant=50;
CommTimeOuts.WriteTotalTimeoutMultiplier=1;
CommTimeOuts.WriteTotalTimeoutConstant=1;



希望能有所帮助:)



Hope that helps :)


这篇关于使用USB到串行转换器的串行通信的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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