Télécharger Imprimer la page

Keysight 33210A Guide D'utilisation page 334

Générateur de signaux arbitraires/fonctions 10 mhz

Publicité

6
Application Programs
Program Listings
Example: A Simple Sine Waveform
This program (found in the "Examples\chapter6\SimpleSine" subdirectory on the
CD-ROM) selects the function as "sine," and then sets the frequency, amplitude
and offset of the waveform.
Private Sub cmdSimpleSine_Click()
MyError:
End Sub
334
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 waveform by selecting the waveshape
' and adjusting the frequency, amplitude, and offset.
With Fgen
.WriteString "*RST"
.IO.Clear
.WriteString "FUNCtion SINusoid"
' Other options are SQUare, RAMP, PULSe, NOISe, DC, and USER
.WriteString "OUTPut:LOAD 50"
' May also be INFinity, as when using oscilloscope or DMM
.WriteString "FREQuency 2500"
.WriteString "VOLTage 1.2"
.WriteString "VOLTage:OFFSet 0.4"
' Voltage may also be set as VOLTage:HIGH and VOLTage:LOW for low level
' and high level
.WriteString "OUTPut ON"
End With
Exit Sub
txtError = Err.Description & vbCrLf
Resume Next
' Reset the function generator
' Clear errors and status registers
' Select waveshape
' Set the load impedance in Ohms
' (50 Ohms default)
' Set the frequency.
' Set the amplitude in Vpp.
' Also see VOLTage:UNIT
' Set the offset in Volts
' Turn on the instrument output
Keysight 33210A User's Guide

Publicité

loading