Hi guys
I was wondering, how do I make Matlab stop reading from a serialport ?
I have this:
s = serial('COM2');
set(s,'BaudRate',9600);
set(s,'DataBits',8);
set(s,'StopBits',1);
fopen(s);
av = fscanf(s);
And I get the data I want, I just want Matlab to stop reading from the port when the data has been sent, cause I'll be sending the data again after that, so how would I do that?
In other words, how do I tell Matlab to stop/start reading when a certain char has been sent? I see when I enable the serial communication taht "Terminator is 'LF'" .. so should I send 'LF' from the MC to let matlab stop ?
Help plz
I was wondering, how do I make Matlab stop reading from a serialport ?
I have this:
s = serial('COM2');
set(s,'BaudRate',9600);
set(s,'DataBits',8);
set(s,'StopBits',1);
fopen(s);
av = fscanf(s);
And I get the data I want, I just want Matlab to stop reading from the port when the data has been sent, cause I'll be sending the data again after that, so how would I do that?
In other words, how do I tell Matlab to stop/start reading when a certain char has been sent? I see when I enable the serial communication taht "Terminator is 'LF'" .. so should I send 'LF' from the MC to let matlab stop ?
Help plz