Jump to content
Sign in to follow this  

Help!-cann't open serial port larger than 9 (COM10) by using _CommAPI_OpenCOMPort()

Recommended Posts


i cann't open COM10(also serial port number large than 9) by calling _CommAPI_OpenCOMPort() . 

My problem is:

I have two PCs. The two PCs are installed with windows 7/64bit. In one PC there is one physical COM1, i have changed the physical COM1 to the number COM10(or COM11...) in device manager in windows controll,  the COM10 is opened by calling _CommAPI_OpenCOMPort()(the function from https://www.autoitscript.com/wiki/CommAPI), no problem. But in the other PC no physical COM1 is installed, then i must use an USB-Serial Port-Adapter(LogiLink). I have used _CommAPIGetCOMports() to get the COMPorts list, also the USB-Serial Port-Adapter hat got the number COM10, then i have called _CommAPI_OpenCOMPort() to open COM10, it didn't worked. i have get the handle of the _WINAPI_CreateFile() = 0 with sometime Error Message =2 or sometime Error Message = 0(wenn calling _WINAPI_GetLastError()). But i can open the USB-Serail Port-Adapter with HTerm.exe program. HTerm connects COM10. Why is it? Please help me.

Best regards

#include "CommInterface.au3"

#AutoIt3Wrapper_Au3Check_Parameters=-q -d -w 1 -w 2 -w 3 -w- 4 -w 5 -w 6 -w- 7
local $iPort = "COM10"
local $comPort = _CommAPI_OpenCOMPort($iPort, "19200", "0", "8", "0")
MsgBox(0, "comport-handle", $comPort)
Edited by cuboro

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...