是德科技
直播中

侯倩

8年用户 204经验值
私信 关注
[问答]

怎么在Windows 7上使用Visual Studio 2010编写Visual Basic.NET程序

大家好 !
我想在Windows 7上使用Visual Studio 2010编写Visual Basic.NET程序,将SCPI命令发送到34972A并通过USB连接读取数据。
我很擅长与乐器交流,我完全迷失了!
我已安装(按照同情和全面的用户的建议): - Agilent I / O Suite 16.3(安捷伦连接专家) - Agilent Command Expert 1.2两者都检测到仪器,* IDN?
命令有效,我成功地读取了值。
但是当谈到使用示例程序时,我很难编译它们并使用它们。
我不知道使用什么库/ drivers / dll / COM以及如何查找和安装它们,以及我是否必须使用VISA或IVI工具。
有人可以帮我找到起始文件吗?
感谢提前,Eric B.Edited:Eric B.于2013年12月16日上午3:35

以上来自于谷歌翻译


     以下为原文

  Hello everyone !

I would like to code a Visual Basic.NET program with Visual Studio 2010 on Windows 7, to send SCPI commands to my 34972A and read data via an USB connection.
I'm pretty new to communication with an instrument, and Im totally lost !
I've already installed (as suggested by a sympathic and comprehensive user) :
- Agilent I/O Suite 16.3 (Agilent Connection Expert)
- Agilent Command Expert 1.2

On both, the instrument is detected, the *IDN? command works, and I succesffully read values.
But when it comes to using sample programs, I'm having a hard time compiling them and using them.
I do not know what libraries/drivers/dll/COM to use and how to find and install them, and if I have to use VISA or IVI tools.
Can someone help me to find starting documentation ?

Thanks in advance,
Eric B.

Edited by: Eric B. on Dec 16, 2013 3:35 AM  

回帖(13)

杜文渊

2018-12-21 16:39:12
Eric,欢迎:)我建议您查看在Visual Studio中使用Command Expert的教程(特别是Visual Basic)。
这些教程很好,因为它们为您提供了有关如何操作的分步说明。
对于Visual Basic .NET(和C#),有两种不同的方法可以解决此问题:1)在Visual Basic .NET中使用SCPI.NET驱动程序2)使用Visual Studio加载项直接在Visual Basic中运行.iseq文件。
NET查看两个教程并确定您喜欢哪种方法。
您可以在Command Expert的Command Expert帮助中找到这些教程。
Alan Copeland IO Libraries Suite和Command Expert Support

以上来自于谷歌翻译


     以下为原文

  Eric, welcome :)

I would suggest that you check out the tutorials for using Command Expert in Visual Studio (Visual Basic in particular). The tutorials are nice because they give you step-by-step instructions on what to do.

For Visual Basic .NET (and C#), there are 2 different ways to approach this:
1) Using SCPI.NET drivers in Visual Basic .NET
2) Using the Visual Studio Add-on to run .iseq files directly in Visual Basic .NET

Check out both tutorials and decide which approach you prefer.

You can find the tutorials as part of the Command Expert help in Command Expert.

Alan Copeland
IO Libraries Suite and Command Expert Support
举报

侯倩

2018-12-21 16:56:11
引用: MAX_zuo 发表于 2018-12-21 07:03
Eric,欢迎:)我建议您查看在Visual Studio中使用Command Expert的教程(特别是Visual Basic)。
这些教程很好,因为它们为您提供了有关如何操作的分步说明。
对于Visual Basic .NET(和C#),有两种不同的方法可以解决此问题:1)在Visual Basic .NET中使用SCPI.NET驱动程序2)使用Visual Studio加载项直接在Visual Basic ...

非常感谢,这是我想要开始的信息!

以上来自于谷歌翻译


     以下为原文

  Thank you very much, it was the information I was looking for to get started !
举报

侯倩

2018-12-21 17:01:33
我提出了我的主题,我的问题是关于同一个项目。
编程工作正在进行中,我想知道在很长一段时间内每隔n秒测量直流电流和4Wires PT100的好方法是什么。
这是我的SCPI序列,我在我的VB.NET程序中使用它们:到现在为止,我正在配置我的频道一次:* IDN?
* RST:CONFigure:FRESistance 100,1E-3,(Scan_List_FR);
:SENSe:FRESistance:NPLC 20,(Scan_List_FR):CONFigure:CURRent:DC 0.01,(Scan_List_DC);
:SENSe:CURRent:DC:NPLC 20,(Scan_List_DC);
然后每n秒重复一次这些命令:MEASure:FRESistance?
(Scan_List_FR);
:测量:电流:DC?
(Scan_List_DC);
我的问题是,我这样做了吗?
阅读Agilent Commands Expert的帮助文件让我明白measure命令会重置Configure和Sense命令,但我不知道,而且我正在尝试找到3497x测量所使用的常用序列!
提前谢谢,Eric B. PS / EDIT:我必须在fresistance值的测量上设置超时:.MEASure.FRESistance.QueryAllDataTimeout = 20000或者我将得到-420 Query Unterminated错误。
否则,我认为我的编程存在问题,获得9个四线电阻大约需要3秒,但是开关卡(34901A)的扫描速度为60 ch / s,而且我的速度远远低于此速度!
编辑:Eric B.于2014年1月22日3:00 PM编辑:Eric B.于2014年1月22日下午5:11

以上来自于谷歌翻译


     以下为原文

  I'm bring up my thread, my question is about the same project.
While programming is getting on, I was wondering what is the good way to measure DC Current and 4Wires PT100 every n seconds while a long time.
This is my SCPI sequences, I use them in my VB.NET program :

Until now, I'm configuring my channels once :

*IDN?
*RST
:CONFigure:FRESistance 100,1E-3, (Scan_List_FR);
:SENSe:FRESistance:NPLC 20,(Scan_List_FR)
:CONFigure:CURRent:DC 0.01,(Scan_List_DC);
:SENSe:CURRent:DC:NPLC 20,(Scan_List_DC);

Then repeating those commands every n secnds

:MEASure:FRESistance? (Scan_List_FR);
:MEASure:CURRent:DC? (Scan_List_DC);

My question is, am I doing this right ?
Reading the help file of Agilent Commands Expert made me understand that the measure command resets the Configure and Sense commands, but I don't know and I'm trying to find the usual sequences used with 3497x measurements !

Thanks in advance,
Eric B.

PS/EDIT : I have to set a timeout on the Measure of the fresistance values :
.MEASure.FRESistance.QueryAllDataTimeout = 20000
Or I'll get an -420 Query Unterminated error.
Otherwise, I think there's a problem in my programming, getting 9 four wires resistance takes about 3 seconds but the switch card (34901A) annouces a 60 ch/s scanning speed, and I'm far under this speed !


Edited by: Eric B. on Jan 22, 2014 3:00 PM

Edited by: Eric B. on Jan 22, 2014 5:11 PM
举报

郝汉

2018-12-21 17:12:51
引用: testd012 发表于 2018-12-21 07:25
我提出了我的主题,我的问题是关于同一个项目。
编程工作正在进行中,我想知道在很长一段时间内每隔n秒测量直流电流和4Wires PT100的好方法是什么。
这是我的SCPI序列,我在我的VB.NET程序中使用它们:到现在为止,我正在配置我的频道一次:* IDN?

犯这个错误很容易。
这不是编程34972A的正确方法。
在MEASure命令下的Programmer's Reference中,您将看到:“这些命令等同于CONFigure:VOLTage:AC或CONFigure:VOLTage:DC后跟READ?”。
您通过使用MEAS命令在此处有效完成的任务是覆盖先前CONF命令所完成的所有操作,并将所有测量参数设置为其默认值。
你想改变MEAS:...?
读书?
但是,您需要的不仅仅是这个,而是要达到您想要的目标。
您只是想测量PT100电阻,还是更愿意让34972A进行转换并返回温度?
如果要使用34972A测量温度,请阅读温度测量的手册部分并使用CONF:TEMP命令。
要长时间每n秒进行一次测量,必须使用ROUT:SCAN(@)命令创建扫描列表。
将触发源设置为timer,TRIG:SOUR TIM。
设置时间,TRIG:TIM n。
设置触发计数,TRIG:COUN计数或inf。
之后是全部设置READ?
命令将启动它。
34972A的第6章“应用程序”可以帮到你一些。
您还可以在34972A产品网页上找到几个编程示例,包括VB.NET。
请访问www.agilent.com/find/34972A>访问技术支持>驱动程序,固件和
软件> 34970A / 34972A VB.NET编程实例。

以上来自于谷歌翻译


     以下为原文

  It's very easy to make this mistake.  This is not the proper way to program the 34972A.  In the Programmer's Reference under the MEASure commands you will see:  "These commands are equivalent to CONFigure:VOLTage:AC or CONFigure:VOLTage:DC followed by a READ?."  What you have effectively done here by using the MEAS command is to override everything done by the previous CONF commands and set all the measurement parameters to their default values.  You want to change from MEAS:...?  to READ?

However, you need more than this to get where you want to be.   Do you just want to measure the PT100 resistance, or would you prefer letting the 34972A do the conversion and return the temperature?  Read the manual section on temperature measurements and use the CONF:TEMP commands if you want to measure the temperature difectly with the 34972A.

To make the measurements every n seconds for a long time, you must create a scan list with the ROUT:SCAN (@) command.  Set the trigger source to timer,  TRIG:SOUR TIM.   Set the time,  TRIG:TIM n.  Set the trigger count,  TRIG:COUN count or inf.   After that is all set up the READ? command will start it all.

Chapter 6 of the 34972A, "Application Programs" would help you some.  You can also find several programming examples including VB.NET on the 34972A product web page.  Go to www.agilent.com/find/34972A > Visit Technical Support > Drivers, Firmware & Software > 34970A/34972A VB.NET Programming Examples.
举报

更多回帖

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