Red Pitaya is not connecting to MATLAB

조회 수: 4 (최근 30일)
Nathan Park
Nathan Park 2022년 3월 2일
답변: Vandit 2024년 1월 24일
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에서 Interface-Based Instrument Communication에 대해 자세히 알아보기

태그

제품


릴리스

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by