Plotting Spectrum Analyzer Agilent 8563EC with Instr. Contr. Toolb., maybe Buffer Full?

7 views (last 30 days)
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)
% returns a vector of integers from a char
% e.g. M = '-53.58,-16.25,-53.41' is returned as
% m = [-53.58 -16.25 -53.41];
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

Accepted Answer

Christopher
Christopher on 6 Oct 2011
Hey @all, I found the solution: Just change g = gpib('ni',0,1); g.InputBufferSize to g = gpib('ni',0,1,'InputBufferSize',30000); g.InputBufferSize and it will work just fine.
Thanks @all who tried to find the answer.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!