完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
电子发烧友论坛|
嗨,我正在尝试使用最新的IVICom driver_ivicom_ivic_Agilent34410_1_0_22_0.msi通过u***与34410连接,但它在所有功能上返回错误值“9,9E37”,虽然它会改变功能电压,电阻等,但是当IO Monitor返回正确值时
运行。 使用driver_ivicom_ivic_Agilent34410_1_0_19_0.msi一切正常。 提前致谢。 以上来自于谷歌翻译 以下为原文 Hi, I'm trying to connect with 34410 through u*** using latest IVICom driver_ivicom_ivic_Agilent34410_1_0_22_0.msi, but it return wrong value "9,9E37" on all functions, though it changes function voltage, resistance e.t.c, however it return right value when IO Monitor is runned. With driver_ivicom_ivic_Agilent34410_1_0_19_0.msi all work fine. Thanks in advance. |
|
相关推荐
14个回答
|
|
|
|
|
|
|
|
|
//函数创建驱动程序void __fastcall CreateDRV(){HRESULT hr; IIviDriver * pInknown = NULL; // IAgilent34405 pAg34405 = NULL; const int tmp_size = 1024; char ch_temp1 [tmp_size] = {0}; char ch_temp2 [tmp_size] = {0}; wchar_t wchProgID [tmp_size] = {0}; wchar_t wchResource [tmp_size] = {0}; wchar_t wchLN [tmp_size] = {0}; wchar_t * pwcDrvSetup = L“QueryInstrStatus = false,Simulate = false,Cache = false”; wchar_t * pwcRDes = NULL; 简短的shInit; CLSID clsid; bool bUseLogicalName; bUseLogicalName = CheckBoxUseConfigStore->已检查; EditLogicalName-> Text.WideChar(wchLN,tmp_size); 试试{if(pIviDmm){pIviDmm-> Close(); pIviDmm->释放(); } if(bUseLogicalName){hr = spFactory-> CreateDriver(wchLN,(IUnknown **)& pInknown); hr = pInknown-> QueryInterface(IID_IIviDmm,(void **)& pIviDmm); if(!SUCCEEDED(hr)){TraceError(Handle); }} else {//通过ProgID EditProgID-> Text.WideChar创建(wchProgID,tmp_size); hr = CLSIDFromProgID(wchProgID,& clsid); hr = :: CoCreateInstance(clsid,NULL,CLSCTX_ALL,IID_IIviDmm,(void **)& pIviDmm); if(!SUCCEEDED(hr)){TraceError(Handle); if(pIviDmm){IIviDriverIdentity * pDI = NULL; wchar_t * pCroupCpb = NULL; EditResource-> Text.WideChar(wchResource,tmp_size); if(bUseLogicalName){hr = pIviDmm-> Initialize(wchLN,VARIANT_TRUE,VARIANT_TRUE,pwcDrvSetup); if(!SUCCEEDED(hr)){TraceError(Handle); } hr = pIviDmm-> get_Initialized(& shInit); } else {// wchResource EditResource-> Text.WideChar(wchResource,tmp_size); hr = pIviDmm-> get_Initialized(& shInit); hr = pIviDmm-> Initialize(wchResource,VARIANT_TRUE,VARIANT_TRUE,pwcDrvSetup); hr = pIviDmm-> get_Initialized(& shInit); } hr = pIviDmm-> QueryInterface(& pDI); TraceError2(hr,Handle); hr = pDI-> get_GroupCapabilities(& pCroupCpb); TraceError2(hr,Handle); if(SUCCEEDED(hr)){ListBoxGroupCap-> Items-> Clear(); ListBoxGroupCap-> Items-> CommaText = pCroupCpb; } if(pDI)pDI-> Release(); if(pInknown){pInknown-> Release(); pInknown = NULL; } hr = pIviDmm-> get_DriverOperation(& pDriverOp); if(SUCCEEDED(hr)){hr = pDriverOp-> get_IoResourceDescriptor(& pwcRDes); hr = pRM-> Open(pwcRDes,NO_LOCK,200,NULL,& pVSession); if(SUCCEEDED(hr)){hr = pVSession-> QueryInterface(IID_IMessage,(void **)& pMess); 长lTimeOut; pMess-> get_Timeout(& lTimeOut); pMess-> set_Timeout(5000); hr = fmioPtr - > _ set_IO(pMess); ThrowError(小时); } if(pDriverOp){pDriverOp-> Release(); pDriverOp = NULL; ButtonRead-> Enabled = true; catch(_com_error e){sprintf(ch_temp1,“Add HardwareAsset failed。 n”); sprintf(ch_temp2,“错误描述是:%s n”,(char *)e。描述()); MessageBox(句柄,ch_temp1,ch_temp2,MB_ICONERROR | MB_OK); // ---------------------------------- //获得结果// ----- ----------------------------- void __fastcall TForm1 :: ButtonReadClick(TObject * Sender){HRESULT hr; 双倍的结果; BSTR pwchError = NULL; long lErrCode; IIviDmmMeasurement * pIviDmmMeas = NULL; IIviDriverUtility * pIviDU = NULL; // if(RadioGroupFunction-> ItemIndex ==)try {try {//设置度量函数// IviDmmFunctionDCVolts,// IviDmmFunctionACVolts,// IviDmmFunctionDCCurrent,等hr = pIviDmm-> set_Function(DmmFuncArr [RadioGroupFunction-> ItemIndex]); ThrowError(小时); hr = pIviDmm-> get_Measurement(& pIviDmmMeas); ThrowError(小时); hr = pIviDmmMeas-> Read(EditTimeOut-> Text.ToInt(),& dResult); ThrowError(小时); hr = pIviDmmMeas-> Abort(); ThrowError(小时); EditResult-> Text = dResult; } catch(HRESULT& hr2){TraceError(Handle); } __finally {if(pIviDmmMeas)pIviDmmMeas-> Release(); }} 以上来自于谷歌翻译 以下为原文 //Function create the driver void __fastcall CreateDRV() { HRESULT hr; IIviDriver *pInknown = NULL; // IAgilent34405 pAg34405 = NULL; const int tmp_size = 1024; char ch_temp1[ tmp_size ] = {0}; char ch_temp2[ tmp_size ] = {0}; wchar_t wchProgID[ tmp_size ] = {0}; wchar_t wchResource[ tmp_size ] = {0}; wchar_t wchLN[ tmp_size ] = {0}; wchar_t *pwcDrvSetup = L"QueryInstrStatus=false, Simulate=false, Cache=false"; wchar_t *pwcRDes = NULL; short shInit; CLSID clsid; bool bUseLogicalName; bUseLogicalName = CheckBoxUseConfigStore->Checked; EditLogicalName->Text.WideChar( wchLN , tmp_size ); try { if( pIviDmm ) { pIviDmm->Close(); pIviDmm->Release(); } if( bUseLogicalName ) { hr = spFactory->CreateDriver( wchLN , (IUnknown**)&pInknown ); hr = pInknown->QueryInterface( IID_IIviDmm , (void**)&pIviDmm ); if( !SUCCEEDED( hr ) ) { TraceError( Handle ); } } else { //Create through ProgID EditProgID->Text.WideChar( wchProgID, tmp_size ); hr = CLSIDFromProgID( wchProgID , &clsid ); hr = ::CoCreateInstance( clsid, NULL, CLSCTX_ALL, IID_IIviDmm, (void**)&pIviDmm); if( !SUCCEEDED( hr ) ) { TraceError( Handle ); } } if( pIviDmm ) { IIviDriverIdentity *pDI = NULL; wchar_t *pCroupCpb = NULL; EditResource->Text.WideChar( wchResource , tmp_size ); if( bUseLogicalName ) { hr = pIviDmm->Initialize( wchLN , VARIANT_TRUE , VARIANT_TRUE , pwcDrvSetup ); if( !SUCCEEDED( hr ) ) { TraceError( Handle ); } hr = pIviDmm->get_Initialized( &shInit ); } else { //wchResource EditResource->Text.WideChar( wchResource , tmp_size ); hr = pIviDmm->get_Initialized( &shInit ); hr = pIviDmm->Initialize( wchResource , VARIANT_TRUE , VARIANT_TRUE , pwcDrvSetup ); hr = pIviDmm->get_Initialized( &shInit ); } hr = pIviDmm->QueryInterface( &pDI ); TraceError2( hr , Handle ); hr = pDI->get_GroupCapabilities( &pCroupCpb ); TraceError2( hr , Handle ); if( SUCCEEDED(hr) ) { ListBoxGroupCap->Items->Clear(); ListBoxGroupCap->Items->CommaText = pCroupCpb; } if( pDI ) pDI->Release(); if( pInknown ) { pInknown->Release(); pInknown = NULL; } hr = pIviDmm->get_DriverOperation( &pDriverOp ); if( SUCCEEDED(hr) ) { hr = pDriverOp->get_IoResourceDescriptor( &pwcRDes ); hr = pRM->Open( pwcRDes , NO_LOCK, 200 , NULL , &pVSession ); if( SUCCEEDED(hr) ) { hr = pVSession->QueryInterface( IID_IMessage , (void**)&pMess ); long lTimeOut; pMess->get_Timeout( &lTimeOut ); pMess->set_Timeout( 5000 ); hr = fmioPtr->_set_IO(pMess); ThrowError( hr ); } if( pDriverOp ) { pDriverOp->Release(); pDriverOp = NULL; } } ButtonRead->Enabled = true; } } catch( _com_error e ) { sprintf( ch_temp1 , "Add HardwareAsset failed.n"); sprintf( ch_temp2 , "Error description is: %sn",(char*)e.Description()); MessageBox( Handle , ch_temp1, ch_temp2, MB_ICONERROR|MB_OK ); } } //---------------------------------- //Getting the result //---------------------------------- void __fastcall TForm1::ButtonReadClick(TObject *Sender) { HRESULT hr; double dResult; BSTR pwchError = NULL; long lErrCode; IIviDmmMeasurement *pIviDmmMeas = NULL; IIviDriverUtility *pIviDU = NULL; // if( RadioGroupFunction->ItemIndex == ) try { try { // Set the measure function // IviDmmFunctionDCVolts, // IviDmmFunctionACVolts, // IviDmmFunctionDCCurrent, etc hr = pIviDmm->set_Function( DmmFuncArr[ RadioGroupFunction->ItemIndex ] ); ThrowError( hr ); hr = pIviDmm->get_Measurement( &pIviDmmMeas ); ThrowError( hr ); hr = pIviDmmMeas->Read( EditTimeOut->Text.ToInt() , &dResult ); ThrowError( hr ); hr = pIviDmmMeas->Abort(); ThrowError( hr ); EditResult->Text = dResult; } catch(HRESULT &hr2) { TraceError( Handle ); } } __finally { if(pIviDmmMeas) pIviDmmMeas->Release(); } } |
|
|
|
|
春江花水 发表于 2019-10-14 09:44 我使用34410A IVI-COM驱动程序(读取直流电压)附加了最简单的示例。 它内置Visual Studio 2010和最新的34410A IVI-COM驱动程序。 如果你没有VS2010,我还会单独附加.cpp文件。 尝试使用您的驱动程序,看看它是否正常工作。 如果IO Monitor正在改变行为,我会说这可能是一个时间问题。 您可能希望将Timeout设置为更高的值。 我无法编译你的代码,所以我看不出你的问题在哪里。 如果您共享一个简单的控制台示例,向我发送所有项目文件以构建它并告诉我构建它需要哪个版本的Visual Studio将会很有帮助。 Example1Cpp.cpp2.0 KB 以上来自于谷歌翻译 以下为原文 I've attached the simplest example using the 34410A IVI-COM driver (read a DC voltage). Its built with Visual Studio 2010, and the latest 34410A IVI-COM driver. I've also attached the .cpp file separately, if you don't have VS2010. Try it out with your driver and see if it works correctly. If IO Monitor is changing the behavior, I'd say it might be a timing issue. You might want to set your Timeout to a higher value. I couldn't compile your code, so I couldn't see where your problem was. It would be helpful if you shared a simple console example, send me all of the project files to build it and tell me what version of Visual Studio I need to build it it in. 附件
|
|
|
|
|
|
我试过你的例子,它有效。
但我想获得interchangibility所以我使用IID_IIviDmm结束它不适用于1.0.11.0版本。 我使用C ++ Builder,所以我会尝试在VisualStudio中创建一个简单的控制台应用程序,并检查它是否工作,我会发送给你。 我同意,似乎超时问题,但是哪个? 它不会对IIviDmmMeasurement :: Read中的超时做出反应(long MaxTimeMilliseconds,double * retval); 我为IIviDmmMeasurement :: Read尝试了超过10000毫秒的超时,仪器甚至没有尝试测量,返回值是“9,91E37,但它改变了功能。如果我一步一步执行程序,仪器进行测量但返回结果 在programm中是“9,91E37”虽然在34410的显示上出现了更好的结果。似乎IIviDmmMeasurement :: Read不要等待DMM。 以上来自于谷歌翻译 以下为原文 I've tryed your example, it works. But i would like to get interchangibility so i use IID_IIviDmm end it dont work with 1.0.11.0 version. I use C++Builder so it better i'll try create a simple console application in VisualStudio and check it if don't work i'll send you. I agree, it seems that problem in timeout, but which? It dont react on timeout in IIviDmmMeasurement::Read( long MaxTimeMilliseconds, double* retval); I tryed up to 10000 ms timeout for IIviDmmMeasurement::Read and the instrument even dont try to measure, return value is "9,91E37, but it changes functions. If i execute programm step by step the instrument make the measuring but the returning result in programm is "9,91E37" though on display of 34410 appear righr result. It seems that IIviDmmMeasurement::Read dont wait DMM. |
|
|
|
|
春江花水 发表于 2019-10-14 10:10 我更新了我的例子以使用IIviDMM接口,它似乎工作正常。 我注意到的一件事是,在你的代码中你只设置了测量功能,你没有设置像分辨率或范围这样的东西。 那么,你可能会看到范围的问题? 我附上了我最新的例子。 我使用Configure方法设置测量参数。 以上来自于谷歌翻译 以下为原文 I updated my example to use the IIviDMM interface, and it seems to work ok. One thing I noticed was that in your code you were only setting the Measurement function, you weren't setting things like resolution, or range. So, you could be seeing a problem with the range? I've attached my latest example. I use the Configure method to set the measurement parameters. 附件
|
|
|
|
|
MAX_zuo 发表于 2019-10-14 10:26 感谢您的操作回复。是的,它适用于手动范围,但我认为默认情况下自动量程中的功能,我需要自动量程。 如何设置AutoRange? HRESULT配置(IviDmmFunctionEnum函数,双范围,双分辨率); 范围测量范围。 正值表示预期的最大测量值的绝对值。 驱动程序将此值强制转换为仪器的适当范围。 负值表示自动量程模式。 如果Range参数的值为Auto Range On,则忽略Resolution参数。 我尝试将范围设置为负值,pIviDmm-> Configure(IviDmmFunctionDCVolts,-1,1); 但是发生错误311,“无法使用自动范围指定分辨率”。 哪里错了?编辑:gumanist于2012年4月5日晚上11:08 以上来自于谷歌翻译 以下为原文 Thank you for an operative reply.Yes it works with manual ranges, But I supposed that functions in autorange by default, and I need autorange. How to set AutoRange? HRESULT Configure( IviDmmFunctionEnum Function, double Range, double Resolution ); Range The measurement range. Positive values represent the absolute value of the maximum measurement expected. The driver coerces this value to the appropriate range for the instrument. Negative values represent the Auto Range mode. If the value of the Range parameter is Auto Range On, then the Resolution parameter is ignored. I try to set the range to negative value, pIviDmm->Configure( IviDmmFunctionDCVolts, -1, 1); but occure error 311, "Not able to specify resolution with Auto range". Where's my wrong? Edited by: gumanist on Apr 5, 2012 11:08 PM |
|
|
|
|
春江花水 发表于 2019-10-14 10:33 这看起来像34410A驱动程序中的错误。 它应该知道自己的局限性,并在使用自动范围时忽略分辨率参数(我将提交一个bug)。 变通方法:所以,不要使用Configure,而是使用以下命令:pIviDmm-> Function = IviDmmFunctionEnum :: IviDmmFunctionDCVolts; pIviDmm->范围= -1; //使用自动量班时不设置分辨率 以上来自于谷歌翻译 以下为原文 This looks like a bug in the 34410A driver. It should know its own limitations and ignore the resolution parameter when using Auto Range (I'll submit a bug). WORKAROUND: So, rather than use Configure, use the following: pIviDmm->Function = IviDmmFunctionEnum::IviDmmFunctionDCVolts; pIviDmm->Range = -1; //don't set the resolution when using Auto Ranging |
|
|
|
|
|
好的,所以在这种情况下(autorange)驱动程序返回“9.91E37”(但DMM测量)它不等待DMM,它也是bug?
以上来自于谷歌翻译 以下为原文 Ok, so in this case (autorange) the driver return "9.91E37" (however DMM measures) it does not wait DMM, it is bug too? |
|
|
|
|
|
我认为这个价值意味着“超载”。
您向DMM提供了什么信号? 以上来自于谷歌翻译 以下为原文 I think that value means "Overload". What signal are you supplying to the DMM? |
|
|
|
|
|
例如,我测量电阻,测试引线短路,自动量程设置,双倍dResult; IIviDmmMeasurement * pIviDmmMeas = NULL; IIviDriverUtility * pIviDU = NULL; HRESULT小时; hr = pIviDmm-> set_Function(IviDmmFunction2WireRes); hr = pIviDmm-> set_Range(-1); hr = pIviDmm-> get_Measurement(& pIviDmmMeas); hr = pIviDmmMeas-> Read(1000,& dResult); 在这种情况下,在DMM显示屏上显示:“000.205 OHM”pIviDmmMeas-> Read(1000,& dResult); 返回dResult = 9.91e + 37测量具有短路引线和自动量程的VDC:dmm:000.009 mVDC驱动器:9.91e + 37测量ACV线路电压,自动量程:dmm:0,217.850 VAC驱动器:9.91e + 3如果我为VDC设置范围100V: hr = pIviDmm-> set_Function(IviDmmFunctionDCVolts); hr = pIviDmm-> Configure(IviDmmFunctionDCVolts,100,1); hr = pIviDmm-> get_Measurement(& pIviDmmMeas); hr = pIviDmmMeas-> Read(1000,& dResult); dmm:0,000.01 VDC驱动程序:0.0120981252它可以工作! 慢速功能也不适用于范围(例如VAC,Frec),只有像VDC或2WRES这样的快速功能才有时间将值返回给驱动程序。 所有这些都与老司机合作。 以上来自于谷歌翻译 以下为原文 for example i measure resistance, the test leads are shorted, autorange is set, double dResult; IIviDmmMeasurement *pIviDmmMeas = NULL; IIviDriverUtility *pIviDU = NULL; HRESULT hr; hr = pIviDmm->set_Function(IviDmmFunction2WireRes ); hr = pIviDmm->set_Range(-1); hr = pIviDmm->get_Measurement( &pIviDmmMeas ); hr = pIviDmmMeas->Read( 1000 , &dResult ); in this case on DMM display appears: "000.205 OHM" pIviDmmMeas->Read( 1000 , &dResult ); return dResult = 9.91e+37 measuring VDC with shorted leads and autorange: dmm: 000.009 mVDC driver: 9.91e+37 measuring ACV line voltage, autorange: dmm: 0,217.850 VAC driver: 9.91e+3 if I set range 100V for VDC: hr = pIviDmm->set_Function( IviDmmFunctionDCVolts ); hr = pIviDmm->Configure( IviDmmFunctionDCVolts, 100, 1); hr = pIviDmm->get_Measurement( &pIviDmmMeas ); hr = pIviDmmMeas->Read( 1000 , &dResult ); dmm: 0,000.01 VDC driver: 0.0120981252 it works! slow functions dont work with range too (VAC, Frec for example), only fast function like VDC or 2WRES have time to return value to the driver. And all this work with old driver. |
|
|
|
|
|
|
|
|
|
|
|
_Sorry,我错过了你的上一篇文章._这似乎是驱动程序中的一个错误。
我可以在旧驱动程序中看到正确的行为,并且我在新驱动程序中看到了破坏的行为。 此时的解决方法是使用特定于Agilent的界面。 我将此作为驱动程序的缺陷提交,并在更新的驱动程序发布时更新此帖子。编辑:hognala于2012年4月23日下午4:56 以上来自于谷歌翻译 以下为原文 _Sorry, I missed your last post._ It appears to be a bug in the driver. I can see correct behavior in the old driver and I see broken behavior in the new driver. The workaround at this point is to use the Agilent-specific interface. I'll submit this as a defect on the driver, AND update this post when the updated driver has been released. Edited by: hognala on Apr 23, 2012 4:56 PM |
|
|
|
|
MAX_zuo 发表于 2019-10-14 12:01 好的,我会在这种情况下使用旧的驱动程序,因为我需要一个可互换性。 还有一个问题,功能的可互换性:diod,连续性,电容? 以上来自于谷歌翻译 以下为原文 Ok, i'll use the old driver in this case, because i need an interchangeability. And one more question, is there interchangeability for the functions: diod, continuity, capacitance? |
|
|
|
|
|
根据www.ivifoundation.org上的IviDmm规范,我会说不。
以上来自于谷歌翻译 以下为原文 Based on the IviDmm spec at www.ivifoundation.org, I'd say no. |
|
|
|
|
只有小组成员才能发言,加入小组>>
1844 浏览 0 评论
2739 浏览 1 评论
2640 浏览 1 评论
2449 浏览 5 评论
3458 浏览 3 评论
1844浏览 0评论
417浏览 0评论
/9
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2025-12-2 03:46 , Processed in 3.946196 second(s), Total 100, Slave 83 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191

淘帖
1730