Hi, I am using serial port communication. I can write and read the data but the warning after "fscanf" keep pop up. Below attached the code. Code:
s=serial('COM6','BaudRate',115200,'Parity','none'...
,'DataBits',8,'FlowControl','none'...
,'Terminator','LF/CR');
fopen(s);
fprintf(s,'t');
out = fscanf(s)Warning: A timeout occurred before the Terminator was reached.
May i know what is the problem?
No products are associated with this question.
If the timeout occurred to early, what about increasing the time?
set(s, 'TimeOut', 100)
? But the default of 10 seconds should be long enough... Perhaps the other parameters are not correct?
Hi, thanks for replied. After i set the time out to 100,and check the terminator, the warning still exist. Does the warning will affect thereceiving data?
The warning might be indicating that you are not getting any data at all.
If you are getting data then the timeout will be slowing down your program a lot.
0 Comments