-1

查看电源文档中提供的示例。通过在 C# 中添加两个库 AgilentRMLib 和 VisComLib 来完成编程。当我尝试通过选择添加参考->安捷伦 VISA COM 资源管理器 1.0 添加 AgilentRMLib 时,参考中显示错误。

我尝试直接从 Program Files 添加 agtRM.dll。错误仍然存​​在。有没有人遇到过这个问题?有什么解决方案吗?您是否有任何其他方法可以使用 Agilent IO 从 PC 对电源进行编程。

4

3 回答 3

0

当您使用 GPIB 协议时,最好使用 GPIB 库和包装器,然后使用本机 SCPI 命令进行编码。这样,您的软件将更加依赖于您的应用程序,您几乎可以控制一切。使用 VISA 接口,您不必担心另一层,但通过这种方法,您可以直接有效地控制您的设备。我与 VISA 合作了几年,但经过那段艰苦的工作,现在我可以通过直接 GPIB 编程来构建我的测量系统。您可以从 NI 或 Agilent 的网站上找到所需的库。

于 2014-08-23T00:13:11.693 回答
0

如果您不介意使用 VBA,此代码可以帮助您完成您正在尝试做的事情,请确保它在参考中具有 VISA COM 488.2 格式化 I/O:

Public Sub TestVISA()
    Dim Dev_IO As VisaComLib.FormattedIO488
    Dim io_manager As VisaComLib.ResourceManager

'Start of Open GPIB port (or any VISA resource)
    Set io_manager = New VisaComLib.ResourceManager
    Set Dev_IO = New VisaComLib.FormattedIO488
    Set Dev_IO.IO = io_manager.Open("GPIB0::x::INSTR")    ' x is the GPIB address number of the Dev_IOument
    Set io_manager = Nothing
    Dev_IO.IO.Timeout = 10000  'set time out to 10 seconds, use this line to change timeout to any time out value per VISA spec
'End of Open GPIB port

'Send some SCPI command to the Dev_IOumnet
    Dev_IO.WriteString ("*IDN?")
    MsgBox ("Connected to: " & Dev_IO.ReadString)

'Close the port upon completion
    Dev_IO.IO.Close
    Set Dev_IO = Nothing 'release the object

End Sub
于 2014-07-26T19:18:43.057 回答
0

我能够使用 VisaComLib(GlobMgr.dll) 来使用 C# 编程语言对 GPIB 进行编程。pdf文件链接!被用作参考。

于 2012-09-13T04:51:42.987 回答