usage of serial port in matlab

Status
Not open for further replies.

mf1364

Full Member level 3
Joined
Dec 4, 2007
Messages
185
Helped
2
Reputation
4
Reaction score
2
Trophy points
1,298
Activity points
2,700
serial port in matlab

Hi every body
I run this codes in matlab :
s = serial('COM1');
fopen(s)
fwrite(1)
fclose(s)
but i received this error??? Error using ==> serial.fopen
Port: COM1 is not available. No ports are available.
Use INSTRFIND to determine if other instrument
objects are connected to the requested device).
according this error i used 'instrfind'and i understood that status of com1 is closed.
and now i want to open this port
do you know what should i have down?
 

serial port in matlab

There are two possible reasons:

First, COM1 is used by some other software or hardware (possibly as windows background services) while you're running MATLAB.

Second, COM1 is unavailable! Find out which COM port is active from Device Manager in windows.

Hope this helps
 

Re: serial port in matlab

I find out that com1 is active from
Device Dananger in windows.

I dont use any sotware except matlab
and you know, Is it reasonable? that I
allways have voltage between 3&5(pins)
of serial port as soon as I turn on my PC.
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…