Clear Filters
Clear Filters

Red Pitaya is not connecting to MATLAB

11 views (last 30 days)
Nathan Park
Nathan Park on 2 Mar 2022
Answered: Vandit on 24 Jan 2024
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.

Answers (1)

Vandit
Vandit on 24 Jan 2024
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,

Categories

Find more on Interactive Control and Callbacks in Help Center and File Exchange

Tags

Products


Release

R2021b

Community Treasure Hunt

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

Start Hunting!