error when I try to fopen my COM1 port

1 view (last 30 days)
Gilad Jacobson
Gilad Jacobson on 4 Apr 2013
Dear all,
I'm encountering problems with serial port in Matlab.
My code:
hSerial = serial('com1');
hSerial.Terminator = 'CR';
fopen(hSerial)
OCCASIONALLY, I get the following error:
=========
Error using serial/fopen
Open failed: Cannot connect to the COM1 port. Possible reasons are another
application is connected to the port or the port does not exist.
=========
Once this error appears, nothing helps, not even restarting Matlab, only rebooting the computer. I tried
delete(instrfindall)
which was no help.
To the best of my knowledge, no other instrument is communicating with the COM1 port.
Some facts about my setup:
  • Windows 7 64-bit running on a Dell T3500 computer
  • Matlab 2012b
  • Serial port connected in series to several controllers (pumps, valve actuators...)
Many thanks!
Gilad Jacobson

Answers (0)

Categories

Find more on Dates and Time 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!