Serial Port opening problem
Show older comments
I'm trying to acquire values from a microcontroller using the serial port. However, I'm facing a strange bug!
when I try to run the program for the first time it works and when I try to run it again it gives me an error saying that cannot open the port! But if I close matlab and open it again and run the program it works for the first time only and then same problem arises!
Can anyone help me please ?
Thanks in advance
5 Comments
Walter Roberson
on 4 Nov 2019
Are you closing the port after use?
Abdel Rahman Bekawi
on 4 Nov 2019
Ruger28
on 4 Nov 2019
Without seeing your code, it seems like what Walter is getting at is that you are not closing it after you are done, and on the next iteration you are trying to open it up while it is open already. Try closing it when you are done.
Abdel Rahman Bekawi
on 4 Nov 2019
Abdel Rahman Bekawi
on 5 Nov 2019
Accepted Answer
More Answers (0)
Categories
Find more on Serial Port Interface in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!