User`s manual
Sequence Selection
Program
The WAVE_SEL program shows how to change the output waveform
(sequence) without aborting the current waveform and re-initializing the AFG.
BASIC Program Example (WAVE_SEL)
1 !RE-STORE "WAVE_SEL"
2 !This program changes the output waveform sequence once the AFG has been
3 !INITiated by writing the location of a sequence’s base address to the
4 !Waveform Select register. All register reads and writes are 16 bit.
5 !
10 !Assign an I/O path between the computer and the AFG
20 ASSIGN @Afg TO 1680
30 ASSIGN @Afg1 TO 1680;FORMAT OFF !path for binary data
40 COM @Afg,@Afg1,Base_addr,Seq1_addr,Seq2_addr,Seq3_addr
50 !
60 !Subprograms which reset the AFG and erase all existing waveforms.
70 CALL Rst
80 CALL Wf_del
90 !
100 !SCPI commands which configure the AFG
110 OUTPUT @Afg;"SOUR:FREQ1:FIX 4.096E6;"; !Sample rate
120 OUTPUT @Afg;":SOUR:FUNC:SHAP USER;"; !function
130 OUTPUT @Afg;":SOUR:VOLT:LEV:IMM:AMPL 2.1V" !amplitude
140 OUTPUT @Afg;"SOUR:ARB:DAC:SOUR INT" !dac data source
150 OUTPUT @Afg;"SOUR:ARB:DAC:FORM SIGN" !dac data format
160 !
170 !Subprograms which define waveforms and load them into segment
180 !and sequence memory, which determine the AFG’s register locations
190 !in A24, and which configure the AFG’s sequence base memory.
200 CALL Waveform_def
210 CALL A24_offset
220 CALL Build_ram
230 !
240 !Select an output sequence, and initiate (start) waveform output.
250 OUTPUT @Afg;"SOUR:FUNC:USER SEQ1" !waveform sequence
260 OUTPUT @Afg;"INIT:IMM" !wait-for-arm state
270 !
280 !Subprogram which changes the output sequence with register writes.
290 CALL Wave_change
300 END
310 !
320 SUB Waveform_def
330 COM @Afg,@Afg1,Base_addr,Seq1_addr,Seq2_addr,Seq3_addr
340 CALL Sinx_def
350 CALL Sind_def
360 CALL Spike_def
370 SUBEND
380 !
390 SUB A24_offset
Continued on Next Page
500 Register-Based Programming Appendix C