Tektronix AFG2021 Programmer's Manual page 139

Arbitrary function generator
Hide thumbs Also See for AFG2021:
Table of Contents

Advertisement

Programming Examples
Example 1
AFG2021 Arbitrary Function Generator Programmer Manual
The following two example programs, which demonstrate methods that you can
use to control the instrument through the General Purpose Interface Bus (GPIB),
are included on the AFG2021 instrument Product CD.
Example 1: Set up a Waveform Output
Example 2: Waveform Transfer and Copy
The example programs are written in Microsoft Visual Basic Version 6.0. The
programs run on Windows PC compatible systems equipped with TekVISA and a
National Instruments GPIB board with the associated drivers.
TekVISA is the Tektronix implementation of the VISA Application Programming
Interface (API). TekVISA is industry-compliant software for writing interoperable
instrument drivers in a variety of Application Development Environments (ADEs).
The example programs assume that the GPIB system recognizes the PC (external
controller) as GPIB0, and the address number of the instrument as 11.
If you use an interface other than GPIB, change the resource name of source code.
Refer to TekVISA manual for details about resource.
This is a sample program for setting the instrument outputs.
Private Sub Sample1_Click()
'
'Assign resource
'
Tvc1.Descriptor = "GPIB0::11::INSTR"
'
'Initialize of device setting
'
Tvc1.WriteString ("*RST")
'
'Set CH1 output parameters
'
Tvc1.WriteString ("FUNCTION SIN") 'Set output waveform SIN
Tvc1.WriteString ("FREQUENCY 10E3") 'Set frequency 10kHz
Tvc1.WriteString ("VOLTAGE:AMPLITUDE 2.00") 'Set amplitude
2Vpp
4-1

Advertisement

Table of Contents
loading

Table of Contents