Downloading an Arbitrary Waveform over GPIB
This program teaches the following concepts:
How to define a set of waveform points over the GPIB interface and
download the points to volatile memory. The downloaded waveform is
a square wave pulse (4,000 points) with a calculated rise and fall time.
How to copy the download waveform to non-volatile memory.
BASIC / GPIB (Program 3)
10 !
20 ! This program uses the arbitrary waveform function to
30 ! download and output a square wave pulse with a calculated
40 ! rise time and fall time. The waveform consists of 4000
50 ! points downloaded to the function generator as ASCII data.
60 !
70 OPTION BASE 1
80 DIM Waveform(4000) ! Dimension array with 4000 elements
90 INTEGER I ! Declare integer variable
100 CLEAR 7 ! Clear interface - send "device clear"
110 ASSIGN @Fgen TO 710 ! Assign I/O path to address 710
120 OUTPUT @Fgen;"*RST" ! Reset the function generator
130 !
140 FOR I=1 TO 5
150 Waveform(I)=(I-1)/5 ! Set rise time (5 points)
160 NEXT I
170 !
180 FOR I=6 TO 205
190 Waveform(I)=1 ! Set pulse width (200 points)
200 NEXT I
210 !
220 FOR I=206 TO 210
230 Waveform(I)=(210-I)/5 ! Set fall time (5 points)
240 NEXT I
250 !
260 FOR I=211 TO 4000
270 Waveform(I)=0 ! Set remaining points to zero
280 NEXT I
290 !
6
Chapter 6 Application Programs
Downloading an Arbitrary Waveform over GPIB
255