完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
我正在将基于mfgr驱动程序的测试系统转换为使用VISA I / O库。
系统已经可靠运行了5 - 6年,没有命令(SCPI)或时序结构发生变化,但是当我使用VISA库时,我在大约1500次操作时得到“VI_ERROR_SYSTEM_ERROR”,导致软件在2次尝试后冻结 恢复。 最常见的仪器是66311D电源。 我知道这似乎是很多操作。 这些测试涉及16个DUT,100个测试和3个温度下的4个配置操作,以及在不同温度下对所有16个DUT进行100组测量,正如我之前所说,测试已经运行了几年。 一个DUT通常需要在一个温度下进行1000次仪器操作。 我使用的是Windows XP SP3,Agilent I / O Library 16.1,HP 66311D,HP 53181A,Aeroflex 2945B以及一些专有夹具。我无法在Internet或任何Agilent文档中找到相关参考。 任何帮助将不胜感激。 以上来自于谷歌翻译 以下为原文 I am converting a mfgr driver based test system to using the VISA I/O library. The system has worked reliably for 5-6 years and none of the command (SCPI) or timing structure has changed, but when I use the VISA library I get a "VI_ERROR_SYSTEM_ERROR" at about 1500 operations which causes the software to freeze after 2 tries to recover. The most common instrument involved is the 66311D power supply. I know this seems like a lot of operations. These tests involve 16 DUTs, 100 tests and 4 configuration operations at 3 temperatures and a group of 100 measurements at various temperatures for all 16 DUTs and as I indicated earlier the tests have been running for several years. One DUT typically requires 1000 instrument operations at one temperature. I am using Windows XP SP3, Agilent I/O Library 16.1, HP 66311D, HP 53181A, Aeroflex 2945B, and some proprietary fixtureing. I have been unable to find a relevant reference on the Internet or in any Agilent documentation. Any help will be appreciated. |
|
相关推荐
12个回答
|
|
嗨,我有点困惑。
在VISA之前使用的IO库是什么? 你能发布给你带来麻烦的代码吗? 以上来自于谷歌翻译 以下为原文 Hi, I am a little confused. What was the IO library used before VISA? Can you post the code that is giving you trouble? |
|
|
|
Thanks for the reply. Previous to to VISA the software ran on the driver supplied by the mfgr of the GPIB board, Measurements Computing.
Here's the code: Function WriteToInstrument(tq_num%, cmd$, rd_delay&) As String 'On Local Error GoTo errWrtInst Dim vi As Long 'Session to instrument Dim vi_status As Long Dim rSize As Long 'return byte count for read operation Dim strRes As String Static viDFRM As Long 'Sessions of Default Resource Manager Static wti_count% 'Debug.Print TQ_Model$(tq_num%) & " cmd$[" & cmd$ & "]" If wti_count% = 0 Then Track_VISA_Data "reset", whchInstr$, trkDFRM&, vi, trkStatus$, trkCmd$ wti_count% = 1 End If WriteToInstrument = "OK" sz% = -1 Select Case tq_num% Case Is = AMM% If TQ_Address$(AMM%) = TQ_Address$(PWS%) Then tq_num% = PWS% End If If TQ_BusParameters$(tq_num%) = "GPIB" And InStr(cmd$, "?") Then sz% = CInt((pwsPoints% + 1) * 12) 'Debug.Print RptLog$(tst_prc%) & " cmd$/sz%[" & cmd$ & "/" & sz% & "]" strRes = String(sz%, Chr$(32)) Else strRes = String(200, Chr$(32)) End If Case Else strRes = String(32, Chr$(32)) '200 End Select If viDFRM = 0 Then If cmd$ "release" Then 'Open the default resource manager session for valid devices Select Case TQ_BusParameters$(tq_num%) Case Is = "GPIB", "LAN", "LANtoGPIB", "LANtoMODBUS" vi_status = viOpenDefaultRM(viDFRM) Debug.Print "Open DRM " & "[" & viDFRM & "]" If vi_status VI_SUCCESS Then Track_VISA_Data "Open DRM", whchInstr$, viDFRM, vi, Hex(vi_status), Data_Filter(Trim(cmd$)) RptLog$(err_des%) = "Fail Open: Default Resource Manager session[" & Str(viDFRM) & "]" WriteToInstrument = "VISA Error!" viDFRM = 0 GoTo errWrtInst End If Case Else 'RS232, PCI, USB End Select End If End If If cmd$ = "release" Then If viDFRM > 0 Then Debug.Print "Close " & TQ_Model$(tq_num%) & "[" & viDFRM & "]" vi_status = viClose(viDFRM) viDFRM = 0 Exit Function Else Exit Function End If End If Select Case TQ_BusParameters$(tq_num%) Case Is = "GPIB" wti_count% = wti_count% + 1 'Debug.Print RptLog$(tst_prc%) & " wti_count%[" & wti_count% & "]" 'Open the session to the resource whchInstr$ = "GPIB1::" & TQ_Address$(tq_num%) & "::INSTR" vi_status = viOpen(viDFRM, whchInstr$, VI_NULL, VI_NULL, vi) trkDFRM& = viDFRM trkStatus$ = Hex(vi_status) trkCmd$ = Data_Filter(Trim(cmd$)) Track_VISA_Data "open", whchInstr$, trkDFRM&, vi, trkStatus$, trkCmd$ If vi_status VI_SUCCESS Then RptLog$(err_des%) = "viOpen session Failed[" & Hex(vi_status) & "][" & Format$(vi, "0") & "]" WriteToInstrument = "VISA Error!-tq_num%[" & Format$(tq_num%, "0") & "]" viDFRM = 0 GoTo errWrtInst End If 'write to device - rd_delay& = 0 Then cmd$ = cmd$ & vbLf vi_status = viWrite(vi, cmd$, Len(cmd$), rSize) If vi_status VI_SUCCESS Then RptLog$(err_des%) = "viWrite Failed[" & Hex(vi_status) & "]" WriteToInstrument = "VISA Error!-tq_num%[" & Format$(tq_num%, "0") & "]" 'Track_VISA_Data "viWrite", whchInstr$, trkDFRM&, vi, trkStatus$, trkCmd$ viDFRM = 0 GoTo errWrtInst End If Else rd_delay& = Abs(rd_delay&) End If 'Read the results as a string. If InStr(cmd$, "?") And rd_delay& > 0 Then '11.09.02 Sleep rd_delay& Select Case sz% 'tq_num% Case Is > 0 '= AMM% vi_status = viRead(vi, strRes, sz%, rSize) Case Else sz% = 64 vi_status = viRead(vi, strRes, sz%, rSize) End Select If vi_status VI_SUCCESS Then trkDFRM& = viDFRM trkStatus$ = Hex(vi_status) trkCmd$ = Data_Filter(Trim(cmd$)) Track_VISA_Data "read", whchInstr$, trkDFRM&, vi, trkStatus$, trkCmd$ 'If vi_status VI_SUCCESS_MAX_CNT Then RptLog$(err_des%) = "viRead Failed[" & Hex(vi_status) & "] byte count[" & Format$(sz%, "0") & "/" & Format$(rSize, "0") & "]" WriteToInstrument = "VISA Error!-tq_num%[" & Format$(tq_num%, "0") & "]" viDFRM = 0 GoTo errWrtInst End If 'Debug.Print "strRes[" & strRes & "]" dat_str$ = strRes WriteToInstrument = Data_Filter(Trim(dat_str$)) End If vi_status = viClose(vi) If vi_status VI_SUCCESS Then Track_VISA_Data "close vi", whchInstr$, trkDFRM&, vi, trkStatus$, trkCmd$ RptLog$(err_des%) = RptLog$(err_des%) & " Fail close:[" & Str(viDFRM) & "]" WriteToInstrument = "VISA Error!" End If 'If wti_count% >= 1500 Then ' vi_status = viClose(viDFRM) ' If vi_status VI_SUCCESS Then ' RptLog$(err_des%) = "Fail close:[" & Str(viDFRM) & "]" ' WriteToInstrument = "VISA Error!" ' End If ' viDFRM = 0 ' wti_count% = 0 'End If Case Is = "LAN" wti_count% = wti_count% + 1 'Debug.Print RptLog$(tst_prc%) & " wti_count%[" & wti_count% & "]" 'Open the session to the resource whchInstr$ = "TCPIP0::" & TQ_LanAddress$(tq_num%) & "::INSTR" vi_status = viOpen(viDFRM, whchInstr$, VI_NULL, VI_NULL, vi) trkDFRM& = viDFRM trkStatus$ = Hex(vi_status) trkCmd$ = Data_Filter(Trim(cmd$)) 'Track_VISA_Data "open", whchInstr$, trkDFRM&, vi, trkStatus$, trkCmd$ If vi_status VI_SUCCESS Then RptLog$(err_des%) = "viOpen session Failed[" & Hex(vi_status) & "][" & Format$(vi, "0") & "]" WriteToInstrument = "VISA Error!-tq_num%[" & Format$(tq_num%, "0") & "]" viDFRM = 0 GoTo errWrtInst End If 'write to device - rd_delay& = 0 Then cmd$ = cmd$ & vbLf vi_status = viWrite(vi, cmd$, Len(cmd$), rSize) If vi_status VI_SUCCESS Then RptLog$(err_des%) = "viWrite Failed[" & Hex(vi_status) & "]" WriteToInstrument = "VISA Error!-tq_num%[" & Format$(tq_num%, "0") & "]" 'Track_VISA_Data "viWrite", whchInstr$, trkDFRM&, vi, trkStatus$, trkCmd$ viDFRM = 0 GoTo errWrtInst End If Else rd_delay& = Abs(rd_delay&) End If 'Read the results as a string. If InStr(cmd$, "?") And rd_delay& > 0 Then '11.09.02 Sleep rd_delay& Select Case sz% 'tq_num% Case Is > 0 '= AMM% vi_status = viRead(vi, strRes, sz%, rSize) Case Else sz% = 64 vi_status = viRead(vi, strRes, sz%, rSize) End Select If vi_status VI_SUCCESS Then trkDFRM& = viDFRM trkStatus$ = Hex(vi_status) trkCmd$ = Data_Filter(Trim(cmd$)) 'Track_VISA_Data "read", whchInstr$, trkDFRM&, vi, trkStatus$, trkCmd$ 'If vi_status VI_SUCCESS_MAX_CNT Then RptLog$(err_des%) = "viRead Failed[" & Hex(vi_status) & "] byte count[" & Format$(sz%, "0") & "/" & Format$(rSize, "0") & "]" WriteToInstrument = "VISA Error!-tq_num%[" & Format$(tq_num%, "0") & "]" viDFRM = 0 GoTo errWrtInst End If 'Debug.Print "strRes[" & strRes & "]" dat_str$ = strRes WriteToInstrument = Data_Filter(Trim(dat_str$)) End If vi_status = viClose(vi) If vi_status VI_SUCCESS Then 'Track_VISA_Data "close vi", whchInstr$, trkDFRM&, vi, trkStatus$, trkCmd$ RptLog$(err_des%) = RptLog$(err_des%) & " Fail close:[" & Str(viDFRM) & "]" WriteToInstrument = "VISA Error!" End If Case Is = "LANtoGPIB" 'see Prologix note DoEvents 'Open the session to the resource whchInstr$ = "TCPIP0::" & TQ_LanAddress$(tq_num%) & "::" & TQ_LanPort$(tq_num%) & "::SOCKET" vi_status = viOpen(viDFRM, whchInstr$, VI_NULL, VI_NULL, vi) If vi_status VI_SUCCESS Then RptLog$(err_des%) = "viOpen session Failed[" & Hex(vi_status) & "]" WriteToInstrument = "VISA Error!-tq_num%[" & Format$(tq_num%, "0") & "]" vi_status = viClose(viDFRM) If vi_status VI_SUCCESS Then RptLog$(err_des%) = RptLog$(err_des%) & " Fail close:[" & Str(viDFRM) & "]" WriteToInstrument = "VISA Error!" End If viDFRM = 0 GoTo errWrtInst End If DoEvents 'write to device For n% = 1 To 3 lan_msg$ = Choose(n%, "++addr " & TQ_Address$(tq_num%), "++auto 0", cmd$) & vbLf vi_status = viWrite(vi, lan_msg$, Len(lan_msg$), rSize) If vi_status VI_SUCCESS Then RptLog$(err_des%) = "viWrite Failed[" & Data_Filter(Trim(lan_msg$)) & "/" & Hex(vi_status) & "]" WriteToInstrument = "VISA Error!-tq_num%[" & Format$(tq_num%, "0") & "]" vi_status = viClose(viDFRM) If vi_status VI_SUCCESS Then RptLog$(err_des%) = RptLog$(err_des%) & " Fail close:[" & Str(viDFRM) & "]" WriteToInstrument = "VISA Error!" End If viDFRM = 0 GoTo errWrtInst End If DoEvents Sleep 250 Next n% If InStr(cmd$, "?") Then DoEvents Dim strLAN As String * 64 Sleep rd_delay& lan_msg$ = "++read eoi" & vbLf vi_status = viWrite(vi, lan_msg$, Len(lan_msg$), rSize) If vi_status VI_SUCCESS Then RptLog$(err_des%) = "viWrite/Read Failed[" & Data_Filter(Trim(lan_msg$)) & "/" & Hex(vi_status) & "][" & rd_delay& & "]" WriteToInstrument = "VISA Error!-tq_num%[" & Format$(tq_num%, "0") & "]" vi_status = viClose(viDFRM) If vi_status VI_SUCCESS Then RptLog$(err_des%) = RptLog$(err_des%) & " Fail close:[" & Str(viDFRM) & "]" WriteToInstrument = "VISA Error!" End If viDFRM = 0 GoTo errWrtInst End If DoEvents 'Sleep 250 vi_status = viRead(vi, strLAN, 64, rSize) If vi_status VI_SUCCESS Then If vi_status VI_ERROR_TMO Then 'vi_status = viClose(vi) viDFRM = 0 RptLog$(err_des%) = "viRead Failed[" & Hex(vi_status) & "]" WriteToInstrument = "VISA Error!-tq_num%[" & Format$(tq_num%, "0") & "]" vi_status = viClose(viDFRM) If vi_status VI_SUCCESS Then RptLog$(err_des%) = RptLog$(err_des%) & " Fail close:[" & Str(viDFRM) & "]" WriteToInstrument = "VISA Error!" End If viDFRM = 0 GoTo errWrtInst End If End If dat_str$ = Trim(strLAN) 'strRes 'Debug.Print " [" & Data_Filter(Trim(dat_str$)) & "]" WriteToInstrument = Data_Filter(Trim(dat_str$)) Else WriteToInstrument = "" End If vi_status = viClose(vi) Case Is = "LANtoMODBUS" Case Else 'RS232, PCI, USB whchInstr$ = TQ_Model$(tq_num%) Select Case TQ_Model$(tq_num%) Case Is = "E3645A" 'Debug.Print "Write-TQ_Model$(tq_num%)[" & TQ_Model$(tq_num%) & "]" dat_str$ = PWS_E3645A(cmd$) WriteToInstrument = Data_Filter(Trim(dat_str$)) Case Is = "USB-2527", "PCI-DAS1602/12" If cmd$ = "*IDN?" Then WriteToInstrument = TQ_Model$(tq_num%) End If End Select End Select Exit Function errWrtInst: vi_status = viClose(vi) '11.09.16 RptLog$(err_src%) = "WriteToInstrument[" & whchInstr$ & "]" RptLog$(err_idn%) = Data_Filter(Trim(cmd$)) Test_Logs "visa" End Function |
|
|
|
嗨,您每次写入仪器时都会调用此子程序吗?
如果是这样,我建议您打开和关闭仪器一次,而不是每次向它们写命令。 如果发生某些事情并且会话没有正确关闭,那么由于开放会话太多,您将开始崩溃。 如果你在程序开头打开一次,你将大大减轻这一点。 它还可以使您的程序工作更快,因为您不需要每次发送命令时都打开VISA会话。 你可以尝试一下,让我知道它是否有效? 以上来自于谷歌翻译 以下为原文 Hi, Do you call this subroutine every single time that you write to the instrument? If so, I would recommend that you open and close your instruments once instead of every single time you write a command to them. If something happens and the session does not properly close, then you will start having crashes due to too many open session. If you open this once in the beginning of your program, you will alleviate this greatly. It will also make your program work a bit faster since you do not need to open a VISA session every single time you send a command. Can you give this a try and let me know if it works? |
|
|
|
我试一试。
你建议我在资源管理器会话中只打开一次仪器会话。对我来说是合理的。 我的日子快结束了,所以在我报告之前可能是明天。谢谢。 以上来自于谷歌翻译 以下为原文 I'll give it a try. You're suggesting that I open the instrument session only once as I do the resource manager session. Sounds reasonable to me. My day is nearly over so it will probably be tomorrow before I can report. Thanks. |
|
|
|
是。
在程序开头一次打开与要与之通信的每个仪器的VISA会话,并在程序退出时关闭一次。 我认为这将有助于解决您所看到的这个问题,并减少您与乐器沟通的时间。 您应该将所有子例程都执行此操作。 让我知道它是如何工作的。 以上来自于谷歌翻译 以下为原文 Yes. Open a VISA session with each instrument that you want to communicate with once at the beginning of your program and close it once when your program exits. I think that this will help with this issue that you are seeing and also decrease the amount of time that you are spending communicating with your instruments. You should do this will all your subroutines. Let me know how it works. |
|
|
|
我修改了代码,在初始化时打开每个仪器的会话,在测试运行结束时关闭。
我现在遇到系统中LXI仪器的问题,似乎与变化有关,但可能没有。 我正努力坚持下去。 当我知道新事物时,我会再次发帖。谢谢 以上来自于谷歌翻译 以下为原文 I have modified the code to open a session for each instrument on initialization and close at the end of the test run. I am now having problems with the LXI instrument in the system which seem to be related to the changes, but may not. I'm endeavoring to persevere. I'll post again when I know something new. Thanks |
|
|
|
|
|
|
|
RIGOL DSA1020频谱分析仪。
响应命令需要更长的时间,从VISA生成超时错误,而不是为每个操作打开和关闭会话。 GPIB操作似乎没问题。 以上来自于谷歌翻译 以下为原文 RIGOL DSA1020 spectrum analyzer. It takes longer to respond to commands, generating timeout errors from VISA, than when its session is opened and closed for each operation. The GPIB operations seem to be OK. |
|
|
|
当您使用LAN仪器打开VISA会话时,它应该在打开一次时与GPIB仪器相同。
我从未遇到过与我合作的Agilent LXI产品(N6700电源)的任何问题。您可能想问Rigol。 您是否在66311上看到任何系统错误? 以上来自于谷歌翻译 以下为原文 When you open a VISA session with a LAN instrument it should behave same as a GPIB instrument in terms of opening once. I have never run into any issues with the Agilent LXI products that I work with (the N6700 power supplies). You may want to ask Rigol about this. Are you seeing any system errors on the 66311 at all? |
|
|
|
目前66311运行正常,但是由于LXI问题,我无法运行足够的测试来验证原始问题的修复。我在初始“* RST,* IDN之后从RIGOL得到”VI_ERROR_CONN_LOST“错误?
“ 序列。 我正在使用固定的IP地址,这可能是导致连接丢失的原因以及为什么当我打开并关闭每个命令序列的会话时它不是问题。 我会在早上和使用DHCP时看到它(因为IT人员说可以尝试)。 以上来自于谷歌翻译 以下为原文 Currently the 66311 is running fine, however with the LXI problem I am unable to run enough tests to verify a fix for the original problem. I'm getting a "VI_ERROR_CONN_LOST" error from the RIGOL after the initial "*RST, *IDN?" sequence. I'm using a fixed IP address which may be why the connection is getting lost and why it was not a problem when I opened and closed the session for every command sequence. I'll be looking at that in the morning and at using DHCP (since the IT guy said it would be OK to try). |
|
|
|
到目前为止,我还没有成功解决我的LXI问题。
所以,我构建了一个测试来解决我的原始问题和MattC建议的解决方案。我运行了一个测试循环,制作了一个“:MEAS Volt?” 在我的系统中对66311电源进行3000次迭代的指令。 它使得它最终没有打嗝,所以我的工作假设,直到我可以进行完整的测试,是保持仪器会话打开确实解决了我的问题。 谢谢您的帮助! 以上来自于谷歌翻译 以下为原文 So far I haven't had any success in resolving my LXI problem. So, I constructed a test to address my original problem and the solution suggested by MattC. I ran a test loop making a ":MEAS Volt?" instruction to the 66311 power supply in my system for 3000 iterations. It made it to the end without a hiccup so my working assumption, until I can run a complete test, is that keeping the instrument session open does solve my problem. Thanks for the Help! |
|
|
|
我很高兴听到它有效。
如果您能够解决LXI问题,请告诉我们! 以上来自于谷歌翻译 以下为原文 I am glad to hear that it works. Let me know if you are able to resolve the LXI issue too! |
|
|
|
只有小组成员才能发言,加入小组>>
1271 浏览 0 评论
2371 浏览 1 评论
2187 浏览 1 评论
2061 浏览 5 评论
2943 浏览 3 评论
1082浏览 1评论
关于Keysight x1149 Boundary Scan Analyzer
744浏览 0评论
N5230C用“CALC:MARK:BWID?”获取Bwid,Cent,Q,Loss失败,请问大佬们怎么解决呀
902浏览 0评论
1271浏览 0评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-12-18 17:54 , Processed in 1.669186 second(s), Total 99, Slave 82 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号