USB转串口(使用spcomm)问题

starwang CSDN会员 starwang 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
使用usb转串口的设备,用spcomm控件直接向串口发送、接收数据。
打开串口时出现错误“File handle is not a comm handle”;
我将spcomm源代码中的以下语句封掉
if GetFileType( hNewCommFile ) <> FILE_TYPE_CHAR then
begin
CloseHandle( hNewCommFile );
raise ECommsError.Create( 'File handle is not a comm handle ' )
end;

此后,startcomm可以通过,使用WriteCommData发送数据也没有报错,但是却无法接收到数据。
请问是什么问题呀!
...全文
评论 15
收藏 已收藏
分享
返回顶部