完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
大家好 !
我想在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个回答
|
|
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 |
|
|
|
MAX_zuo 发表于 2018-12-21 07:03 非常感谢,这是我想要开始的信息! 以上来自于谷歌翻译 以下为原文 Thank you very much, it was the information I was looking for to get started ! |
|
|
|
我提出了我的主题,我的问题是关于同一个项目。
编程工作正在进行中,我想知道在很长一段时间内每隔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 |
|
|
|
testd012 发表于 2018-12-21 07:25 犯这个错误很容易。 这不是编程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. |
|
|
|
lanziji 发表于 2018-12-21 07:37 您好,感谢您快速而详细的回答,的确,我猜测我的做法是错误的! 我现在会用READ吗? 为了保持我的CONF设置,并跳过:SENSe:FRESistance:NPLC 20,(@ 301:309)这个措施太长了。 我的PT100已经过校准,我使用这些校准来插值测量并在我的程序中获得精确的温度值。 我更喜欢发送READ? 定期通过我的程序命令,以确保n-1测量结束和n测量开始之间的时间是正确的。 您是否有任何提示,为什么9个FRES(开关卡上的18个通道)测量使用这两个命令大约需要2~3秒,但是开关卡(34901A)通知60 ch / s扫描速度:: CONFigure:FRESistance 100,0.001,(@ 301:309) - >发送一次:READ? - >定期发送编辑:将NPLC设置为0.2(默认为1或使用CONF命令设置的分辨率和范围计算,我猜)提高测量速度,并给出我配置/需要的分辨率(使用0.2 PLC,分辨率= 0.00001 x范围= 1E-5 * 1E2 = 1E-3)但是我失去了线路频率噪声抑制。 设置1 PLC让我:VI_ERROR_TMO:发生超时| SCPI连接尝试超时| SCPI错误:-310,系统错误| SCPI错误:-420,在Command Expert上查询UNTERMINATED感谢您的帮助! Eric B.编辑:Eric B.于2014年1月23日上午10:25编辑:Eric B.于2014年1月23日上午10:39 以上来自于谷歌翻译 以下为原文 Hello, Thank you for your quick and detailed answer, indeed I was guessing that I was doing my measures the wrong way ! I'll use now the READ? in order to keep my CONF setting, and skip the :SENSe:FRESistance:NPLC 20,(@301:309) wich makes the measure too long. My PT100s are calibrated and I use those calibrations to interpolate the measures and get a precise value of the temperature in my program. I prefer sending the READ? command via my program periodically to be sure that the time between the end the n-1 measure and the start of the n measure is right. Have you got any hints why 9 FRES ( = 18 channels on the switch card) measures is taking about 2~3 seconds with those two commands, but the switch card (34901A) annouces a 60 ch/s scanning speed : :CONFigure:FRESistance 100,0.001,(@301:309) -> sent once :READ? -> sent periodically EDIT : Setting NPLC to 0.2 (default is 1 or calculated with the resolution and range set with the CONF command, I guess) improves the measuring speed, and give the resolution I configured/need (with 0.2 PLC, Resolution = 0.00001 x Range = 1E-5 * 1E2 = 1E-3) but I lose the line frequency noise rejection. Setting 1 PLC is getting me : VI_ERROR_TMO: A timeout occurred | SCPI connection attempt timed out | SCPI Error: -310,System error | SCPI Error: -420,Query UNTERMINATED On Command Expert Thank you for your help ! Eric B. Edited by: Eric B. on Jan 23, 2014 10:25 AM Edited by: Eric B. on Jan 23, 2014 10:39 AM |
|
|
|
testd012 发表于 2018-12-21 07:52 您好Eric,使用34972A中的内部扫描触发时间比使用您的计算机程序设置发送READ之间的间隔更有意义吗? 命令。 内部计时器消除了所有IO和命令解析时间。 但我相信两者都可能足够准确。 您可以打开测量时间戳参数并查看该参数以确定测量时间到毫秒。 60通道/秒是最快的扫描速率,具有最快的测量设置。 这是自动量程关闭,自动调零关闭,零通道稳定延迟和最小测量孔径设置=最低分辨率。 使用以下命令获得此速度:CONF:FRES 100,(@ 301:309)FRES:NPLC 0.02,(@ 301:309)FRES:ZERO:AUTO OFF,(@ 301:309)ROUT:CHAN:DEL 0 ,(@ 301:309)NPLC 0.02为60 Hz,测量孔径时间为0.33 ms,相当于FRES:RES MAX。 请注意,MAX表示分辨率最低(参见图!)。 那是因为0.1大于0.01。 很混乱! 无论如何,电枢继电器很慢,它们切换和去抖的时间决定了扫描速度。 是的,快速消除了通过在较长时间内整合读数而获得的噪声抑制。 查询未终止错误表示您没有从查询命令读回所有数据。 如果您正确发送了FRES:NPLC 1,(@)命令,这与将测量孔径设置为1 PLC无关。 要进行调试,请发送SYST:ERR? 查询并将结果读回字符串作为manu times直到“0”,在每个命令后返回No Error“”。 以上来自于谷歌翻译 以下为原文 Hello Eric, Using the internal scan trigger time in the 34972A is more accruate than using your computer program to set the interval between sending READ? commands. The internal timer eliminates all IO and command parsing time. But I'm sure both are probably sufficiently accurate. You could turn on the measurement timestamp parameter and look at that to determine the measurement time down to the millisecond. 60 channels/sec is the fastest scan rate with the fastest measurement setting. This is with autorange off, autozero off, zero channel settling delay, and minimum measurement aperture setting = lowest resolution. Use the following commands to get this speed: CONF:FRES 100,(@301:309) FRES:NPLC 0.02,(@301:309) FRES:ZERO:AUTO OFF,(@301:309) ROUT:CHAN:DEL 0,(@301:309) NPLC 0.02 for 60 Hz is a measurement aperture time of 0.33 ms and is equivalent to FRES:RES MAX. Note that MAX means the lowest resolution (go figure!). That's because 0.1 is greater than 0.01. Very confusing! Anyway, armature relays are slow and the time for them to switch and debounce dominates the scanning speed. And yes, going fast eliminates the noise rejection attained by integrating the reading over a longer time. The query unterminated error indicates that you didn't read back all the data from a query command. This doesn't have anything to do with setting the measurement aperture to 1 PLC, if you sent the FRES:NPLC 1,(@) command correctly. For debugging, send a SYST:ERR? query and read back the result into a string as manu times until "0, "No Error"" is returned after every command. |
|
|
|
大家好 !
我提出了我的主题,以避免充斥论坛,因为这个问题与主题相关。 我正在使用Ag3497x_1_13.dll通过我自己的VB.NET应用程序远程控制34972A或34970A。 为了做我的测量,我正在调用dll提供的函数来配置和操作度量:使用MyDMM.SCPI .CONFigure.FRESistance.Command(180,0.001,Range).READ.QueryAllData(DBNull.Value,Return。 值)结束问题是:当应用程序执行读取查询时,它会冻结,直到完成所有度量(或达到超时)。 我该如何修复此冻结? 以上来自于谷歌翻译 以下为原文 Hello everyone ! I'm bring up my thread to avoid flooding the forum, as this question is related to the thread subject. I'm using the Ag3497x_1_13.dll to remotely control a 34972A or a 34970A via my own VB.NET application. To do my measures, I'm calling the functions delivered by the dll to configure and operate the measure : With MyDMM.SCPI .CONFigure.FRESistance.Command(180, 0.001, Range) .READ.QueryAllData(DBNull.Value, Return.values) End With The problem is : When the application executes the read query, it freezes until all the measures are done (or the timeout reached). How can I fix this freeze ? |
|
|
|
testd012 发表于 2018-12-21 08:18 您好Eric,在您编写的操作的所有读数都已完成之前,READ将无法完成。 这包括扫描列表中的所有通道。 如果你想一次获得一个读数,你将使用序列ROUT:SCAN(@); READ,ROUT:SCAN(@); 阅读等 以上来自于谷歌翻译 以下为原文 Hello Eric, The READ will not complete until all the readings from the operations you have programmed have completed. This includes all the channels in your scan list. If you want to get the readings one at a time, you will have the use the sequence ROUT:SCAN (@); READ, ROUT:SCAN (@); READ, etc. |
|
|
|
lanziji 发表于 2018-12-21 08:25 我只是想在执行READ命令时摆脱UI冻结。 我将READ命令放在另一个处理器线程(VB.NET中的backgroundworker技术)中,但它似乎没有用。 以上来自于谷歌翻译 以下为原文 I just want to get rid of the UI freeze while the READ command is executed. I placed the READ command in an other processor thread (backgroundworker technique in VB.NET) but it doesnt seems to work. |
|
|
|
testd012 发表于 2018-12-21 08:31 我想出了解决方案! 为了防止UI冻结,我正在使用BackGroundWorker(在VB.NET中更容易实现多线程)要有一个正常工作的线程,我必须在线程中实例化一个临时驱动程序,然后通过此实例化执行SCPI命令以保持平滑 和响应式UI。 如果BackGroundWorker中的SCPI命令由BackGroundWorker外部实例化的驱动程序使用,则它将无效! 以上来自于谷歌翻译 以下为原文 I figured out the solution ! To prevent the UI freeze, I'm using a BackGroundWorker (multi threading made easier in VB.NET) To have a properly working thread, I had to instantiate a temporary driver IN the thread then execute SCPI command by this instantiation to keep a smooth and responsive UI. If the SCPI command in the BackGroundWorker is used by a driver instantiated outside the BackGroundWorker, it will not work ! |
|
|
|
testd012 发表于 2018-12-21 08:40 感谢您的更新,我们将深入研究一下。 +作为附注,请在下次向论坛发布新消息。 如果您回复旧帖子,可能无法得到合适人员的注意。+ 以上来自于谷歌翻译 以下为原文 Thanks for the update, we'll dig into that a little bit. +As a side note, please post a new message to the forum next time. If you reply to an old thread, you may not get the attention of the right people.+ |
|
|
|
testd012 发表于 2018-12-21 08:31 我想您明白,34972A处理器是单任务处理器,并且在READ操作待处理时正忙。 用户界面是指34972A前面板还是网络界面? 34972A扫描时前面板被锁定。 您可以在扫描过程中打开和关闭另一个与扫描无关的模块上的通道。 也许你需要为你的应用程序做的是使用INIT命令开始扫描以及DATA:POINts? 和DATA:REMove? 循环中的命令通过扫描读出数据扫描。 我不熟悉VB.NET多线程,所以我也要求Alan Copeland看看这个。 以上来自于谷歌翻译 以下为原文 I think you understand, that the 34972A processor is single tasking and is busy while the READ operation is pending. By UI do you mean, the 34972A front panel or the web interface? The front panel is locked out while the 34972A is scanning. You can open and close channels on another module that is not involved with the scanning while scanning proceeds. Perhaps what you need to do for your application is use the INIT command to start the scanning along with the DATA:POINts? and DATA:REMove? commands in a loop to read out the data scan by scan. I'm not familiar with VB.NET multithreading so I'm asking Alan Copeland to take a look at this as well. |
|
|
|
所有的UI都是我自己的应用程序的UI,在VB.NET中开发,在PC上运行。
我正在使用Agilent IO / Connection Expert为34972A和34970A(USB-USB和GPIB-USB)设置别名。 我在Command Expert上生成了SCPI命令,我正在使用相关的DLL。 这些命令是相当基本的(IDN,RST,CONF和READ)。 要设置与DMM的连接,我实例化Ag3497x对象(使用DLL)。 执行前三个命令很快,但READ一个完全冻结了应用程序的UI(当应用程序将READ命令发送到DMM时冻结开始,当DMM发回测量时停止,如果执行,则可能需要很长时间 用户想要采样多个cahnnels)。 当应用程序执行耗时的操作时,VB.NET中用于防止UI冻结的常见解决方案是在BackGroundWorker中执行命令(第二个处理器线程,一种设置线程的简单方法)。 让它正常工作的技巧是在这个单独的线程中实例化第二个(和临时的)Ag3497x对象,然后立即执行耗时的命令。 如果在与第一个Ag3497x对象的单独线程中执行耗时的命令(主要在主线程中实例化,请记住),不会考虑多线程,导致UI冻结。 如果你想要示例代码,只要问一下,我会提供它,看看它可能更容易理解! 以上来自于谷歌翻译 以下为原文 The UI that all is about is the UI of my own application, devellopped in VB.NET, running on a PC. I'm using the Agilent IO / Connection Expert to set up aliases for a 34972A and a 34970A (USB-USB and GPIB-USB). I generated the SCPI command on Command Expert and I'm using the associated DLL. These commands are fairly basic (IDN, RST, CONF and READ). To set up the connection with the DMM(s), I instantiate an Ag3497x object (using the DLL). Executing the first three commands is quick, but the READ one totally freezes the UI of the application (the freeze starts when the apllication sends the READ order to the DMM and stops when the DMM sends back the measures, wich can take a long time if the user wants to sample multiple cahnnels). The common solution in VB.NET to prevent UI freezes when the application executes time consuming operations is to execute the commands in a BackGroundWorker (a second processor thread, an easy way to set up a thread). The trick to get it properly working is to instantiate a second (and temporary) Ag3497x object in this separate thread and executing the time consuming command right after. If the time consuming command is executed in a separate thread with the first Ag3497x object (wich is instantiated previosly in the main thread, remember), the multithreading will not be taken into account, resulting in the UI freeze. If you want example code, just ask and I'll provide it, it might be easier to take look at it to understand ! |
|
|
|
只有小组成员才能发言,加入小组>>
1213 浏览 0 评论
2344 浏览 1 评论
2147 浏览 1 评论
2017 浏览 5 评论
2897 浏览 3 评论
948浏览 1评论
关于Keysight x1149 Boundary Scan Analyzer
690浏览 0评论
N5230C用“CALC:MARK:BWID?”获取Bwid,Cent,Q,Loss失败,请问大佬们怎么解决呀
793浏览 0评论
1213浏览 0评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-11-17 01:27 , Processed in 1.607476 second(s), Total 101, Slave 84 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号