304
Chapter 6 Application Programs
Program Listings
6
Example: Linear Sweep
This program (found in the “Examples\chapter6\LinearSweep” subdirectory on the CD-
ROM) creates a linear sweep for a sine wave. It sets the start and stop frequencies, and
the sweep time.
Private Sub cmdLinearSweep_Click()
Dim io_mgr As VisaComLib.ResourceManager
Dim Fgen As VisaComLib.FormattedIO488
Set io_mgr = New VisaComLib.ResourceManager
Set Fgen = New VisaComLib.FormattedIO488
Set Fgen.IO = io_mgr.Open(txtIO.Text)
On Error GoTo MyError
' This program sets up a linear sweep using a sinusoid
' waveform. It sets the start and stop frequency and sweep
' time.
With Fgen
.WriteString "*RST" ' Reset the function generator
.IO.Clear ' Clear errors and status registers
.WriteString "FUNCtion SINusoid" ' Select waveshape
.WriteString "OUTPut:LOAD 50" ' Set the load impedance to
' 50 Ohms (default)
.WriteString "VOLTage 1" ' Set the amplitude to 1 Vpp.
.WriteString "SWEep:SPACing LINear" ' Set Linear or LOG spacing
.WriteString "SWEep:TIME 1" ' Sweep time is 1 second
.WriteString "FREQuency:STARt 100" ' Start frequency is 100 Hz
.WriteString "FREQuency:STOP 20e3" ' Stop frequency is 20 kHz
' Frequency sweep limits may also be set as FREQuency:CENTer and
' FREQuency:SPAN on the 332x0A
' For the 332x0A, also see MARKer:FREQuency
.WriteString "OUTPut ON" ' Turn on the instrument output
.WriteString "SWEep:STATe ON" ' Turn sweep on
End With
Exit Sub
MyError:
txtError = Err.Description & vbCrLf
Resume Next
End Sub
33210A users guide.book Page 304 Wednesday, July 16, 2008 11:16 AM
Summary of Contents for 33210A
Page 1: ...Keysight 33210A 10 MHz Function Arbitrary Waveform Generator User s Guide ...
Page 2: ......
Page 3: ......
Page 14: ...12 Contents Contents 33210A users guide book Page 12 Wednesday July 16 2008 11 16 AM ...
Page 15: ...1 1 Quick Start 33210A users guide book Page 13 Wednesday July 16 2008 11 16 AM ...
Page 53: ...3 3 Features and Functions 33210A users guide book Page 51 Wednesday July 16 2008 11 16 AM ...
Page 273: ...5 5 Error Messages 33210A users guide book Page 271 Wednesday July 16 2008 11 16 AM ...
Page 301: ...6 6 Application Programs 33210A users guide book Page 299 Wednesday July 16 2008 11 16 AM ...
Page 311: ...7 7 Tutorial 33210A users guide book Page 309 Wednesday July 16 2008 11 16 AM ...
Page 335: ...8 8 Specifications 33210A users guide book Page 333 Wednesday July 16 2008 11 16 AM ...