User`s manual
200 !Subprograms which define waveforms and load them into segment
210 !and sequence memory, which determine the AFG’s register locations
220 !in A24, and which configure the AFG’s sequence base memory.
230 CALL Waveform_def
240 CALL A24_offset(Laddr)
250 CALL Build_ram
260 !
270 !Select an output sequence, and initiate (start) waveform output.
280 OUTPUT @Afg;"SOUR:FUNC:USER SEQ1" !waveform sequence
290 OUTPUT @Afg;"INIT:IMM" !wait-for-arm state
300 !
310 !Wait for AFG to start output
320 OUTPUT @Afg;"STAT:OPC:INIT OFF;*OPC?"
330 ENTER @Afg;A
340 !
350 !Enable FP DPORT to control sequence selection
360 OUTPUT @Cmd;"DIAG:PEEK? ";Base_addr+8;",16"
370 ENTER @Cmd;Traffic
380 Traffic=BINIOR(BINAND(Traffic,IVAL("3FFF",16)),IVAL("4000",16))
390 OUTPUT @Cmd;"DIAG:POKE ";Base_addr+8;",16,";Traffic
400 END
410 !
420 SUB Waveform_def
430 COM @Cmd,@Afg,@Afg1,Base_addr,Seq1_addr,Seq2_addr,Seq3_addr
440 CALL Sinx_def
450 CALL Sind_def
460 CALL Spike_def
470 SUBEND
480 !
490 SUB A24_offset(Laddr)
500 A24_offset: !Subprogram which determines the base address for
510 !the AFG registers in A24 address space.
520 COM @Cmd,@Afg,@Afg1,Base_addr,Seq1_addr,Seq2_addr,Seq3_addr
530 OUTPUT @Cmd;"DIAG:PEEK? ";DVAL("1FC000",16)+64*Laddr+6;",16"
540 ENTER @Cmd;Offset !AFG A24 base address
550 Base_addr=Offset*256 !shift offset for 24-bit address
560 SUBEND
570 !
580 SUB Build_ram
590 Build_ram: !This subprogram configures the AFG’s sequence base memory
600 !such that there are valid sequence base addresses in memory
610 !before the AFG is INITiated and waveforms are selected.
620 COM @Cmd,@Afg,@Afg1,Base_addr,Seq1_addr,Seq2_addr,Seq3_addr
630 !
640 !Preserve Traffic register contents. Set bits 15-14 to 1 0 to set
650 !the Waveform Select register as the source which selects the output
660 !waveform sequence.
670 OUTPUT @Cmd;"DIAG:PEEK? ";Base_addr+8;",16"
680 ENTER @Cmd;Traffic
690 Traffic=BINIOR(BINAND(Traffic,IVAL("3FFF",16)),IVAL("8000",16))
Continued on Next Page
Chapter 7 High Speed Operation 273