fscanf warning message
2 次查看(过去 30 天)
显示 更早的评论
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?
2 个评论
Abhirama B A
2019-7-16
I am also having the same problem even after using the code
set(s, 'TimeOut', 100)
can you help to get rid of this?
Walter Roberson
2019-7-16
Check the baud rate you are configuring.
Check that the terminator matches.
Use a program such as TeraTerm to verify that you are able to receive data from the port.
采纳的回答
Jan
2012-6-22
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?
5 个评论
wenshuo dong
2018-8-1
Can you tell me what is the problem? how can I figure it out? I meet the same issue as yours. Thanks!
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Low-Level File I/O 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!