|
"jacob lalaounis" <lalaounisjacob@gmail.com> wrote in message
news:hc6r8b$qie$1@fred.mathworks.com...
> Hello,
>
> I would like to send data from a serial port to another serial port.
> I would like to check this by sending data and check what i get through
> matlab.
> How is this possible??
Hi Jacob,
The basics are as follows:
s=serial('com1','BaudRate', 9600 );
inspect(s);
fopen(s);
if( s.BytesAvailable > 0 )
data = fread( s, s.BytesAvailable );
end
fwrite(s,'Hello World!');
fclose(s);
delete(s);
clear s;
The following link provides documentation for using serial ports in MATLAB.
http://www.mathworks.com/access/helpdesk/help/techdoc/matlab_external/f38496.html
|