ICT readbinblock function error, "Adaptor command 'read' failed with status code: 101."

조회 수: 49 (최근 30일)
Hello,
I'm using 2022a w/ the instrument control toolbox v4.6 (latest release), reading data from a tektronix scope over usb via a visadev adaptor.
When running the command readbinblock(instr_obj, count);, I receive the error "Adaptor command 'read' failed with status code: 101."
I've also received code -110, however I cannot find any info in the docs nor google as to what these codes mean.
The error is thrown in "Resource.m", line 579 "obj.Client.initiateReadBinblockSync();".
My workaround for the time being is repeated calls to the read function, though it doesn't read all of the available data so I have to loop it, which takes several orders longer to accomplish. I know that the older implemntation of binblock read would work reliably and ~0.1s/MS.
Is there a workaround or a 'gotcha' I'm missing with the new ICT implementation, or is this in the realm of a bug report?
  댓글 수: 1
Raymond Obenauf
Raymond Obenauf 2022년 3월 30일
okay, I've made some progress! I went back to basics and tested v = visadev(name), write(v, 'curve?), readbinblock(v). I got data back!
I went back to my driver wrapper and ran it up to self.instr = visadev(name). Ran the write and read, and got data! The next line set the timeout, reran write and read and still got data!
Now here's the interesting part, the next block sets the terminator. Default on visadev is 'LF', and driver default is 'LF'. Running 'configureTerminator(self.instr, 'LF')', then running the read write produces the 101 read error code.
Now I need to snoop what's going on with 'configureTerminator'; reading works until you call that command, and calling it to change it to another character and back causes errors. The solution for the time being is just to not run that function.

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

답변 (1개)

Avni Agrawal
Avni Agrawal 2024년 2월 7일
Hi Raymond,
I understand that you are getting error while running ICT readbinblock function. Please try running this code in the driver wrapper as mentioned below:
scope = visadev(name);
scope.ByteOrder = 'little-endian';
configureTerminator(scope,"LF")
flush(scope,"output");
idn = writeread(scope,"*IDN?"); % Get scope's ID string
fprintf('Connected to: %s\n',idn);
scope.KeepAlive = true;
%% Set number of points
writeread(scope,":WAV:POIN:MODE MAX;:WAV:POIN ALL;*OPC?");
%% Capture a waveform
writeread(scope,':DIG;*OPC?');
%% Import the waveform data
write(scope,":WAVeform:SOURce CHANnel1;FORMat WORD;DATA?");
wfm = readbinblock(scope,"uint16"); % Read into array
read(scope,1); % Read the termination character
I hope this helps!

제품


릴리스

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by