Programming
259
Adapter Setting
•
Overview
• Sample Program in Excel VBA
Other topics about Setting Measurement Conditions
Overview
The program listed in the below section is written in VISA-COM with Excel
VBA. It can be executed from the external PC controller. The program
demonstrates how to perform the adapter settings.
Adapter Setting Sample Program in Excel VBA
Sub AdapterSetup()
'
'
'The memory area of the resource manager and the instrument I/O are acquired
Dim iomgr As VisaComLib.ResourceManager
Dim Analyzer As VisaComLib.FormattedIO488
Dim Dmy As Integer
Set iomgr = New VisaComLib.ResourceManager
Set Analyzer = New VisaComLib.FormattedIO488
' Open the instrument. Set the GPIB address.
Set Analyzer.IO = iomgr.Open("USB0::0x0957::0x1809::KPR0200015::0::INSTR")
' TimeOut time should be greater than the measurement time.
Analyzer.IO.timeout = 50000
' Select the adapter
' Set adapter type to 42942A
Analyzer.WriteString ":SENS1:ADAP:TYPE E4PR", True
' Phase setup
MsgBox "Connect Open Termination"
' Execute open in phase setup
Analyzer.WriteString ":SENS1:ADAP:CORR:COLL:ACQ PHAS", True
' Wait for measurement end
Analyzer.WriteString "*OPC?", True
Dmy = Analyzer.ReadNumber
' Save phase setup data