AnsweredAssumed Answered

ESR error after data capture: difference between "*OPC" and "*OPC?"

Question asked by xinlivu on May 18, 2018
Latest reply on May 29, 2018 by DavidVW

Hi Sir,

   I am using Keysight PNA-X Network Analyzer, N5245B to capture Sp, compression, NF and IP3.  

Following two methods are tired for data capture:   Please help to compare them and indicate the risk.  Thanks.

 

nch=3; 

 

method 1: 

fprintf(g_vna,['SENS',num2str(nch),':SWE:MODE GROUPS;*OPC']);
R=0;
while R==0
fprintf(g_vna,'*STB?'); pause(0.05); R=str2num(fscanf(g_vna)); % if 0 not done, >0 means done
end

 

method 2: 

fprintf(g_vna,['SENS',num2str(nch),':SWE:MODE GROUPS;*OPC?']); R=str2num(fscanf(g_vna));
% return 1, when all pending overlapped ops are completed.
while R==0
fprintf(g_vna,'*STB?');
pause(0.05);
R=str2num(fscanf(g_vna)); % if 0 not done, >0 means done
fprintf('waiting *STB...\n')
end

fprintf(g_vna,'*ESR?');ESR=fscanf(g_vna);% if 1 no error, or else error? stop
if str2num(ESR)==1 %'+1'
%% no error
else
disp('PNA ESR Error!'); %return; -420, Query unterminated
end

 

 

My observations:

method 1:  no error happens, but is very slow, and sometimes need tens of seconds to get response. It is beyond my patience.

 

method 2: it is very quick,  but always get ESR error. Sometimes get -410 interrupted error or -420 unterminated error.

 

Please let me know what the difference between "*OPC" and "*OPC?" ?  In my case, which method is right or any new improvement should be used?

 

Thanks.

Outcomes