Visa and Timeout error handling?

조회 수: 7 (최근 30일)
Leor Greenberger
Leor Greenberger 2013년 6월 19일
댓글: Cijy Mathai 2021년 9월 2일
Hi.
I am using the instrument control toolbox to create a VISA connection to my instrument using
visa('ni','TCPIP0::<ip>');
Occasionally, when running my matlab procedure, I get the following message,
Warning: Unsuccessful read: VISA: Timeout expired before operation completed.
This usually occurs when the connected instrument is in a weird state and needs to be reset. However, there doesn't seem anyway to handle this warning. I want to basically dump the connection when this happens and exit the matlab script. Any ideas how to do this?
  댓글 수: 2
Joseph Musante
Joseph Musante 2019년 2월 12일
I know it's been a couple years, but in case your still trying to figure it out. Just set the timeout to a higher number.
set(mydevice,'Timeout',60);
The number 60 there is in seconds.
Cijy Mathai
Cijy Mathai 2021년 9월 2일
My problem is not with this solution yet... :(

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Instrument Control Toolbox Supported Hardware에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by