AnsweredAssumed Answered

PNA improve reading speed GPIB

Question asked by joaoreis on Jan 15, 2015
Latest reply on Feb 5, 2015 by joaoreis
Hi guys,

I am programming a PNA via GPIB to get S21 parameters in form of a vector in matlab. 
I have everything working ok so far but I want see if it is possible to improve the duration of the aquisition time.

here my matlab script:


fprintf(gpib_port,'INITiate:CONTinuous OFF');                             
fprintf(gpib_port,'INITiate:IMMediate;*wai');                                 

fprintf(gpib_port,'FORM ascii');                                            

fprintf(gpib_port,'CALCulate:DATA? FDATA');                            
datum(1) = 0;


% read all vna sweep points and save in a array

for i= 1:1:vna_points
    vna_data = fscanf(gpib_port,'%c',20);
    datum(i) = str2double(vna_data);
end

Basicaly, I am reading each point individually until the get all the sweep points through a char. 
I am wondering if there is any chance to do the same, but read all the trace as a string instead of multiple chars. 

Obviously from above, as soon as I increase the number of sweep points, I will take more time to read all data. 

cheers

Edited by: joaoreis on Jan 15, 2015 7:28 AM  

Outcomes