how to transfer data from Proteus to Matlab? (Serial Communication)

15 ビュー (過去 30 日間)
JITEN CALEB
JITEN CALEB 2022 年 2 月 1 日
コメント済み: JITEN CALEB 2022 年 2 月 2 日
Hello, Im currently working with two softwares mainly Proteus and Matlab. I want to send a wavefrom from Proteus to Matlab through a com port. I did test my com port with proteus by sending data from matlab to proteus but im unable to send data from proteus to matlab, and error occurs as shown in the picture. Can you please assist me with sending this data / waveform from proteus to matlab via the port.?
  2 件のコメント
Murugan C
Murugan C 2022 年 2 月 1 日
did you tried like this?
port = 'COM1';
text_send = 'HELLO';
s1 = serial(port,'BaudRate',9600);
fopen(s1);
fprintf(s1,text_send);
fclose(s1);
delete(s1);
JITEN CALEB
JITEN CALEB 2022 年 2 月 1 日
yes , I did that works, but now i need to send data from proteus to matlab, as you can see in the vitrtual terminal i said hello, i need that to be read in matlab. Any suggestions ?.

サインインしてコメントする。

回答 (1 件)

Murugan C
Murugan C 2022 年 2 月 2 日
try this one
port = 'COM1';
s1 = serial(port);
set(s1,'BaudRate',9600,'StopBits',1,'FlowControl','none','Parity','none','DataBits'...
,8,'outputBufferSize',5000);
s1.InputBufferSize=5000;
s1.TimeOut=5;
fopen(s1);
out = fread(s1);
fclose(s1);
delete(s1);
  1 件のコメント
JITEN CALEB
JITEN CALEB 2022 年 2 月 2 日
@Murugan C. I did try that code its still showing the error. I attached the picture.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeUse 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