User`s manual
180 CALL Dac_drive
190 END
200 !
210 SUB A24_offset
220 A24_offset: !Subprogram which determines the base address for
230 !the AFG registers in A24 address space, then adds the
240 !offset and register number to the base to get the
250 !complete address.
260 COM @Afg,Addr
270 !CONTROL 16,25;2 !access A16 space with READIO and WRITEIO
280 A16_addr=DVAL("D400",16) !AFG A16 base address
290 Offset=READIO(-16,A16_addr+6) !read AFG offset register
300 Base_addr=Offset*256 !shift offset for 24-bit address
310 !Add the register number of the high speed data register
320 !to the A24 base address.
330 Addr=Base_addr+IVAL("26",16)
340 SUBEND
350 !
360 SUB Dac_drive
370 Dac_drive: !Subprogram which computes a 128 point, 5 Vpp triangle wave and
380 !writes the corresponding codes directly to the DAC via
390 !the VXIbus and High Speed Data register.
400 COM @Afg,Addr
410 !CONTROL 16,25;3 !access A24 space with WRITEIO
420 !
430 INTEGER I,Waveform(1:128) !Calculate triangle wave (dac codes)
440 FOR I=1 TO 64
450 Waveform(I)=I*.0755/.00125
460 Waveform(I)=SHIFT(Waveform(I),-3) !shift bits to dac code positions
470 NEXT I
480 FOR I=65 TO 128
490 Waveform(I)=(128-I)*.0755/.00125
500 Waveform(I)=SHIFT(Waveform(I),-3) !shift bits to dac code positions
510 NEXT I
520 !
530 !Continuously write data (in 16-bit words) to the dac via the
540 !VXIbus and High Speed Data register.
550 LOOP
560 FOR I=1 TO 128
570 WRITEIO -16,Addr;Waveform(I)
580 NEXT I
590 END LOOP
600 SUBEND
610 !
620 SUB Rst
630 Rst: !Subprogram which resets the E1445.
640 COM @Afg,Addr
650 OUTPUT @Afg;"*RST;*OPC?" !reset the AFG
660 ENTER @Afg;Complete
670 SUBEND
Appendix C Register-Based Programming 507