您好S.Crider,您正在使用VISA COM与.NET语言提供的互操作。
您已正确创建资源管理器,现在需要创建FormattedIO488对象来控制3497x。
您将使用其writestring和readstring函数来发送SCPI命令。
首先,您需要将VISA COM 3.0类型库和VISA COM 488.2格式化I / O引用导入到项目中。
这是一个简单的VB.NET VISA COM / USB示例,它发送idn命令:---------------------------- Sub Main()
Dim ioMgr As Ivi.Visa.Interop.ResourceManager Dim instrument As Ivi.Visa.Interop.FormattedIO488 Dim idn As String ioMgr = New Ivi.Visa.Interop.ResourceManager instrument = New Ivi.Visa.Interop.FormattedIO488'创建更多FormatedIO488对象
控制其他仪器在ACE的VISA仪器地址中的位置,常见的别名是USBInstrument1 instrument.IO = ioMgr.Open(“USBInstrument1”)instrument.WriteString(“* IDN?”)'用于发送命令idn = instrument.ReadString
()'用于MsgBox(“IDN字符串是:”& idn,vbOKOnly,“IDN结果”)End Sub -----------------------
---- Agilent Connection Expert附带有关VISA COM使用的文档。
一个很好的入门指南可以在这里找到:http://cp.literature.agilent.com/litweb/pdf/5989-6338EN.pdf有关创建/设置扫描的SCPI VB示例,请参阅34970/34972产品页面
list(它们共享相同的命令)。
下面是一组用于设置DCV /温度扫描列表的SCPI命令-----------------------------#配置3497x数据采集
单元收集温度和直流电压测量。
通过软件触发器启动采集。
此示例测量通道1-10为C型热电偶温度(Celcius)和通道11-20(直流电压)。
##运行说明:#1。设置多路复用器卡进行温度和电压测量(见下文)。
#2。将多路复用器卡插入第一个插槽。
#3。在connect语句中更新仪器地址。
#4。运行序列。
##设置多路复用器卡的说明#1。本例使用20通道多路复用器卡(型号34901A)。
#2。通道1-10保留用于使用J型热电偶测量,而通道11-20#用于直流电压测量。
#3。此示例要求将卡放入第一个插槽。
##要求:#本示例是为Agilent 34970A或34972A数据采集单元编写的。
##操作:#1。重置数据采集单元以清除所有寄存器。
#2。如上所述配置和设置仪器。
#3。运行序列后等待10秒钟以完成测量。
#4。前10个结果测量的是Celcius的温度和最后10个测量电压。
##如果您同意安捷伦科技公司不承担任何保证,义务或责任,您可以以任何有用的方式使用,修改,复制和分发此示例程序(和/或任何修改版本)的免版税权利。
任何示例程序。
(连接“3497x”,“”,“3497x数据采集/数据记录器开关单元/ 1.13”)#复位并清除仪器* RST * CLS#设置通道101至110,用J型热电偶测量温度(C):CONFigure
:TEMPerature TCouple,J,(@ 101:110):UNIT:TEMPerature C,(@ 101:110):SENSe:TEMPerature:TRANsducer:TCouple:RJUNction:TYPE INTernal,(@ 101:110)#Setup channels 111 th 120
以5.5位分辨率读取10V范围内的电压:CONFigure:VOLTage:DC 10,(@ 111:120):SENSe:VOLTage:DC:NPLC 1,(@ 111:120)#Scan Channels 101 thru 120:ROUTe:
SCAN(@ 101:120):TRIGger:COUNt 1:TRIGger:SOURce TIMer#开始触发:INITiate:FORMat:READing:CHANnel 0#等待扫描完成(等待10000ms):DATA:POINts?
#检索10个热数据通道:DATA:REMove?
10#检索10个通道的电压数据:DATA:REMove?
10编辑:2013年4月24日下午2:21连接
以上来自于谷歌翻译
以下为原文
Hi S.Crider,
You are using VISA COM with the interop provided for .NET languages. You have correctly created a resource manager, now you will need to create a FormattedIO488 object to control your 3497x. You will use its writestring and readstring functions to send SCPI commands.
You will first need to import the VISA COM 3.0 Type library and the VISA COM 488.2 Formatted I/O reference into your project. Here is a simple VB.NET VISA COM/USB example that sends the idn command:
----------------------------
Sub Main()
Dim ioMgr As Ivi.Visa.Interop.ResourceManager
Dim instrument As Ivi.Visa.Interop.FormattedIO488
Dim idn As String
ioMgr = New Ivi.Visa.Interop.ResourceManager
instrument = New Ivi.Visa.Interop.FormattedIO488 'create more FormatedIO488 objects to control the other instruments
'Place in VISA Instrument address for ACE, a common alias is USBInstrument1
instrument.IO = ioMgr.Open("USBInstrument1")
instrument.WriteString("*IDN?") 'Use to send commands
idn = instrument.ReadString() 'Use to
MsgBox("The IDN String is: " & idn, vbOKOnly, "IDN Result")
End Sub
---------------------------
Agilent Connection Expert comes with documentation on the use of VISA COM. A great getting started guide can be found here: http://cp.literature.agilent.com/litweb/pdf/5989-6338EN.pdf
Please see the 34970/34972 product pages for SCPI VB examples on creating/setting up a scan list(they share the same commands). Below is a set of SCPI commands to setup a scanlist for DCV/Temperature
-----------------------------
# Configure the 3497x Data Acquisition unit to gather temperature and DC voltage measurements. The acquisition is started by a software trigger. This example measures channels 1-10 for type J thermocouple temperatures in Celcius and channels 11-20 for DC voltage.
#
# Instructions for Running:
# 1. Setup the multiplexer card for temperature and voltage measurements(see below).
# 2. Insert multiplexer card into the first slot.
# 3. Update the instrument address in the connect statement.
# 4. Run the sequence.
#
# Instructions for setting up the Multiplexer Card
# 1. This example uses a 20 channel multiplexer card (model 34901A).
# 2. Channels 1-10 are reserved for using type J thermocouple measurements, while Channels 11-20
# are used for DC voltage measurements.
# 3. This example requires the card be placed into the first slot.
#
# Requirements:
# This example was written for an Agilent 34970A or 34972A Data Acquisition Unit.
#
# Operation:
# 1. Reset the Data Acquisition Unit to clear all registers.
# 2. Configure and setup the instrument as explained above.
# 3. Wait 10 seconds for the measurements to complete after running the sequence.
# 4. The first 10 results measure temperature in Celcius and the last 10 measure voltage.
#
# You have a royalty-free right to use, modify, reproduce and distribute this example program (and/or any modified version) in any way you find useful, provided you agree that Agilent Technologies has no warranty, obligations, or liability for any example programs.
(Connect "3497x", "", "3497x Data Acquisition / Data Logger Switch Unit / 1.13")
# Reset and clear the instrument
*RST
*CLS
# Setup channels 101 thru 110 to measure temperature (C) with type J thermocouples
:CONFigure:TEMPerature TCouple,J,(@101:110)
:UNIT:TEMPerature C,(@101:110)
:SENSe:TEMPerature:TRANsducer:TCouple:RJUNction:TYPE INTernal,(@101:110)
# Setup channels 111 thru 120 to read voltage on the 10V range with 5.5 digit resolution
:CONFigure:VOLTage:DC 10,(@111:120)
:SENSe:VOLTage:DC:NPLC 1,(@111:120)
# Scan Channels 101 thru 120
:ROUTe:SCAN (@101:120)
:TRIGger:COUNt 1
:TRIGger:SOURce TIMer
# Start trigger
:INITiate
:FORMat:READing:CHANnel 0
# Wait for scan to complete
(Wait 10000ms)
:DATA:POINts?
# Retrieve 10 Channels of thermo data
:DATA:REMove? 10
# Retrieve 10 channels of voltage data
:DATA:REMove? 10
Edited by: connectivity on Apr 24, 2013 2:21 PM
您好S.Crider,您正在使用VISA COM与.NET语言提供的互操作。
您已正确创建资源管理器,现在需要创建FormattedIO488对象来控制3497x。
您将使用其writestring和readstring函数来发送SCPI命令。
首先,您需要将VISA COM 3.0类型库和VISA COM 488.2格式化I / O引用导入到项目中。
这是一个简单的VB.NET VISA COM / USB示例,它发送idn命令:---------------------------- Sub Main()
Dim ioMgr As Ivi.Visa.Interop.ResourceManager Dim instrument As Ivi.Visa.Interop.FormattedIO488 Dim idn As String ioMgr = New Ivi.Visa.Interop.ResourceManager instrument = New Ivi.Visa.Interop.FormattedIO488'创建更多FormatedIO488对象
控制其他仪器在ACE的VISA仪器地址中的位置,常见的别名是USBInstrument1 instrument.IO = ioMgr.Open(“USBInstrument1”)instrument.WriteString(“* IDN?”)'用于发送命令idn = instrument.ReadString
()'用于MsgBox(“IDN字符串是:”& idn,vbOKOnly,“IDN结果”)End Sub -----------------------
---- Agilent Connection Expert附带有关VISA COM使用的文档。
一个很好的入门指南可以在这里找到:http://cp.literature.agilent.com/litweb/pdf/5989-6338EN.pdf有关创建/设置扫描的SCPI VB示例,请参阅34970/34972产品页面
list(它们共享相同的命令)。
下面是一组用于设置DCV /温度扫描列表的SCPI命令-----------------------------#配置3497x数据采集
单元收集温度和直流电压测量。
通过软件触发器启动采集。
此示例测量通道1-10为C型热电偶温度(Celcius)和通道11-20(直流电压)。
##运行说明:#1。设置多路复用器卡进行温度和电压测量(见下文)。
#2。将多路复用器卡插入第一个插槽。
#3。在connect语句中更新仪器地址。
#4。运行序列。
##设置多路复用器卡的说明#1。本例使用20通道多路复用器卡(型号34901A)。
#2。通道1-10保留用于使用J型热电偶测量,而通道11-20#用于直流电压测量。
#3。此示例要求将卡放入第一个插槽。
##要求:#本示例是为Agilent 34970A或34972A数据采集单元编写的。
##操作:#1。重置数据采集单元以清除所有寄存器。
#2。如上所述配置和设置仪器。
#3。运行序列后等待10秒钟以完成测量。
#4。前10个结果测量的是Celcius的温度和最后10个测量电压。
##如果您同意安捷伦科技公司不承担任何保证,义务或责任,您可以以任何有用的方式使用,修改,复制和分发此示例程序(和/或任何修改版本)的免版税权利。
任何示例程序。
(连接“3497x”,“”,“3497x数据采集/数据记录器开关单元/ 1.13”)#复位并清除仪器* RST * CLS#设置通道101至110,用J型热电偶测量温度(C):CONFigure
:TEMPerature TCouple,J,(@ 101:110):UNIT:TEMPerature C,(@ 101:110):SENSe:TEMPerature:TRANsducer:TCouple:RJUNction:TYPE INTernal,(@ 101:110)#Setup channels 111 th 120
以5.5位分辨率读取10V范围内的电压:CONFigure:VOLTage:DC 10,(@ 111:120):SENSe:VOLTage:DC:NPLC 1,(@ 111:120)#Scan Channels 101 thru 120:ROUTe:
SCAN(@ 101:120):TRIGger:COUNt 1:TRIGger:SOURce TIMer#开始触发:INITiate:FORMat:READing:CHANnel 0#等待扫描完成(等待10000ms):DATA:POINts?
#检索10个热数据通道:DATA:REMove?
10#检索10个通道的电压数据:DATA:REMove?
10编辑:2013年4月24日下午2:21连接
以上来自于谷歌翻译
以下为原文
Hi S.Crider,
You are using VISA COM with the interop provided for .NET languages. You have correctly created a resource manager, now you will need to create a FormattedIO488 object to control your 3497x. You will use its writestring and readstring functions to send SCPI commands.
You will first need to import the VISA COM 3.0 Type library and the VISA COM 488.2 Formatted I/O reference into your project. Here is a simple VB.NET VISA COM/USB example that sends the idn command:
----------------------------
Sub Main()
Dim ioMgr As Ivi.Visa.Interop.ResourceManager
Dim instrument As Ivi.Visa.Interop.FormattedIO488
Dim idn As String
ioMgr = New Ivi.Visa.Interop.ResourceManager
instrument = New Ivi.Visa.Interop.FormattedIO488 'create more FormatedIO488 objects to control the other instruments
'Place in VISA Instrument address for ACE, a common alias is USBInstrument1
instrument.IO = ioMgr.Open("USBInstrument1")
instrument.WriteString("*IDN?") 'Use to send commands
idn = instrument.ReadString() 'Use to
MsgBox("The IDN String is: " & idn, vbOKOnly, "IDN Result")
End Sub
---------------------------
Agilent Connection Expert comes with documentation on the use of VISA COM. A great getting started guide can be found here: http://cp.literature.agilent.com/litweb/pdf/5989-6338EN.pdf
Please see the 34970/34972 product pages for SCPI VB examples on creating/setting up a scan list(they share the same commands). Below is a set of SCPI commands to setup a scanlist for DCV/Temperature
-----------------------------
# Configure the 3497x Data Acquisition unit to gather temperature and DC voltage measurements. The acquisition is started by a software trigger. This example measures channels 1-10 for type J thermocouple temperatures in Celcius and channels 11-20 for DC voltage.
#
# Instructions for Running:
# 1. Setup the multiplexer card for temperature and voltage measurements(see below).
# 2. Insert multiplexer card into the first slot.
# 3. Update the instrument address in the connect statement.
# 4. Run the sequence.
#
# Instructions for setting up the Multiplexer Card
# 1. This example uses a 20 channel multiplexer card (model 34901A).
# 2. Channels 1-10 are reserved for using type J thermocouple measurements, while Channels 11-20
# are used for DC voltage measurements.
# 3. This example requires the card be placed into the first slot.
#
# Requirements:
# This example was written for an Agilent 34970A or 34972A Data Acquisition Unit.
#
# Operation:
# 1. Reset the Data Acquisition Unit to clear all registers.
# 2. Configure and setup the instrument as explained above.
# 3. Wait 10 seconds for the measurements to complete after running the sequence.
# 4. The first 10 results measure temperature in Celcius and the last 10 measure voltage.
#
# You have a royalty-free right to use, modify, reproduce and distribute this example program (and/or any modified version) in any way you find useful, provided you agree that Agilent Technologies has no warranty, obligations, or liability for any example programs.
(Connect "3497x", "", "3497x Data Acquisition / Data Logger Switch Unit / 1.13")
# Reset and clear the instrument
*RST
*CLS
# Setup channels 101 thru 110 to measure temperature (C) with type J thermocouples
:CONFigure:TEMPerature TCouple,J,(@101:110)
:UNIT:TEMPerature C,(@101:110)
:SENSe:TEMPerature:TRANsducer:TCouple:RJUNction:TYPE INTernal,(@101:110)
# Setup channels 111 thru 120 to read voltage on the 10V range with 5.5 digit resolution
:CONFigure:VOLTage:DC 10,(@111:120)
:SENSe:VOLTage:DC:NPLC 1,(@111:120)
# Scan Channels 101 thru 120
:ROUTe:SCAN (@101:120)
:TRIGger:COUNt 1
:TRIGger:SOURce TIMer
# Start trigger
:INITiate
:FORMat:READing:CHANnel 0
# Wait for scan to complete
(Wait 10000ms)
:DATA:POINts?
# Retrieve 10 Channels of thermo data
:DATA:REMove? 10
# Retrieve 10 channels of voltage data
:DATA:REMove? 10
Edited by: connectivity on Apr 24, 2013 2:21 PM
举报