完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
嗨,我正试图在matlab(2013a)中以二进制模式从EXA信号分析仪中获取跟踪数据,以试图获得更快的速度。
(ASCII工作正常,但需要太长时间)。 我修改了下面的安捷伦示例(基本上只是将接口更改为GPIB并添加了一些定时器)。 我得到正确的数据,但只有前100个点左右,然后传输停止,我得到*“在读取binblock之前发生超时”。*任何想法可能是什么问题? 我尝试更改GPIB超时(正如您在代码中看到的那样),但它似乎没有任何影响。 关注Martin示例2获取跟踪单个%获取并绘制跟踪数据%单个跟踪获取%初始设置%mxa_ip = '10 .10.10.10'; %mxa_port = 5025; %mxa = tcpip(mxa_ip,5025); mxa = gpib('agilent',7,20); 集(MXA, 'EOSMode', '读取&安培;写'); 集(MXA, 'EOSCharCode', 'LF'); 接收跟踪数据%的%%输入缓冲区大小应至少为32位实际格式集的跟踪%点数的4倍(mxa,'InputBufferSize',8009); 集(MXA, '超时',1000); 的fopen(MXA); fprintf(mxa,'INIT:CONT 0'); %将数据跟踪格式设置为REAL,32位fprintf(mxa,':FORM:DATA REAL,32'); %fprintf(mxa,':FORM:BORD NORM'); fprintf(mxa,':FORM:BORD SWAP'); fprintf中(MXA,为 'init:IMM'); Operation_complete = query(mxa,'* OPC?'); %获取nr跟踪点nr_points = str2double(查询(mxa,':SWE:POIN?')); %获取参考级别ref_lev = str2num(查询(mxa,'DISP:WIND:TRAC:Y:RLEV?')); T1 =时钟; %获取跟踪数据fprintf(mxa,':TRAC?TRACE1'); [data,count,msg] = binblockread(mxa,'float32')fscanf(mxa); %删除终结符字符暂停(1)etime(时钟,t1)%创建并带到前面的数字1图形(1)%绘图跟踪数据与扫描点索引图(1:nr_points,data)%调整x限制为 的点%的NR和动态范围XLIM的100分贝([1个nr_points])ylim([ref_lev-100 ref_lev])%在y限制激活标题( '扫频SA迹')xlabel('点网格线网格 index')ylabel('Amplitude(dBm)')%断开清理fclose(mxa); 删除(MXA); 明确mxa; 以上来自于谷歌翻译 以下为原文 Hi, I'm trying to acquire trace data from EXA signal analyzer in binary mode in Matlab(2013a) to try to get faster speed. (ASCII works fine but takes a bit too long). I modified the Agilent example below (basically just changing interface to GPIB and adding some timer). I get correct data out, but only the first 100 points or so then the transmission stops and I get *"A timeout occurred before the binblock was read".* Any idea what might be the problem? I tried changing GPIB timeout (as you can see in the code), but it doesn't seem to have any effect. Regards Martin Example 2 Acquire Trace Single % Getting and plotting trace data % Single trace acquisition % Initial setup %mxa_ip = '10.10.10.10'; %mxa_port = 5025; %mxa=tcpip(mxa_ip, 5025); mxa = gpib('agilent',7,20); set(mxa,'EOSMode','read&write'); set(mxa,'EOSCharCode','LF'); % % input buffer size to receive trace data % should be at least 4 times the number of trace % points for 32-bit real format set(mxa,'InputBufferSize',8009); set(mxa,'timeout',1000); fopen(mxa); fprintf(mxa,'INIT:CONT 0'); % Set the data trace format to REAL, 32 bits fprintf(mxa,':FORM:DATA REAL,32'); %fprintf(mxa,':FORM:BORD NORM'); fprintf(mxa,':FORM:BORD SWAP'); fprintf(mxa,'INIT:IMM'); Operation_complete = query(mxa,'*OPC?'); % Get the nr of trace points nr_points = str2double(query(mxa,':SWE:POIN?')); % Get the reference level ref_lev = str2num(query(mxa,'DISP:WIND:TRAC:Y:RLEV?')); t1=clock; % Get the trace data fprintf(mxa,':TRAC? TRACE1'); [data,count,msg] = binblockread(mxa,'float32') fscanf(mxa); %removes the terminator character pause(1) etime(clock,t1) % create and bring to front figure number 1 figure(1) % Plot trace data vs sweep point index plot(1:nr_points,data) % Adjust the x limits to the nr of points % and the y limits for 100 dB of dynamic range xlim([1 nr_points]) ylim([ref_lev-100 ref_lev]) % activate the grid lines grid on title('Swept SA trace') xlabel('Point index') ylabel('Amplitude (dBm)') % Disconnect an clean up fclose(mxa); delete(mxa); clear mxa; |
|
相关推荐
1个回答
|
|
|
|
|
|
只有小组成员才能发言,加入小组>>
1291 浏览 0 评论
2375 浏览 1 评论
2194 浏览 1 评论
2065 浏览 5 评论
2952 浏览 3 评论
1123浏览 1评论
关于Keysight x1149 Boundary Scan Analyzer
758浏览 0评论
N5230C用“CALC:MARK:BWID?”获取Bwid,Cent,Q,Loss失败,请问大佬们怎么解决呀
934浏览 0评论
1294浏览 0评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-12-26 07:19 , Processed in 1.413485 second(s), Total 76, Slave 60 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号