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

9 visualizaciones (últimos 30 días)
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 comentario
Raymond Obenauf
Raymond Obenauf el 30 de Mzo. de 2022
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.

Iniciar sesión para comentar.

Respuestas (1)

Avni Agrawal
Avni Agrawal el 7 de Feb. de 2024
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!

Categorías

Más información sobre Instrument Connection and Communication en Help Center y File Exchange.

Productos


Versión

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by