Buffer save-and-restore program, Store program…… 27 – Measurement Computing DAC488 v.1 User Manual

Page 33

Advertising
background image

DAC488 User’s Manual

DAC488 Operation 27

Buffer Save-and-Restore Program

This BASIC program

DACBUFR.BAS

may be used to save the contents of the DAC488 internal buffer to

disk. It can also be used to load the saved values from disk into the internal buffer.

10 'BASIC program to save and restore the DAC488 buffer contents
20 '
30 'Initialize the IOtech IEEE488 Driver
40 OPEN "\dev\ieeeout" FOR OUTPUT AS #1
50 IOCTL #1, "BREAK"
60 PRINT #1, "RESET"
70 OPEN "\dev\ieeein" FOR INPUT AS #2
75 ON TIMER(5) GOSUB 2000
80 CLS
90 PRINT "DAC488/4 Waveform Buffer Save and Restore Program"
100 PRINT : PRINT " 1 - Save the Waveform Buffer "
110 PRINT " 2 - Restore the Waveform Buffer "
120 PRINT " 3 - Exit the program"
130 PRINT : INPUT "Select the desired function "; FUN
140 IF FUN < 1 OR FUN > 3 THEN PRINT "Invalid selection!": GOTO 100
150 IF FUN = 3 THEN END
160 IF FUN = 1 THEN GOSUB 500 ELSE GOSUB 1000
170 GOTO 80
500 ' Save DAC488/4 waveform buffer
510 '
515 WCNT = 0: TIMER ON
520 OPEN "buffer.sav" FOR OUTPUT AS #3
530 PRINT #1, "output 09;p1c0l0x"
540 PRINT "Saving the DAC488/4 waveform buffer"
550 FOR LOP = 1 TO 2048
560 PRINT #1, "output 09;b?b?b?b?"
570 PRINT #1, "enter 09"
580 LINE INPUT #2, SS$
590 PRINT #3, SS$
600 NEXT LOP
610 CLOSE #3
620 TIMER OFF
630 RETURN
1000 ' Restore DAC488/4 waveform buffer
1010 '
1020 OPEN "buffer.sav" FOR INPUT AS #3
1030 PRINT #1, "output 09;p1c0l0x"
1040 PRINT "Restoring the DAC488/4 waveform buffer"
1045 WCNT = 0: TIMER ON
1050 FOR LOP = 1 TO 2048
1060 LINE INPUT #3, SS$
1070 RS$ = MID$(SS$, 1, 12) + "x" + MID$(SS$, 13, 12) + "x" + MID$(SS$, 25, 12) + "x" +
MID$(SS$, 37, 12) + "x"
1080 PRINT #1, "output 09;"; RS$
1090 NEXT LOP
1100 CLOSE #3
1110 TIMER OFF
1120 RETURN
2000 PRINT "Working - "; : WCNT = WCNT + 1
2010 IF WCNT > 6 THEN PRINT : WCNT = 0
2020 RETURN

Advertising
This manual is related to the following products: