-
Notifications
You must be signed in to change notification settings - Fork 31
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
Serial communication result depends on COM ports #349
Comments
Citing this Stack Overflow post:
Instead of |
Nice suggestion. |
I made further tests. Using the recommendation from @tbeu , I don't have the error message anymore, but I don't receive the numbers. Plots with COM6 sending and COM7 receiving: Plots with COM6 sending and COM9 (\\.\COM9) receiving: So, the issue should be a different one. Note that I found the issue from COM equal to eight and above, not above 9 as in the stack overflow post mentioned by @tbeu . |
Hm, no idea why this is like that. You could give the C test program test_MDDSerialPort.c a try and set the COM ports there directly (requires to generate the VS project for the external C sources). My (very small) hope is, that this might give some warnings/errors which can be interpreted. |
I found a good workaround on this issue. |
Okay, thanks for sharing the workaround. |
I have a simple model that uses serial communication.
To perform this communication I use two different ports. In reality, I use a USB cable emulating via hardware a serial board.
So the COM ports I see in my Device Manager depend on where (which USB port) I connect the cable.
In one case I have COM4 and COM 7. In another COM9 and COM10.
In both cases I can exchange characters from a port to another using a terminal application (I tried with RealTerm).
Consider the mo file, which below.
When I use it when the PC has as Com ports COM4 and COM7, the communication is correct. When I use it when the ports are COM9 and COM10 the simulation fails.
In particular:
with Dymola 2020x, I get the following message:
MDDSerialPort.h: CreateFileA of serial port COM10 failed with error code: 2
with OpenModelica I get the following message
Maybe there is just a trivial error when COM with large numbers are involved? (maybe when they have more than one digit?)
Thank you.
Here's the model (change "txt" into "mo" before using):
IntegerSendReceive.txt
EDIT
After further checks, it seems to me that coms 1 to 7 are working from 8 onwards cause an error message.
The text was updated successfully, but these errors were encountered: