是德科技
直播中

徐铭潞

7年用户 276经验值
私信 关注
[问答]

使用图形用户界面控制ENA E5070B出现错误

亲爱的安捷伦代表我正在尝试在matlab中创建一个应用程序来控制网络分析仪ENA E5070B。
然而,许多问题突然出现并推迟了发展。
所以我请求帮助。
以下是我的问题:1 - 我在Matlab(图形界面)中创建了一个GUI,我试图从E5070B读取S参数,然后生成图形S11(db)x频率(GHz)以​​及表格。
我使用以下命令(Matlab命令调用SCPI命令)执行此操作:E5070 = visa('agilent','GPIB0 :: 17 :: INSTR');
E5070.InputBufferSize = 8388608;
E5070.ByteOrder ='littleEndian';
fopen(E5070);
fprintf(E5070,'10 OUTPUT 717');
fprintf(E5070':CALC1:PAR1:DEF S11');
SP = str2num(fscanf(E5070));
情节(SP,'b');
等一下;
网格;
fclose(E5070);
删除(E5070);
清除E5070;
错误消息:“警告:读取失败:VISA:发生超时”2 - 我不知道是否可能,但我会每100毫秒截取E5070B的屏幕截图。
你能发送一个可能的命令序列吗?
3 - 在我的GUI(图形界面)中,有一些字段供用户输入起始频率,停止频率和扫描点数。
我对如何使用Matlab GUI输入将转到SCPI命令的信息有疑问。
如何在SCPI命令中输入数据?
4 - 最后一个问题是关于向一个端口(es,ed,er)读取系统错误。
我正在使用以下序列命令:E5070 = visa('agilent','GPIB0 :: 17 :: INSTR');
E5070.InputBufferSize = 8388608;
E5070.ByteOrder ='littleEndian';
fopen(E5070);
fprintf(E5070,'10 CALL Exec_error_term(@ Agte507x,“READ”,“ED”,Ch $,5,Nop,1.1,Stok(*))');
fprintf(E5070,'20 CALL Exec_error_term(@ Agte507x,“READ”,“ED”,Ch $,6,Nop,2.2,Stok(*))');
ed = str2num(fscanf(E5070))fclose(E5070);
删除(E5070);
清除E5070;
错误消息:“警告:读取失败:VISA:发生超时”提到的所有功能都是从GUI按钮的回调中调用的。
我很感谢技术支持和关注。
谢谢Daniel,(电气工程系硕士 - 硕士)

以上来自于谷歌翻译


     以下为原文

  Dear Agilent's representatives


I'm trying to create an application in Matlab to control a network analyzer ENA E5070B. However many questions are popping up and delaying development. So I ask for help.

Here are my questions :

1 - I create a GUI in Matlab (graphical interface) and I'm trying to read S parameters from E5070B and then generate a graph S11 (db) x Frequency (GHz) and also a table.  

I did this using the following commands (Matlab commands calling SCPI commands) :


E5070 = visa ('agilent', 'GPIB0 :: 17 :: INSTR');
E5070.InputBufferSize = 8388608;
E5070.ByteOrder = 'littleEndian';
fopen (E5070);
fprintf (E5070, '10 OUTPUT 717 ');
fprintf (E5070 ': CALC1: PAR1: DEF S11');
SP = str2num (fscanf (E5070));
plot (SP, 'b');
hold on;
grid on;
fclose (E5070);
delete (E5070);
clear E5070;

Error message : "Warning: Unsuccessful read: VISA: A timeout occurred"


2 - I don't know if it's possible, but I would take a screenshot of the E5070B every 100 ms. Could you send a
possible sequence of commands to do this?



3 - In my GUI (graphical interface), there are fields for the user to enter the start frequency, stop frequency
and the number of sweep points. I have questions about how to use Matlab GUI to enter with an information
that will go to a SCPI command.  How to enter data in SCPI commands ?


4 - The last question is about reading systemic errors to one port (es, ed, er). I'm using the following sequence
commands:

E5070 = visa ('agilent', 'GPIB0 :: 17 :: INSTR');
E5070.InputBufferSize = 8388608;
E5070.ByteOrder = 'littleEndian';
fopen (E5070);
fprintf (E5070, '10 CALL Exec_error_term (@ Agte507x, "READ", "ED", Ch $, 5, Nop, 1.1, Stok (*)) ');
fprintf (E5070, '20 CALL Exec_error_term (@ Agte507x, "READ", "ED", Ch $, 6, Nop, 2.2, Stok (*)) ');
ed = str2num (fscanf (E5070))
fclose (E5070);
delete (E5070);
clear E5070;


Error message : "Warning: Unsuccessful read: VISA: A timeout occurred"

All the functions mentioned were called from callbacks of GUI pushbuttons. I am grateful for the technical support and attention.



Thank you,

Daniel (student of electrical engineering - Masters)  

回帖(5)

郑静东

2018-11-22 11:11:10
嗨,我不是Matlab的专家,但也许我可以给你一些线索来解决你的问题:1。超时问题发生,因为默认超时设置为2秒,如果命令执行时间超过2秒,则此错误将
发生。
您可以通过为签证对象设置更大的超时值来解决此问题。
也许像套装(E5070,'超时',100);
是的,这是可能的。
您应该找到将ENA的屏幕图像转储到ENA磁盘的命令,然后按照此线程将文件从ENA复制到PC(VC ++),将图像从ENA复制到PC。
Matlab可能具有从GPIB总线读取二进制数据的特定功能,然后您需要使用Matlab将二进制数据输出到文件。
3.在软件GUI上执行此操作的常用方法是使用“频率启动”字段和名为“应用”的按钮,当您点击“应用”按钮时,按钮事件处理代码将与ENA通信
发送命令设置频率。
那是另一个类似于1的超时错误。
编辑:ningchen于2014年7月11日上午3:01

以上来自于谷歌翻译


     以下为原文

  Hi, I'm not an expert on Matlab, but maybe I can give you some clue for your questions:

1. the timeout issue occured because the default timeout settings is 2 seconds, if a command execution is longer than 2 seconds this error will happen. You can fix this by setting the timeout value bigger for your visa object. Maybe something like 
set(E5070 , 'Timeout', 100);

2. Yeah it's possible. You should find the command to dump the screen image of ENA to the ENA disk, then follow this thread Copying file from ENA to PC (VC++)  to copy the image from ENA to your PC. Matlab may have specific functions to read binary data from the GPIB bus, then you need to output the binary data to a file with Matlab.

3. the common way to do it on a software GUI is to have a field for the "Frequency Start" and a Button named "Apply", when you hit the "Apply" button, the Button event handling code will communicate with the ENA to send the commands to set frequency.

4. That's another timeout error similar to 1.
 
Edited by: ningchen on Jul 11, 2014 3:01 AM
举报

徐铭潞

2018-11-22 11:28:21
引用: 平凡的世界12 发表于 2018-11-22 07:08
嗨,我不是Matlab的专家,但也许我可以给你一些线索来解决你的问题:1。超时问题发生,因为默认超时设置为2秒,如果命令执行时间超过2秒,则此错误将
发生。
您可以通过为签证对象设置更大的超时值来解决此问题。

非常感谢ningchen!
您的帮助对我的硕士学位项目的发展非常重要。
当我完成这项工作后,我将在这里提出一个主题,逐步展示所做的工作。

以上来自于谷歌翻译


     以下为原文

  Thank very much ningchen !

Your help  will be very important to development of my masters degree project. When I  finish the work, I will put here an topic showing step-by-step what was made.
举报

郑静东

2018-11-22 11:41:12
引用: 60user142 发表于 2018-11-22 07:26
非常感谢ningchen!
您的帮助对我的硕士学位项目的发展非常重要。
当我完成这项工作后,我将在这里提出一个主题,逐步展示所做的工作。

欢迎您使用Matlab函数从GPIB总线读取二进制数据,我注意到您可以使用“binblockread”功能。
我用它来读取ENA中的数据,这些数据显示在你的另一个线程中:如何从ENA获取S参数到计算机?

以上来自于谷歌翻译


     以下为原文

  You are welcome  

For the Matlab function to read binary data from the GPIB bus, I noticed maybe you can use the "binblockread" function. I used that to read data from the ENA, which is shown in another thread of yours: How can I get S parameters from ENA to computer?
举报

h1654155275.5950

2018-11-22 11:54:35
引用: 60user142 发表于 2018-11-22 07:26
非常感谢ningchen!
您的帮助对我的硕士学位项目的发展非常重要。
当我完成这项工作后,我将在这里提出一个主题,逐步展示所做的工作。

您也可以将您创建的GUI发布到www.MATLABCentral.com。这里有很多很好的例子,你的它可能是一个很好的补充。

以上来自于谷歌翻译


     以下为原文

  You can also post the GUI you create to www.MATLABCentral.com There are many good examples there, and yours may be a good addition to it.
举报

更多回帖

发帖
×
20
完善资料,
赚取积分