AnsweredAssumed Answered

network get data from gpib by matlab

Question asked by ncumrs48 on Jul 3, 2014
Latest reply on Jul 16, 2014 by ncumrs48
I have a question for get data by gpib

讀取在頻域的資料

以下是coding

clear;
close all;
 
1.儀器連接 
 
obj=gpib('agilent',7 ,17); 
 
2.     設定暫存空間 buffer size斷開連接時間TIMEOUT
 
set(obj,'inputBufferSize',3000); 
  
set(obj,'Timeout',100);    
 
fopen(obj);

3設定量測資料(S21)
 
fprintf(obj,'CALCulate:PARameter:DEFine:EXT "MyMeas",S21');       
          
 
4設定資料格式和讀取
 
fprintf(obj,'FORMat:DATA REAL,64');  
 
fprintf(obj,'FORMat:BORDer NORMal');   

fprintf(obj,'CALC:PAR:SEL "MyMeas"');    
 
fprintf(obj,':CALCulate:DATA? SDATA');
 
data=fread(obj);
 
inphase=data(1:2:end);
 
quadrature=data(2:2:end);
 
IQData=inphase+1i*quadrature;


主要問題是,在我設定range sample number 為1601時
matlab讀取到的資料數目和網路分析儀的資料數目不符合  

Outcomes