Binblockread timeout (reading keysight network analyzer with long sweep)
    6 views (last 30 days)
  
       Show older comments
    
Good morning,
I have a timeout issue when I read large amount of data from my network analyzer. It works fine with a resolution up to 1001 points but between 1001 and 10001 point, it doesn't work all the time. 
Here is the error I get: "Warning: Unsuccessful read: A timeout occurred before the Terminator was reached. 'tcpip' unable to read any data. For more information on possible reasons, see TCPIP Read Warnings."
Here is the bit of code where I get the data (the setup of the device is done beforehands):
analyzer = tcpip("192.168.0.1", 5025);
set(analyzer, 'InputBufferSize', 40004);
set(analyzer, 'OutputBufferSize', 40004);
set(analyzer, 'ByteOrder', 'littleEndian');
flushinput(analyzer);
flushoutput(analyzer);
fopen(analyzer);
fprintf(analyzer, '*CLS\n'); % clears error queue ans status registers
fprintf(analyzer, 'INIT:IMM;*OPC?\n'); % gets one sweep
fprintf(analyzer, 'INIT:IMM;*OPC?\n'); % gets one sweep
fprintf(analyzer, 'INIT:IMM;*OPC?\n'); % gets one sweep
fprintf(analyzer, 'INIT:IMM;*OPC?\n'); % gets one sweep
fprintf(analyzer, 'FORM:DATA REAL,32\n'); % set fastest format
fprintf(analyzer, 'CALC:DATA:FDATA?\n'); % asks for data
[myBinData] = binblockread(analyzer, 'float'); % reads data
hangLineFeed = fread(analyzer, 1);
size(myBinData) % usefull for debug
fprintf(analyzer, 'SYST:ERR?\n');
initErrCheck = fscanf(analyzer, '%c') 
fclose(analyzer);
I tryed changin the Timeout value (in matlab and in my device) but it does not help.
The execution works fine during the sweeps (even very long ones) but it stops at the binblockread function.
In another bit of code, I also tryed saving all the data in a file on the device (which works well) and then transfering the file though tcpip VISA. In this case I get the same problem: Timeout if the file is to big because of high resolution (higher than 1001points/sweep).
Do you have an idea of what could cause this issue?
Thank you for your expertise,
Mickael
0 Comments
Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!