MATLAB Answers

Cannot get a feedback by serial connection from a device

5 views (last 30 days)
Sahar Azar
Sahar Azar on 15 Jan 2020
Answered: Chidvi Modala on 30 Jan 2020
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:
s = serial('COM5');
%CreateSerialPort.Terminator = 'CRLF';
fwrite(s, 'ALARM F');
output = fread(s);
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!


Sign in to comment.

Sign in to answer this question.

Translated by