完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
扫一扫,分享给好友
大家好,我是34972A仪器的新手,我正在尝试创建一个Visual Basic .Net 2010应用程序来从16个通道收集数据并切换一些I / O.
使用Console演示进行教程。 它的工作原理,但它的错误我,我必须这样做:进口Ivi.Visa.Interop进口Agilent.CommandExpert.ScpiNet.Ag3497x_1_13模块模块1分的Main()“昏暗I34972A作为新Ivi.Visa.Interop.ResourceManager”昏暗I34972A作为 Ag3497x =新Ag3497x(61) 'U***Transport = I34972A.Transport.Visa.ResourceName.Get' 点心I34972A作为Ag3497x =新Ag3497x(U***Transport)Console.WriteLine( “连接到34972A LXI数据采集/开关单元...”)控制台 .WriteLine()昏暗I34972A作为Ag3497x =新Ag3497x( “USB0 :: 0x0957 :: 0x2007 :: my49007650 :: 0 :: INSTR”)昏暗IDN作为字符串=没有I34972A.SCPI.IDN.Query(IDN)Console.WriteLine (“* IDN查询返回:”& IDN)Console.WriteLine()Console.WriteLine(“按任意键退出...”)Console.ReadKey()End Sub它工作正常,但我想这样做更多 通过识别所有可用的传输(我有3个其他USB仪器)智能地我想以编程方式发现传输名称。 我不知道如何实例化Ag3497x类,所以我可以访问所有的方法和属性。 上面我被迫输入一个字符串“USB0 :: 0x0957 ....”我想发现有多少设备连接并选择适当的传输。 我不想硬编码。 有没有人知道如何:1。实例化“新”类2.以编程方式发现所有可用的传输3.打开传输4.向其写入数据5.关闭传输。 我非常感谢您提供的任何帮助! 此致,rjrodrig @ yahoo.com 以上来自于谷歌翻译 以下为原文 Hi All, I am new to the 34972A instrument, and I am trying to create a Visual Basic .Net 2010 application to Gather data from 16 channels and to toggle some I/O. Ran a tutorial using the Console demo. It works, but it bugs me that I have to do this: Imports Ivi.Visa.Interop Imports Agilent.CommandExpert.ScpiNet.Ag3497x_1_13 Module Module1 Sub Main() 'Dim I34972A As New Ivi.Visa.Interop.ResourceManager 'Dim I34972A As Ag3497x = New Ag3497x(LXI) 'U***Transport = I34972A.Transport.Visa.ResourceName.Get 'Dim I34972A As Ag3497x = New Ag3497x(U***Transport) Console.WriteLine("Connecting to 34972A LXI Data Acquisition/Switch Unit...") Console.WriteLine() Dim I34972A As Ag3497x = New Ag3497x("USB0::0x0957::0x2007::my49007650::0::INSTR") Dim IDN As String = Nothing I34972A.SCPI.IDN.Query(IDN) Console.WriteLine("*IDN query returns: " & IDN) Console.WriteLine() Console.WriteLine(" Press any key to exit...") Console.ReadKey() End Sub It works fine, but I want to do this more intelligently by identifying all available transports ( I have 3 other USB instruments) I want to programmatically discover what the transport name is. I don't know how to instantiate Ag3497x class so I have access to all the methods and properties. Above I am forced to enter a string "USB0::0x0957...." I want to discover how many devices are connected and choose the appropriate transport. I don't want to hard code it. Does any one know how to : 1. instantiate the "new" class 2. programmatically discover all available transports 3. open the transport 4. Write data to it 5. close the transport. I would really appreciate any help you can provide! Regards, rjrodrig@yahoo.com |
|
相关推荐
3个回答
|
|
您可以使用VISA COM查找连接到PC的所有仪器。
然后,您可以使用通用SCPI-99 SCPI.NET驱动程序发送* IDN? 连接到的所有乐器,看它们是否是您正在寻找的34972A。 然后,您可以使用34972A SCPI.NET驱动程序实际向仪器发送命令。 设置项目的关键步骤是:使用Visual Studio的“添加引用”对话框中的“COM”选项卡添加对VISA COM 3.0的引用。 使用Visual Studio的“添加引用”对话框中的“浏览”选项卡添加对SCPI-99和34972A SCPI.NET驱动程序的引用 - SCPI.NET驱动程序将位于以下位置: - Windows XP:C: Documents and Settings 所有用户 Agilent Command Expert ScpiNetDrivers - Windows 7:C: ProgramData Agilent Command Expert ScpiNetDrivers查看附带的VS2010 VB.NET示例控制台应用程序,该应用程序显示了如何执行此操作。 以上来自于谷歌翻译 以下为原文 You can use VISA COM to find all of the instruments that are connected to your PC. Then, you can use the generic SCPI-99 SCPI.NET driver to send *IDN? to all of the instruments that you have connected to see if they are the 34972A you are looking for. Then you can use the 34972A SCPI.NET driver to actually send commands to the instrument. The key steps in setting up your project will be: Add a Reference to VISA COM 3.0 using the COM tab in Visual Studio's Add Reference dialog. Add a Reference to both the SCPI-99 and 34972A SCPI.NET drivers using the Browse tab in Visual Studio's Add Reference dialog - The SCPI.NET drivers will be in the following locations: -- Windows XP: C:Documents and SettingsAll UsersAgilentCommand ExpertScpiNetDrivers -- Windows 7: C:ProgramDataAgilentCommand ExpertScpiNetDrivers Check out the attached VS2010 VB.NET example Console Application that shows how to do it. |
|
|
|
非常感谢你的回复。
我认为必须有一种方***询所有乐器并选择我想要的乐器。 谢谢你回答我的问题。 我现在就开始我的发展。 RR 以上来自于谷歌翻译 以下为原文 Thank you so much for your reply. I figure there has to be a way of polling for all the instruments and selecting the one I want. thank you that answers my question. I will start my development now. RR |
|
|
|
好的,所以这里有2个单独的答案:h1。
命令专家.dll的1)命令专家.dll可以打包在您的安装程序中。 以下信息来自Command Expert帮助文件中的“部署SCPI.NET应用程序”主题:*没有Command Expert安装*要在目标PC上安装应用程序而不在该PC上安装Command Expert:安装应用程序的文件Make 确保以下文件(从Command Expert安装中复制)与目标PC上已部署的应用程序一起存在:任何引用的SCPI.NET驱动程序。 Agilent.CommandExpert.Common.dll Agilent.CommandExpert.InstrumentAbstraction.dll Agilent.CommandExpert.Scpi.dll 2)请参阅Command Expert帮助文件主题“文件位置”以确定上述Command Expert DLL文件和SCPI.NET驱动程序文件的位置 安装在您的开发PC上。 H1。 Ivi.Visa.Interop(VISA COM PIA)此文件与VISA共享组件一起安装。 它由IVI基金会提供,但它本身是不够的。 您还需要安装整个Agilent IO Libraries Suite才能使I / O正常工作。 没有好的方法将它打包到您的安装程序中,并且它非常大(几百兆字节)。 *因此,一般建议您让用户单独安装IO库(它将为您安装此Ivi.Visa.Interop)。 然后,告诉安装人员不要包含Ivi.Visa.Interop * 以上来自于谷歌翻译 以下为原文 Ok, so 2 separate answers for you here: h1. Command Expert .dll's 1) The Command Expert .dll's can be packaged in your installer. The following information is taken from the "Deploying SCPI.NET Applications" topic in the Command Expert help file: *Without a Command Expert Installation* To install your application on a target PC without installing Command Expert on that PC: Install your application's files Make sure the following files (copied from your Command Expert installation) are present alongside your deployed application on the target PC: Any referenced SCPI.NET drivers. Agilent.CommandExpert.Common.dll Agilent.CommandExpert.InstrumentAbstraction.dll Agilent.CommandExpert.Scpi.dll 2) See the Command Expert help file topic "File Locations" to determine where the above Command Expert DLL files and SCPI.NET driver files are installed on your development PC. h1. Ivi.Visa.Interop (the VISA COM PIA) This file is techincally installed with the VISA Shared Components. It is provided by the IVI Foundation, but it is not sufficient unto itself. You also need the whole Agilent IO Libraries Suite installed to make your I/O work. There is no good way to package it into your installer, and it is quite large (several hundred Megabytes). *So, the general recommendation is that you make the user install the IO Libraries separately (it will install this Ivi.Visa.Interop for you). Then, tell your installer not to include Ivi.Visa.Interop* |
|
|
|
只有小组成员才能发言,加入小组>>
1221 浏览 0 评论
2346 浏览 1 评论
2155 浏览 1 评论
2021 浏览 5 评论
2900 浏览 3 评论
961浏览 1评论
关于Keysight x1149 Boundary Scan Analyzer
697浏览 0评论
N5230C用“CALC:MARK:BWID?”获取Bwid,Cent,Q,Loss失败,请问大佬们怎么解决呀
797浏览 0评论
1221浏览 0评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-11-22 05:33 , Processed in 1.382872 second(s), Total 81, Slave 64 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号