필터 지우기
필터 지우기

'terminator ' 'LF'

조회 수: 14 (최근 30일)
Nikolaos
Nikolaos 2012년 6월 25일
Hello Matlab community !
I would like your help with this line
% Create object series
s1 = serial ( 'COM9' , 'BaudRate' , 9600, 'terminator' , 'LF' );
That means that , COM 9 opens , the baudrate (bits per second ) is 9600 but what about the terminator LF ? How can I use it to terminate my program ?
When i run my program i recieve this :
"Warning: A timeout occurred before the Terminator was reached."
In a few words i would like to know which is the use of that Terminator (LF).
Thanks a lot in advance ,
Nick K.

답변 (1개)

Matt Kindig
Matt Kindig 2012년 6월 25일
The 'terminator' character is an ASCII character (in this case, ASCII char 10) that MATLAB looks for from the serial port to indicate that transmission ended. Based on your error, it appears that LF is not the correct terminator for your serial device. I might try 'CR', the other typical terminate character, or consult the documentation from your particular hardware device.
  댓글 수: 1
Walter Roberson
Walter Roberson 2012년 6월 25일
Note: not the entire transmission, just that particular transmission (such as a "line")

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Use COM Objects in MATLAB에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by