Acquiring data from scope RTC 1002 to MATLAB
30 ビュー (過去 30 日間)
古いコメントを表示
Nathalia Alves Rocha Batista
2024 年 11 月 18 日 15:45
コメント済み: Nathalia Alves Rocha Batista
2024 年 11 月 20 日 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 件のコメント
回答 (1 件)
Gayathri
2024 年 11 月 19 日 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.
参考
カテゴリ
Help Center および File Exchange で Interface-Based Instrument Communication についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!