串口总是报'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 ...
随机推荐
- 云主机-vps购买
Linode VPS主机 http://jingyan.baidu.com/article/676629972be5e054d41b846c.html Linode VPS可以说是世界上最好的VPS, ...
- linux服务之upstart与systemd
http://blog.fens.me/linux-upstart/ rpm -ql initscripts|more [root@84-monitor init]# rpm -qf /etc/ini ...
- linux包之sysstat之mpstat与pidstat命令
概述 [root@localhost ~]# rpm -qa|grep sysstsysstat-9.0.4-22.el6.x86_64mpstat是MultiProcessor Statistics ...
- unity, GL.TexCoord or GL.Color must put before GL.Vertex!!!
GL.Begin(GL.QUADS); //in unity, should use left hand rule //RU GL.TexCo ...
- javascript中href和replace比较
在使用javascript的时候,有时候对于经常使用的方法太熟悉而忽略了他们之间原理的细微差别.举例如下:window.location.href,window.location.replace. ...
- gcc、g++
http://hi.baidu.com/zhangcunli8499/item/257e187360b48b2bd6a89cc6 g++ src/*.cpp -I include/ -I includ ...
- 查看.Net Framework版本的方法
乐博网最新补充(乐博网一步步教你如何最快查看本机.net framework的版本): 方法一: 第一步: 打开“我的电脑“,在地址栏输入 %systemroot%\Microsoft.NET\Fr ...
- input 字符限制
1,文本框只能输入数字代码(小数点也不能输入): onkeyup="this.value=this.value.replace(/\D/g,'')" onafterpaste=&q ...
- ios外包公司—北京动点软件分享:IOS工程自动打包并发布脚本实现
前言 IOS的开发过程中,当需要给测试人员发布测试包的时候,直接使用xcode来做的效率是非常低下的.尤其是当有一点小改动需要重新出包时,那简直是个折磨的人的工作.通过一番研究后,遂决定写一系列脚本, ...
- 剑指offer系列61---数组中的逆序对
[题目]在数组中的两个数字,如果前面一个数字大于后面的数字,则这两个数字组成一个逆序对.输入一个数组,求出这个数组中的逆序对的总数. * [思路]运用归并排序的思想. * 首先将数组分成两个子数组,统 ...