Download Agilent Technologies 2000 X-Series Technical data

Transcript
Programming Examples
38
4 Cut- and- paste the code that follows into the Visual Basic .NET source
file.
5 Edit the program to use the VISA address of your oscilloscope.
6 Add a reference to the SCPI.NET 3.0 driver:
a Right- click the project you wish to modify (not the solution) in the
Solution Explorer window of the Microsoft Visual Studio
environment.
b Choose Add Reference....
c In the Add Reference dialog, select the Browse tab, and navigate to
the ScpiNetDrivers folder.
• Windows XP: C:\Documents and Settings\All Users\Agilent\
Command Expert\ScpiNetDrivers
• Windows 7: C:\ProgramData\Agilent\Command Expert\
ScpiNetDrivers
d Select the .dll file for your oscilloscope, for example
AgInfiniiVision2000X_01_20.dll; then, click OK.
e Right- click the project you wish to modify (not the solution) in the
Solution Explorer window of the Microsoft Visual Studio environment
and choose Properties; then, select
"InfiniiVision.ScpiNetInstrumentApp" as the Startup object.
7 Build and run the program.
For more information, see the SCPI.NET driver help that comes with
Agilent Command Expert.
'
'
'
'
'
'
Agilent SCPI.NET Example in Visual Basic .NET
------------------------------------------------------------------This program illustrates a few commonly used programming
features of your Agilent oscilloscope.
-------------------------------------------------------------------
Imports
Imports
Imports
Imports
System
System.IO
System.Text
Agilent.CommandExpert.ScpiNet.AgInfiniiVision2000X_01_20
Namespace InfiniiVision
Class ScpiNetInstrumentApp
Private Shared myScope As AgInfiniiVision2000X
Public Shared Sub Main(ByVal args As String())
Try
Dim strScopeAddress As String
'strScopeAddress = "a-mx3054a-60028.cos.agilent.com";
strScopeAddress = _
"TCPIP0::a-mx3054a-60028.cos.agilent.com::inst0::INSTR"
Console.WriteLine("Connecting to oscilloscope...")
Agilent InfiniiVision 2000 X-Series Oscilloscopes Programmer's Guide
907