Hallo, I have got the following problem: PC-internal GPIB-Card of NI Spectrum Analyzer Agilent 8563EC I want to visualize the full frequency band of the spectrum analyzer in Matlab (plot all I see on the Agilent's screen as well on my PC). Therefore I wrote the code
g = gpib('ni',0,1);
fopen(g);
fprintf(g,'TDF P; TRA?');
meas = fscanf(g);
MEAS = mystr2num(meas);
plot(MEAS);
Turns out that with fprintf(g,'TDF P; TRA?') I receive a 512bit long char '-51.22,-50.22,....' , that I convert with mystr2num
function M = mystr2num(MEAS)
if ismember(',',MEAS)
for i = 1:length(MEAS)
if MEAS(i) == ','
MEAS(i) = ' ';
end
end
else
error('Function only for use of cascaded comma separated hidden integers use other function to convert a char array to string array');
end
M = sscanf(MEAS,'%f');
into a 72 double array. Plotting M, it turns out that I only get like 1/15 of the entire screens of the spectrum analyzer. Since I want the entire frequencies I need a solution for my problem? Please help. I already considered the buffer to be full. Maybe enlarging buffersize helps? I don't know how. I have sweeptime 90s because I haven't been able so trigger the signal generator (sweeptime now: 50ms) and the Spec.analyzer right. Isn't there a command to copy the entire trace A of the screen?
Anyone got an idea? Please, do not hesitate to answer...
aknorbert