Red Pitaya is not connecting to MATLAB

17 次查看(过去 30 天)
I am trying to connect my Red Pitaya to the online version of MATLAB (matlab.mathworks.com). I am using the following code below:
%% Define Red Pitaya as TCP/IP object
IP= '169.254.222.68'; % Input IP of your Red Pitaya...
port = 5000;
tcpipObj=tcpip(IP, port);
%% Open connection with your Red Pitaya
fopen(tcpipObj);
tcpipObj.Terminator = 'CR/LF';
%% Send SCPI command to Red Pitaya to turn ON LED1
fprintf(tcpipObj,'DIG:PIN LED1,1');
pause(5) % Set time of LED ON
%% Send SCPI command to Red Pitaya to turn OFF LED1
fprintf(tcpipObj,'DIG:PIN LED1,0');
%% Close connection with Red Pitaya
fclose(tcpipObj);
I get this following error:
Error using icinterface/fopen (line 83)
Unsuccessful open: Connection timed out (Connection timed out)
I am able to connect to the red pitaya browser interface but I am not able to connect my Red Pitaya Board to MATLAB.

回答(1 个)

Vandit
Vandit 2024-1-24
Hi Nathan,
I understand that you are encountering an error while trying to connect Red Pitaya board to the online version of MATLAB.
The error message indicates a failure to establish a connection between MATLAB and Red Pitaya board. A workaround to resolve this error is to start the “SCPI server” on Red Pitaya board before running the MATLAB script.
Please refer to the following link which may help you to start the “SCPI server” :
Hope this resolves your query,

类别

Help CenterFile Exchange 中查找有关 Interactive Control and Callbacks 的更多信息

标签

产品


版本

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by