AnsweredAssumed Answered

Acquisition fails randomly

Question asked by yileili3 on Dec 31, 2016
Latest reply on Jan 17, 2017 by yileili3



I am using the InfiniVision DSO-X 2022A to acquire multiple waveforms. I am using Matlab on a PC to trigger the oscilloscope and output the waveform.  When I run the procedure repeatedly, I usually can get a few hundred waveforms and then the instrument hangs at a random time and an "VISA: I/O error" is returned. The buttons on the front panel would not respond at that time either.  Unfortunately I need to acquire more data over time.  What could be causing the acquisition failure, especially when it was working fine for a few hundred times?


Below is the matlab function that I used and I am calling this function to run again and again. 


Thanks in advance,



function [ data, Nread, message ] = aquireOneTimeSeries( oscil )

waitTime = 0.02;
fprintf(oscil, '*CLS');
fprintf(oscil, ':STOP');

% make sure operation is complete
operationComplete = 0;
while ~ operationComplete
fprintf(oscil, '*OPC?');
operationComplete = str2double(fscanf(oscil));

fprintf(oscil, 'SINGle'); % perform single acquisition


% Make sure oscilloscope is ready to trigger
varAER = 0;
while (varAER ~= 1)
fprintf(oscil, ':AER?');
varAER = str2double(fscanf(oscil));



% Make sure the oscilloscope triggered and has stopped running
runBit = 1;

while (runBit == 1)
fprintf(oscil, ':TRIGger:FORCe');
fprintf(oscil, ':OPERegister:CONDition?');
OPERegister = str2double(fscanf(oscil));
runBit = mod(floor(OPERegister/8), 2);



% Request for data
fprintf(oscil, ':WAVeform:DATA?');
[data, Nread, message] = binblockread(oscil, 'int16'); fread(oscil, 1);