Timeout expired before operation completed
조회 수: 45 (최근 30일)
이전 댓글 표시
g=visadev("GPIB::18::INSTR")
writeline(g,"Display:Contrast")
data=readline(g)
Hello, I am currently trying to read and write to my PSA spectrum analyzer. visadev is successfully connecting it, but I writeline and readline, when added into my code, always get the "Timeout expired before operation completed" error message. I do not understand why this is not working and how I can fix it. Any advice is greatly apprectiated!
댓글 수: 1
LO
2024년 8월 26일
이동: Walter Roberson
2024년 8월 26일
I am having the same issue with writing data acquired through a PCIexpress National Instrument acquisition card.
The issue does not occur all the time. Just sometimes...
I am not sure this is a memory issue .
I am using the same scripts and routines as usual, no major changes to the system, HD space is not close to end...I have no idea... thank you for any tip
답변 (2개)
Adit Kirtani
2023년 7월 5일
Hi Madeline,
From the issue you have described in your question, I have understood that the write operation has not finished within the default time to complete a write operation. You can change this value by using the following code snippet:
timeout_duration = 20 %Change to whatever value you wish
v = visadev( "GPIB::18::INSTR");
v.timeout = timeout_duration
%Now perform your write / read operations
You can view more details regarding the read and write properties of the visadev object using this documentation link:
I hope this helps,
Adit Kirtani
댓글 수: 0
Andrei
2023년 11월 22일
A couple of suggestions:
- Check that the SCPI command is correct. Not sure what the instrument model is, but I don't see this command in Keysight's PSA Spectrum Analyzer User's and Programmer's Reference Volume 1 - Core Spectrum Analyzer Functions (keysight.com)
- If you are expecting a response from the instrument, the command string should have a ? at the end. In that case instead of writeline followed by readline you can also use writeread function. For example writeread(g,"*IDN?")
See also:
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Instrument Control Toolbox에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!