beautypg.com

Measurement Computing Micro 488/EX rev.2.1 User Manual

Page 68

background image

Section 4

General Programming

4.26

310 PRINT:PRINT TAB(10) "Program Aborted"
320 END
330 PRINT:PRINT:PRINT"Resetting Micro488/EX Memory"
340 PRINT#1,"Factory"
350 FOR N = 1 TO 10000 : NEXT N
360 PRINT#1,"Save"
370 '
380 ' restore macros
390 '
400 PRINT: PRINT:PRINT"Restoring Macros"
410 WHILE NOT EOF(2)
420 LINE INPUT #2,A$
430 IF LEFT$(A$,1) = "*" THEN PRINT A$ : GOTO 450 ' skip
comments
440 PRINT#1,A$ : PRINT".";
450 WEND
460 PRINT:PRINT:PRINT"Macro Restoration Completed"
470 END
480 '
490 ' get file name
500 '
510 CLS
520 PRINT:PRINT"Restore Macros from what file? => ";
530 LINE INPUT F$
540 IF F$ = "" THEN PRINT : PRINT CHR$(7) : FILES : GOTO 520
550 IF INSTR(F$,".") THEN GOTO 560 ELSE F$ = F$ + ".mcr"
560 ' check if file already exists
570 ON ERROR GOTO 610
580 OPEN F$ FOR INPUT AS #2
590 ON ERROR GOTO 0 ' turn error off
600 RETURN
610 PRINT:PRINT CHR$(7);F$;" File Not Found " : PRINT
620 FILES
630 RESUME 520

The following describes the functionality of the Restore Macro program

on a line by line basis.

Line 170

Opens the COM1 port on the PC for serial
communications with the Micro488/EX.

Line 180

Sends the ID command to the Micro488/EX to reset it to
known power-on conditions. It utilizes the time delay
provided by line 200; get the output file name.

Line 200

GOSUB

s to Line 480 to get the output file name and

open it.