필터 지우기
필터 지우기

Cannot get a feedback by serial connection from a device

조회 수: 1 (최근 30일)
Sahar Azar
Sahar Azar 2020년 1월 15일
답변: Chidvi Modala 2020년 1월 30일
I am trying to communicate by serial connection with a device (Vertex 7200) but without success.
We did succeeded to communicate with PuTTY and to get a feedback from the device (the feedback is integer).
I configured the connection with the code below in the MATLAB R2019b:
instrreset;
s = serial('COM5');
set(s,'BaudRate',9600,'StopBits',1,'FlowControl','none','Parity','none','DataBits',8,'OutputBufferSize',22);
s.InputBufferSize=22;
s.TimeOut=5;
%CreateSerialPort.Terminator = 'CRLF';
fopen(s);
fwrite(s, 'ALARM F');
output = fread(s);
fclose(instrfind);
clear CreateSerialPort;
All the parameters on the third line are configured the same as in the device that we are trying to communicate with.
The cable double checked and work properly.
The output value that we get in the 'Workspace' is ASCII values of the string command that we sent.
As well we get this warning: "Warning: The specified amount of data was not returned within the Timeout period.
'serial' unable to read any data. For more information on possible reasons, see Serial Read Warnings. "
Thanks for the assistance!

답변 (1개)

Chidvi Modala
Chidvi Modala 2020년 1월 30일

카테고리

Help CenterFile Exchange에서 Block Libraries에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by