modbus icon indicating copy to clipboard operation
modbus copied to clipboard

Error: "System cannot find the file specified." opening port when port number is high ex: "COM15"

Open Edgar242 opened this issue 5 years ago • 10 comments

I have windows 10 and when I try to open serial port "COM15" I got: "System cannot find the file specified."

the issue is solved if I manually changed it to another closer port to COM1 for example: "COM2"

Edgar242 avatar Jun 06 '19 21:06 Edgar242

Problem is solved here:

https://github.com/goburrow/serial/pull/13

Edgar242 avatar Jun 14 '19 22:06 Edgar242

Hello, Problem is not solved. I use com10 and i recieved - COM10 - The system cannot find the file specified. I need your help

alikxus avatar Nov 15 '19 15:11 alikxus

Hello, Problem is not solved. I use com10 and i recieved - COM10 - The system cannot find the file specified. I need your help

Check this pull request, it has the changes needed https://github.com/goburrow/serial/pull/13

Edgar242 avatar Nov 15 '19 15:11 Edgar242

Hello, Problem is not solved. I use com10 and i recieved - COM10 - The system cannot find the file specified. I need your help

Check this pull request, it has the changes needed goburrow/serial#13

Do I understand correctly? i need use this string, for example: handler := modbus.NewRTUClientHandler("\\.\com10")

alikxus avatar Nov 18 '19 11:11 alikxus

Hello, Problem is not solved. I use com10 and i recieved - COM10 - The system cannot find the file specified. I need your help

Check this pull request, it has the changes needed goburrow/serial#13

Do I understand correctly? i need use this string, for example: handler := modbus.NewRTUClientHandler("\.\com10")

Yes, I think name must be in uppercase: "\\.\COM10" Can you try please?

Edgar242 avatar Nov 18 '19 21:11 Edgar242

thank you, editor deleted first 2 back slaches image this way work for me. and it work without uppercas

alikxus avatar Nov 19 '19 12:11 alikxus

thank you, editor deleted first 2 back slaches image this way work for me. and it work without uppercas

Great, nice to know!

Edgar242 avatar Nov 19 '19 12:11 Edgar242

i am using windows 7, if i use the above mentioned method i am getting same error.

CreateFile("\\.\COM2", GENERIC_READ | GENERIC_WRITE, 0, NULL, OPEN_EXISTING,0, NULL);

can anyone help me on this ?

Tamilselvan-sakthivel avatar Oct 25 '23 13:10 Tamilselvan-sakthivel

CreateFile("\.\COM2", GENERIC_READ | GENERIC_WRITE, 0, NULL, OPEN_EXISTING,0, NULL);

You should do it on this way: CreateFile("\\\\.\\COM2", GENERIC_READ | GENERIC_WRITE, 0, NULL, OPEN_EXISTING,0, NULL);

Edgar242 avatar Oct 25 '23 14:10 Edgar242

tried that too, but still same

Tamilselvan-sakthivel avatar Oct 25 '23 14:10 Tamilselvan-sakthivel