User`s guide
92
Programming Your Instruments
Example Programs
’ Other options are SQUare, RAMP, PULSe, NOISe, DC, and USER
.WriteString "OUTPut:LOAD 50" ’ Set the load impedance in Ohms
’ (50 Ohms default)
’ May also be INFinity, as when using oscilloscope or DMM
.WriteString "FREQuency 2500" ’ Set the frequency.
.WriteString "VOLTage 1.2" ’ Set the amplitude in Vpp.
’ Also see VOLTage:UNIT
.WriteString "VOLTage:OFFSet 0.4" ’ Set the offset in Volts
’ Voltage may also be set as VOLTage:HIGH and VOLTage:LOW for
’ low level and high level
.WriteString "OUTPut ON" ’ Turn on the instrument output
End With
Exit Sub
MyError:
txtError = Err.Description & vbCrLf
Resume Next
End Sub
Example: Simple Sine Waveform (Visual C++ and IVI-COM)
This example program is intended for use with Microsoft Visual C++ 6.0
and the Agilent IVI-COM drivers. This program shows how to download an
arbitrary waveform using binary data. The program generates a damped
sine wave using 16,000 points.
NOTE
"VISA COM 1.0 Type Library" corresponds to VISACOM.tlb and "Agilent
33220 IVI COM Driver 1.0" corresponds to Agilent33220.DLL.
Use the statement "#import "Agilent33220.dll" no_namespace" to import
the Agilent 33220 IVI-COM Driver.
Create a variable of type IAgilent33220Ptr to hold the reference to the
object. To create the object, use
"Fgen.CreateInstance( __uuidof(Agilent33220) )".