Technical data

Programming Your Instruments 6
Agilent Connectivity Guide 149
Sample Programs
Sample programs follow to demonstrate sine waveform generation for
an Agilent 33220A 20 Mhz Function/Arbitrary Waveform Generator.
The sample programs are essentially repeated to show the same
functionality with different programming environments and I/O. Agilent
IO Libraries Suite provides a number of additional sample programs for
a variety of instruments. To access other sample programs from the
Windows Start menu, click Start > Programs > Agilent IO Libraries
Suite > Programming Samples.
The example programs in this section are:
Example: Simple Sine Waveform (Visual Basic and VISA COM)
Example: Simple Sine Waveform (C# and VISA COM)
Example: Simple Sine Waveform (Visual C++ and VISA)
Example: Simple Sine Waveform (Visual Basic and VISA
COM)
This program selects the function as “sine,” and then sets the frequency,
amplitude and offset of the waveform for an Agilent 33220A. The
program is written in Visual Basic 6.0 and uses VISA COM.
Private Sub cmdSimpleSine_Click()
Dim io_mgr As VisaComLib.ResourceManager
Dim Fgen As VisaComLib.FormattedIO488
Set io_mgr = New AgilentRMLib.SRMCls
Set Fgen = New VisaComLib.FormattedIO488
Set Fgen.IO = io_mgr.Open(txtIO.Text)
On Error GoTo MyError
’ This program sets up a waveform by selecting the waveshape