beautypg.com

10 restoring the macro buffers from disk – Measurement Computing Micro 488/EX rev.2.1 User Manual

Page 67

background image

Section 4

General Programming

4.25

* Macro 10
Macro 10
Date Format MM/DD/YY
Time Format HH:MM:SS
Wait 2:00 PM
Domacro 4,10,5
Endm10

4.4.10 Restoring the MACRO Buffers From Disk

Once a read macro file has been created, it can be used to program the

macros in the Micro488/EX. The next program example, RESTORE.BAS,
resets the interface to FACTORY conditions and programs the macros from a
file specified by the user. All lines of text included in the file which do not
begin with a "*" comment marker are sent to the Micro488/EX. Comment
Lines are printed to the PC's screen.

By re-setting the Micro488/EX to FACTORY, all data in the log buffer

and any previously defined macros within the Micro488/EX are destroyed.

Restore Macro Program

100 '
110 ' Program to restore the Micro488/EX's macro buffers
120 ' to what was saved with the READMACRO.BAS program.
130 ' Serial control is set to Xon/Xoff
140 ' IOtech, Inc.
150 '
160 ' Open the serial port for communications
170 OPEN "com1:9600,n,8,2" AS 1
180 PRINT#1,"@@"; ' reset the Micro488/EX
190 ' get restoration file name
200 GOSUB 480
210 PRINT:PRINT:PRINT TAB(10) CHR$(7);"CAUTION: If you
continue with this"
220 PRINT TAB(10) "program the Macro488's log buffer and any
previous macros"
230 PRINT TAB(10) " WILL BE LOST!!!!"
240 PRINT:PRINT:PRINT chr$(7) ; "Do you want to continue?
(Y/N) ";
250 K$ = INKEY$ : PRINT K$;
260 IF K$ = "y" OR K$ = "Y" THEN GOTO 330
270 IF K$ = "n" OR K$ = "N" THEN GOTO 290
280 GOTO 250 ' try again for valid key press
290 ' abort the program
300 CLOSE