完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
大家好,我正在开发一个程序,用于通过LAN和LAN连接Agilent 34972。
使用热敏电阻进行温度测量。 在我公司购买设备之前,我尝试使用VB中Agilent34970 IVI-COM驱动程序中的模拟器功能。 已经安装了驱动程序和 共享组件,添加了相关驱动程序的参考资料。 在驱动程序init中启用了模拟[with simulation = true option]。 如文档中所指定。 Init Code Sequence如下:------------------------------------------- ------------------------------------ Dim resourceDesc As String resourceDesc =“TCPIP0 :: 127.0.0.1: :5025 :: SOCKET“'设置IVI定义的初始化选项Dim standardInitOptions As String standardInitOptions =”Cache = false,InterchangeCheck = false,QueryInstrStatus = true,RangeCheck = false,RecordCoercions = false,Simulate = true“'设置驱动程序特定的初始化 options Dim driverSetupOptions As String driverSetupOptions =“DriverSetup = Model = 34972A,Trace = false”driver.Initialize resourceDesc,False,False,standardInitOptions +“,”+ driverSetupOptions ---------------- -------------------------------------------------- -----------------------------------对于试验,我调用了Thermistermeasure方法,该方法应该输出一个double。 但是,当我按以下顺序得到错误*“类型不匹配”*时。 Dim measuredValue As Double measuredValue = driver.Measure.ThermistorMeasure(“103”,Agilent34970Thermistor5000,Agilent34970MinMaxEnum.Agilent34970Def)*任何人都可以告诉我错误的原因。* PS。 我正在通过以下序列获得仪器制造商ID,固件版本等的模拟响应。 Dim instFirmwareRevision As String instFirmwareRevision = driver.Identity.InstrumentFirmwareRevision Dim instManufacturer As String instManufacturer = driver.Identity.InstrumentManufacturer 以上来自于谷歌翻译 以下为原文 Hi All, I am developing a program for interfacing Agilent 34972 over LAN & perform temperature measurements using thermisters. Until my company purchase the equipment, I try to use the simulator feature in the Agilent34970 IVI-COM Driver in VB. Have installed the drivers & shared components, added the references to the relevant drivers & enabled simulation [with simulation=true option] in driver init. as specified in docs. Init Code Sequence is as follows: ------------------------------------------------------------------------------- Dim resourceDesc As String resourceDesc = "TCPIP0::127.0.0.1::5025::SOCKET" ' Setup IVI-defined initialization options Dim standardInitOptions As String standardInitOptions = "Cache=false, InterchangeCheck=false, QueryInstrStatus=true, RangeCheck=false, RecordCoercions=false, Simulate=true" ' Setup driver-specific initialization options Dim driverSetupOptions As String driverSetupOptions = "DriverSetup= Model=34972A, Trace=false" driver.Initialize resourceDesc, False, False, standardInitOptions + "," + driverSetupOptions ----------------------------------------------------------------------------------------------------- For a trial , I invoked the Thermistermeasure method which should output a double. However, when I get an error *"Type mismatch"* at the following sequence. Dim measuredValue As Double measuredValue = driver.Measure.ThermistorMeasure("103", Agilent34970Thermistor5000, Agilent34970MinMaxEnum.Agilent34970Def) *Could anybody educate me the reason for the error.* PS. I am getting the simulated responses of the Instrument manuafacturer ID, firmware version etc with the following sequences. Dim instFirmwareRevision As String instFirmwareRevision = driver.Identity.InstrumentFirmwareRevision Dim instManufacturer As String instManufacturer = driver.Identity.InstrumentManufacturer |
|
相关推荐
3个回答
|
|
我很确定它会返回一个字符串。
当您获得34972A时,您可能需要查看可从产品网页agilent.com/find/34972A下载的免费Benchlink Datalogger SW。 我会检查我们的IVI司机小伙伴,让他知道他是否说不同。 以上来自于谷歌翻译 以下为原文 I'm pretty sure it returns a string. When you get your 34972A, you might want to take a look at the free Benchlink Datalogger SW you can download from the product web page agilent.com/find/34972A. I'll check with our IVI driver guy and let you know if he says different. |
|
|
|
tomc,感谢您的迅速回复。 我也试过字符串类型,但重复相同的错误。 此外,我一直在VB6& 我已将相同的代码移到VB2010,看它是否与ADE的版本有关。 现在,在VB2010中,它显示了一个错误*“对于调用thermistermeasure方法的同一行代码,”Double的1维数组的值'不能转换为'Double'“*。 将返回值分配给double的1D数组会导致值为零。 你对此有何看法? 我想我在这里没有得到正确的驱动模拟输出。 我也将等待你的司机专家评论。编辑:陈于2013年8月31日上午9:32 以上来自于谷歌翻译 以下为原文 tomc, Thanks for the prompt response. I have tried with string type as well, but same error repeats. Further, I have been working in VB6 & I have moved the same codes over to VB2010 to see if it is related to the version of ADE. Now, in VB2010, it shows an error *"Value of type '1-dimensional array of Double' cannot be converted to 'Double'"* for the same line of code that invoke the thermistermeasure method. Assigning the return value to a 1D array of double result in a value of zero. What's your opinion on this. I think I am not getting the correct driver simulation output here. I'll await for your driver experts comments, as well. Edited by: Chan on Aug 31, 2013 9:32 AM |
|
|
|
以下是司机专家的回复。
他现在没有设备验证它,但是......不,它是双倍的。 看起来问题是最后一项 - 枚举。 该字段期望为double,看起来enum是一个整数(大多数是)并且是负数。 就个人而言,我会发送一个数字来表示我想要的分辨率 - 比如0.1(这是C度):measuredValue = driver.Measure.ThermistorMeasure(“103”,Agilent34970Thermistor5000,0.10)或者如果他想尝试铸造它可能需要枚举 它(不确定,它可能错误,但也许值得一试):measuredValue = driver.Measure.ThermistorMeasure(“103”,Agilent34970Thermistor5000,(双)Agilent34970MinMaxEnum.Agilent34970Def) 以上来自于谷歌翻译 以下为原文 Here is the reply from the driver expert. He doesn't have the equipment right now to verify it but ... No, it is a double. Looks like the problem is the last item – the enum. That field is expecting a double, and it looks like the enum is an integer (most are) and is negative. Personally, I would send a number for what resolution I wanted – say 0.1 ( this is degrees C): measuredValue = driver.Measure.ThermistorMeasure("103", Agilent34970Thermistor5000, 0.10) or it may take the enum if he wants to try casting it (not sure, it may error, but maybe worth a try): measuredValue = driver.Measure.ThermistorMeasure("103", Agilent34970Thermistor5000, (double)Agilent34970MinMaxEnum.Agilent34970Def) |
|
|
|
只有小组成员才能发言,加入小组>>
1241 浏览 0 评论
2353 浏览 1 评论
2164 浏览 1 评论
2030 浏览 5 评论
2914 浏览 3 评论
987浏览 1评论
关于Keysight x1149 Boundary Scan Analyzer
717浏览 0评论
N5230C用“CALC:MARK:BWID?”获取Bwid,Cent,Q,Loss失败,请问大佬们怎么解决呀
817浏览 0评论
1244浏览 0评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-12-1 11:06 , Processed in 1.282840 second(s), Total 83, Slave 66 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号