EasyManua.ls Logo

Agilent Technologies 33500 Series - Page 229

Agilent Technologies 33500 Series
278 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
228
Chapter 4 Application Programs
Program Listings
4
Example: Download Arbitrary Waveform as ASCII
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.
' """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
'This AsciiArb program demonstrates how to download an arbitrary waveform into
'instrument volatile memory and play it back with the configuration below:
'
'Wave Shape: Arb
'Frequency: 40 KSa/Sec
'Amplitude: 2 Volt Peak to Peak
'Offset: 0 Volt
'Output Impedance: 50 Ohm
'Channel1 Output: Enabled
'This arb generates a 4000 point pulse waveform, of which the first 200 points
'define a positive pulse from 0 volts to the maximum defined voltage amplitude.
'Caution: This program will erase all unsaved data in volatile memory.
'If necessary, save that information before running this example program.
' """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
Private Sub Command1_Click()
Dim io_mgr As VisaComLib.ResourceManager
Dim mFio As VisaComLib.FormattedIO488
Set io_mgr = New AgilentRMLib.SRMCls
Set mFio = New FormattedIO488
Set mFio.IO = io_mgr.Open(Text1.Text, NO_LOCK, 2000, "")
Dim Waveform() As String
Dim I As Integer
Dim DataStr As String
ReDim Waveform(1 To 4000)
On Error GoTo MyError
'Compute waveform
Text2.Text = ""
Text2.Text = Text2.Text & "Computing Waveform..." & vbCrLf
For I = 1 To 5
Waveform(I) = Str$((I - 1) / 5) ' Set rise time (5 points)
Next I
For I = 6 To 205
Waveform(I) = "1" ' Set pulse width (200 points)
Next I
For I = 206 To 210
Waveform(I) = Str$((210 - I) / 5) ' Set fall time (5 points)
Next I
For I = 211 To 4000
Waveform(I) = "0" ' Set remaining points to zero
Next I

Table of Contents

Other manuals for Agilent Technologies 33500 Series

Related product manuals