Tektronix AFG3000 Portable Generator User Manual


 
Programming Examples
5-2 AFG3000 Series Arbitrary/Function Generators Reference Manual
Example 1
This is a sample program for setting the arbitrary/function generator 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
Tvc1.WriteString ("VOLTAGE:OFFSET 1.00") 'Set offset 1V
Tvc1.WriteString ("PHASE:ADJUST 0DEG") 'Set phase 0degree
'
'Set CH2 output parameters
'
Tvc1.WriteString ("SOURCE2:FUNCTION SIN") 'Set output waveform SIN
Tvc1.WriteString ("SOURCE2:FREQUENCY 10E3") 'Set frequency 10kHz
Tvc1.WriteString ("SOURCE2:VOLTAGE:AMPLITUDE 1.00") 'Set amplitude 1Vpp
Tvc1.WriteString ("SOURCE2:VOLTAGE:OFFSET 0.00") 'Set offset 0V
Tvc1.WriteString ("SOURCE2:PHASE:ADJUST 90DEG") 'Set phase 90degrees
'
'Save settings and output on
'
Tvc1.WriteString ("*SAV 1") 'Save settings to Setup1
Tvc1.WriteString ("*RCL 1") 'Recall settings from Setup1
End Sub