Programming Examples

AFG3000 Series Arbitrary/Function Generators Reference Manual 5-3

Example 2 This is a sample program for sending an arbitrary waveform to the arbitrary/func-

tion generator's Edit Memory and copying the contents of Edit Memory to the user

waveform memory.

Private Sub Sample2_Click()
'
'Assign resource
'
Tvc1.Descriptor = "GPIB0::11::INSTR"'
'Initialize of device setting
'
Tvc1.WriteString ("*RST")'
'Make arbitrary block data (2000 Points)
'
Dim wave(4000) As Byte
For i = 0 To 499 'Leading edge (500 Points)
Data = i * Int(16382 / 500) 'Data range is from 0 to 16382
High = Int(Data / 256) 'AFG's Data Format is big endian
Low = Data - (High * 256)
wave(2 * i) = High
wave(2 * i + 1) = Low
Next i
For i = 500 To 799 'Part of High Level (800 Points)
Data = 16382
High = Int(Data / 256)
Low = Data - (High * 256)
wave(2 * i) = High
wave(2 * i + 1) = Low
Next i
For i = 800 To 999 'Trailing Edge (200 Points)
Data = (1000 - i) * Int(16382 / 200)
High = Int(Data / 256)
Low = Data - (High * 256)
wave(2 * i) = High
wave(2 * i + 1) = Low