Mysterious serial port error message



I'm trying to write ASCII text to a serial port by MatLab.
I'm writing text to COM8, which is virtually connected to
COM9 by a virtual communications port emulator, MixW serial
port adaptor. I'm monitoring COM9 by hyperterminal. The code
I'm using is:

instrreset; %Disconnect and delete all instrument objects.
s = serial('COM8');
set(s, 'BaudRate', 4800); %NMEA packet
fopen(s)
fprintf(s, 'ASCII text\n');
fclose(s);
delete(s)
clear s

When I execute the code, I do transmit the text to COM8, and
I do see the text on COM9 by hyperterminal, but I do get the
error message:

"??? Error using ==> serial.fprintf
An error occurred during writing.

Error in ==> Nav at 105
fprintf(s, 'ASCII text\n');"

The program can't be run again, and MatLab will not respond;
in fact, I must close MatLab by the Windows task monitor.

My question is, what does the error message mean, and why
would the device write command work in spite of this error?
Also, could I place an error trap that merely side-steps the
error, so that the program can properly close the port, such
as a try/catch trap?

Thanks


.



Relevant Pages

  • Need help with VSFTP server
    ... password authentication takes a long time) but not from an FTP GUI ... Are there some additional ports that I need to port forward? ... # Uncomment this to allow the anonymous FTP user to upload files. ... # By default the server will pretend to allow ASCII mode but in fact ...
    (comp.os.linux.networking)
  • Re: Using Serial Port with Mac OS X
    ... but in Matlab get the following error: ... Communication Settings ... Communication State ... Cannot connect to the /dev/tty.usbserial-PXQB9AXB port. ...
    (comp.soft-sys.matlab)
  • MATLAB serial port interface maximum speed
    ... PC through an USB port, using a Virtual Serial Port driver so MATLAB ... while bytecount < 524588 ...
    (comp.soft-sys.matlab)
  • Using Serial Port with Mac OS X
    ... port devices using MATLAB 2007b on ... Mac OS X, even though it is not officially supported. ... Install the rxtx code, ...
    (comp.soft-sys.matlab)
  • Re: Using Serial Port with Mac OS X
    ... port devices using MATLAB 2007b on ... Mac OS X, even though it is not officially supported. ... Install the rxtx code, ...
    (comp.soft-sys.matlab)