Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

serial IO functions blocks matlab

Status
Not open for further replies.

mesak82

Electrical
Jun 20, 2005
1
Hi,

I'm using serial functions (fwrite, particularly), but it blocks the matlab sesion. My computer hasn't a built-in serial port, so I use a usb-serial converter. I think that the problem should be there. The same function (fwrite) works properly in a computer with a built-in serial port.

Another problem is the next:

s=serial('COM1');
fopen(s);
for i=1:8
fwrite(s,i,'int8','async'); %ERROR WHEN i=2.
end

Matlab notifies that an error occurs. The error is because there is a write operation in progress. A delay function solves the problem, but it also delays the total time involved in the transmission.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor