305
Chapter 6 Application Programs
Program Listings
4
6
Example: A Pulse Waveform
This program (found in the “Examples\chapter6\Pulse” subdirectory on the CD-ROM)
configures a pulse waveform, setting pulse width, period, and high/low levels. The edge
time is then incremented.
Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
Private Sub cmdPulse_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)
Dim I As Integer
On Error GoTo MyError
' This program sets up a pulse waveshape and adjusts the edge
' time. It also shows the use of high and low voltage levels
' and period. The edge time is adjusted by 5 nsec increments.
With Fgen
.WriteString "*RST" ' Reset the function generator
.IO.Clear ' Clear errors and status registers
.WriteString "FUNCtion PULSe" ' Select pulse waveshape
.WriteString "OUTPut:LOAD 50" ' Set the load impedance to 50 Ohms
' (default)
.WriteString "VOLTage:LOW 0" ' Low level = 0 V
.WriteString "VOLTage:HIGH 0.75" ' High level = .75 V
.WriteString "PULSe:PERiod 1e-3" ' 1 ms intervals
.WriteString "PULSe:WIDTh 100e-6" ' Pulse width is 100 us
.WriteString "PULSe:TRANsition 20e-9" ' Edge time is 20 ns
' (rise time = fall time)
.WriteString "OUTPut ON" ' Turn on the instrument output
For I = 0 To 18
' Vary edge by 5 nsec steps
.WriteString "PULSe:TRANsition " & (0.00 I * 0.000000005)
Sleep 300 ' Wait 300 msec
Next I
End With
Exit Sub
MyError:
txtError = Err.Description & vbCrLf
Resume Next
End Sub
33210A users guide.book Page 305 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 ...