1
完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
扫一扫,分享给好友
我已经找到了很多关于如何使用VB6捕获跟踪的示例,但没有使用VB.net。
只有viScanf可用于VB.net如何使用viScanf获取跟踪? 以上来自于谷歌翻译 以下为原文 I have found plenty of examples of how to capture the trace using VB6, but nothing utilizing VB.net. Only viScanf is available for VB.net How do I grab the trace using viScanf? |
|
相关推荐
1个回答
|
|
嗨 - 这是一个如何使用VISA-Com从VB.NET中读取分析器ID字符串的示例。
Dim status as Long Dim idn As String Dim drm as Ivi.Visa.Interop.ResourceManager Dim vi as Ivi.Visa.Interop.FormattedIO488 drm = New Ivi.Visa.Interop.ResourceManager vi = New Ivi.Visa.Interop.FormattedIO488'Attempt 连接到信号分析器尝试vi.IO = drm.Open(“GPIB0 :: 18 :: INSTR”)Catch ex As Exception返回False End尝试'从分析器获取IDN字符串status = vi.IO.WriteString(“* IDN?“+ Chr(10)”如果状态返回False结束如果idn = vi.IO.ReadString(100)要另外回读跟踪数据,您可以通过两种方式执行此操作。 您可以将数据格式更改为Real,64并对数据执行binblock读取。 您还可以将数据读回为逗号分隔数据的ASCII字符串。 binblock读取速度要快得多。 这里基本上是如何在C#中以binblock格式回读跟踪数据的。 您可以将此代码转换为VB.NET SA.WriteString(“INIT:CONT OFF n”); //将分析仪放入单扫描SA.WriteString(“FORM:DATA REAL,64 n”); //将数据类型设置为binblock real,64 SA.WriteString(“INIT:IMM; * OPC?”); //进行扫描并等待扫描完成Double opc = SA.Readnumber(IEEEASCIIType.ASCIIType_UI1,true); //回读1 SA.WriteString(“TRACE:DATA?TRACE1”); double [] trace = new double [1000]; trace = SA.ReadIEEEBlock(IEEEBinaryType.BinaryType_R8,true); 问候 - 以上来自于谷歌翻译 以下为原文 Hi - Here’s an example how to use VISA-Com to read back the ID string from the analyzer in VB.NET. Dim status As Long Dim idn As String Dim drm as Ivi.Visa.Interop.ResourceManager Dim vi as Ivi.Visa.Interop.FormattedIO488 drm = New Ivi.Visa.Interop.ResourceManager vi = New Ivi.Visa.Interop.FormattedIO488 'Attempt to connect to the Signal Analyzer Try vi.IO = drm.Open("GPIB0::18::INSTR") Catch ex As Exception Return False End Try 'Get IDN String from the analyzer status = vi.IO.WriteString("*IDN?" + Chr(10)) If status < Ivi.Visa.Interop.VisaStatusCode.S_VISA_SUCCESS Then Return False End If idn = vi.IO.ReadString(100) To additionally read back the trace data, you can do this two ways. You can change the data format to Real,64 and do a binblock read of the data. You can also, read back the data as an ASCII string of comma separated data. The binblock read is much faster. Here’s basically how you would read back the trace data in binblock format in C#. You can convert this code to VB.NET SA.WriteString("INIT:CONT OFFn"); // put the analyzer in single sweep SA.WriteString("FORM:DATA REAL,64n"); // set the data type to binblock real,64 SA.WriteString("INIT:IMM;*OPC?"); // take a sweep and wait for the sweep to complete Double opc = SA.Readnumber(IEEEASCIIType.ASCIIType_UI1, true); // read back 1 SA.WriteString(“TRACE:DATA? TRACE1”); double[] trace = new double[1000]; trace = SA.ReadIEEEBlock(IEEEBinaryType.BinaryType_R8, true); Regards - |
|
|
|
只有小组成员才能发言,加入小组>>
1285 浏览 0 评论
2373 浏览 1 评论
2192 浏览 1 评论
2064 浏览 5 评论
2948 浏览 3 评论
1105浏览 1评论
关于Keysight x1149 Boundary Scan Analyzer
752浏览 0评论
N5230C用“CALC:MARK:BWID?”获取Bwid,Cent,Q,Loss失败,请问大佬们怎么解决呀
923浏览 0评论
1285浏览 0评论
小黑屋| 手机版| Archiver| 德赢Vwin官网 ( 湘ICP备2023018690号 )
GMT+8, 2024-12-23 08:04 , Processed in 1.163054 second(s), Total 44, Slave 38 queries .
Powered by 德赢Vwin官网 网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
德赢Vwin官网 观察
版权所有 © 湖南华秋数字科技有限公司
德赢Vwin官网 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号