Acquiring data from scope RTC 1002 to MATLAB
30 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Nathalia Alves Rocha Batista
am 18 Nov. 2024 um 15:45
Kommentiert: Nathalia Alves Rocha Batista
am 20 Nov. 2024 um 12:14
Hi, I´m trying to connect the scope RTC 1002 (Rohde & Schwarz) to MATLAB using the TCPCLIENT connecntion. The connection looks fine but when I try to use the command writeread(), MATLAB throws the following error:
Error reading String.
Timeout occurred waiting for the String Terminator.
According to the RTC 1002 manual, the terminator for TCP connection is LF. However, even it is set into the code, I´m still no able to run the following code and get the data from scope channel 1.
CODE:
disp( ' ' );
disp( '=== CONNECTING TO THE SCOPE ===' );
disp( ' ' );
% try to open
try
% The object creation function tcpclient both creates and connects the object.
scopeObject = tcpclient ('147.83.49.54',5025);
scopeObject.ByteOrder = "big-endian";
scopeObject.Timeout = 20;
catch err
disp (['*** Matlab error message : ' err.message]);
return;
end
configureTerminator(scopeObject,"LF");
terminator = scopeObject.Terminator;
instrumentInfo = writeread(scopeObject, "*IDN?");
disp("Instrument identification information: " + instrumentInfo);
measureComplete = writeread(scopeObject,"*OPC?");
writeread(scopeObject,"AUT");
writeread(scopeObject,"ACQ:MODE RTI");
scopeSource = writeread(scopeObject,"CHAN1:DATA?");
Thank you for helping me
0 Kommentare
Antworten (1)
Gayathri
am 19 Nov. 2024 um 9:46
I understand that you are facing the error “Timeout occurred waiting for the String Terminator.” while acquiring data from scope RTC 1002 to MATLAB.
What you see in the error message is the TCP/IP client saying that it expected a reply, but it did not receive a reply within the timeout period, or it did not receive the reply that it expected. You can try increasing the timeout value, which allows more time for the response.
This can also happen the terminator is not configured correctly. Even though you have identified the terminator to be “LF”, please try using other terminator options as well to check if data could be acquired in any one of the cases.
Please refer to the following link to a question which talks about the same error.
For more information on “configureTerminator” function, please refer to the following documentation link.
Hope you find this information helpful.
1 Kommentar
Siehe auch
Kategorien
Mehr zu Interface-Based Instrument Communication finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!