Warning in reading data from serial port.

1 次查看(过去 30 天)
I'm trying to read a single character 'A' from serial port, But it is issuing a warning always.
CharVar = fscanf(SerialObj,'%c',1);
Warning: Unsuccessful read: A timeout occurred before the Terminator was reached or SIZE values were available.

回答(1 个)

Jan
Jan 2013-8-17
The message seems to tell you, that Matlab did not receive a character and/or the corresponding terminator before the timeout occurred. So it might be useful to show us the command used for opening the port (especially the timeout value) and explain, if you are sure, that the character has been sent in the required period of time.
  3 个评论
Sabarinathan Vadivelu
编辑:Sabarinathan Vadivelu 2013-8-19
This is my code. In this part,
CharVar = fscanf(SerialObj,'%c',1);
The warning was issued. But I receive the character in MATLAB. The main Problem is the delay.
Jan
Jan 2013-8-25
What about increasing the value of the TimeOut?

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Startup and Shutdown 的更多信息

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by