串口总是报'Error opening serial port'
Comm1.CommName := '//./' + Trim(combx_Port.Text);
目前串口大于20 用上面方法解决的
网上也有上面方法解决如下错误的。
若是您已会应用SPCOMM且涌现10个以上的串心题目 请改一下串心名 COM1.CommName='//./com18'; 便如许减'//./'就好了我也没有晓得甚么回事....... 比方 Comm1.CommName := '//./'+ComboBox1.Text; //./com18是win]
如果你已经会使用SPCOMM且出现10个以上的串口问题
请改一下串口名
COM1.CommName='//./com18';
就这样 加'//./'就行了我也不知道什么回事.......
比如
Comm1.CommName := '//./'+ComboBox1.Text;
//./com18是windows里边的SymbolLinkName,这个在WINAPI里边就需要这 样写,SPCOMM的这部分的源代码如下:
procedure TComm.StartComm;
var
hNewCommFile: THandle;
begin
// Are we already doing comm?
if (hCommFile <> 0) then
raise ECommsError.Create( 'This serial port already opened' );
hNewCommFile := CreateFile( PChar(FCommName), & lt;------就是这里,要加上//./
GENERIC_READ or GENERIC_WRITE,
0, {not shared}
nil, {no security ??}
OPEN_EXISTING,
FILE_ATTRIBUTE_NORMAL or FILE_FLAG_OVERLAPPED,
0 {template} );
if hNewCommFile = INVALID_HANDLE_VALUE then
raise ECommsError.Create( 'Error opening serial port' );
^^^^^^^^^^^^^^^^^^^^^^^^^^^如果不是 SymbolLinkName写法,串口号大于9这里就出错了
串口总是报'Error opening serial port'的更多相关文章
- 安装aptana插件报Error opening the editor. java.lang.NullPointerException
Aptana的官方网站下载eclipse的插件: http://update.aptana.com/update/studio/3.2/ ,可以在线安装也可以下载插件后再安装,我是以在线的形式安装的 ...
- Serial Port Programming using Win32 API(转载)
In this tutorial we will learn How to communicate with an external device like a microcontroller boa ...
- 【Flink】flink执行jar报错:java.io.IOException: Error opening the Input Split file 或者 java.io.FileNotFoundException
报错内容 flink执行jar时,报如下错误: org.apache.flink.client.program.ProgramInvocationException: Job failed. (Job ...
- 串口数据监视 Serial Port Monitor
串口数据监视工具 Serial Port Monitor可以在其它应用读写串口时监视串口数据, 很好用,但只有15天试用期.
- 安卓开发error opening trace file: No such file or directory (2)报错原因
error opening trace file: No such file or directory (2) 这个问题的出现是因为运行的测试机android系统版本和项目api不一致导致. 改成一样 ...
- Serial Port Programming on Linux(转载)
This is a tutorial on how to program the Serial Ports on your Linux box.Serial Ports are nice little ...
- Non-standard serial port baud rate setting
////combuad_recv.cpp #include <stdio.h> /*标准输入输出定义*/ #include <stdlib.h> /*标准函数库定义*/ #in ...
- 编写ros串口节点,使用官方serial包
参考http://www.roswiki.com/read.php?tid=557&fid=39 1.通过sudo apt-get install ros-<distro>-ser ...
- [转]How Can I Find Out What Is Using a Busy or Reserved Serial Port?
转自:http://digital.ni.com/public.nsf/allkb/29B079481C5ECE76862578810082394E How Can I Find Out What I ...
随机推荐
- Web前端开发笔试&面试_03
WL: 1.如何显示.隐藏一个dom对象? 2.如何将一个网页中的内容水平置中?写出重要的html标签和css. (css:#content{align:center;float:left;}html ...
- 虚拟化之vmware DirectPath I/O
首先Intel这边,必须CPU支持VT-D,基本就是i5/i7的型号,而且部分i5中低端型号还不支持,带K的不支持.同时主板要开启VT-D支持,这些从775时代开始就有了,所以型号搭配复杂.AMD那边 ...
- ManifoldJS
微软推出开源工具ManifoldJS,可以自动将Web App转换成各种平台的App(安卓.iOS.Chrome OS.Windows). ManifoldJS通过获取网站meta-data信息,即可 ...
- 使用druid连接池的超时回收机制排查连接泄露问题
在工程中使用了druid连接池,运行一段时间后系统出现异常: Caused by: org.springframework.jdbc.CannotGetJdbcConnectionException: ...
- 【性能诊断】六、并发场景的性能分析(windbg案例,大量的内部异常造成CPU飙升)
在做产品的某个核心模块的性能优化时,发现压到100并发时应用服务器的CPU就飙升至90%以上,50并发以后TPS就基本定格在一个数值上.使用性能监视器收集应用服务器的数据,发现每秒的.NET CLR ...
- 数字根(digital root)
来源:LeetCode 258 Add Dights Question:Given a non-negative integer num , repeatedly add all its digi ...
- smarty函数-继承extents
继承<{extends}> {extends}标签用在模版中的第一行: 如果子模板用{extends}标签继承父模板,那么它只能包含{block}标签(内容),其它任何模板内容都将忽略: ...
- [转].net 使用NPOI或MyXls把DataTable导出到Excel
本文转自:http://www.cnblogs.com/yongfa365/archive/2010/05/10/NPOI-MyXls-DataTable-To-Excel-From-Excel.ht ...
- Python builtins
>>> dir (__builtins__) ['ArithmeticError', 'AssertionError', 'AttributeError', 'BaseExcepti ...
- Configure Puppet Master with Passenger and Apache on Centos
What is Passenger? Passenger (AKA mod_rails or mod_rack) is an Apache 2.x module which lets you run ...