Warning in reading data from serial port.

조회 수: 3 (최근 30일)
Sabarinathan Vadivelu
Sabarinathan Vadivelu 2013년 8월 17일
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일
편집: 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