-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
V0.3.4 | Serial port cannot open #13
Comments
Hello. As I see in Project window you're using Maybe you selected |
Hi Serhii, I am using a lots of serial cables/adapter, and as Windows assign them individually, this one got the com port number 34, Same adapter, using Com34 is working fine with older version as I said. If you think of tests I can do to narrow the area/cause, let me know, and I'll do. |
Its hard to say what is cause of the problem. This error can occur only as result of ...
d->serialPort = CreateFileA(
d->settings.portName.c_str(), // Port name
GENERIC_READ | GENERIC_WRITE, // Read and write access
0, // No sharing
NULL, // No security attributes
OPEN_EXISTING, // Opens existing port
0, // Disables overlapped I/O
NULL // No template file
);
if (d->serialPortIsInvalid())
{
return d->setError(Status_BadSerialOpen, StringLiteral("Failed to open serial port. Error code: ") + toModbusString(GetLastError()));
}
... It might have something to do with the input parameters of the function. |
Hello. Please try new v0.3.5 version. Lets see what it would be. |
Hi @serhmarch , Server still cannot open the port I'll try to test more later. |
Hello. This behavior is also possible if the string I realize that in this case it is unlikely, I just left it here as an option. Then please specify the version of the operating system and hardware. When I'll have time, I will try to run it on different machines, maybe I can get the same result. |
Hi @serhmarch , I'm running the application on Win 11 Pro (23H2) |
When using either server or client, with version 0.3.4,
I have an error: 'Device 1': Failed to open serial port. Error code: 2
Tried with different adapter and port, and also running as admin, but could not get it to work
If I do the same with version 0.1.5, all is working great.
Likely the new Modbus library have issue ?, as explain here: #10 (comment)
The text was updated successfully, but these errors were encountered: