Agilent Technologies A.18.00 Weather Radio User Manual


 
417
Chapter 7, IBASIC Controller
PROGram Subsystem
Uploading a Program From the Test Set
The following BASIC program copies an IBASIC program from the Test Set’s
IBASIC Controller RAM to the external controller and then stores it to a file on
the external controller’s currently assigned mass storage device.
When the upload program is entered and run on the external controller, the
operator is prompted for the name of the file to store the IBASIC program in. As
the upload program is running, the total number of characters in the program, and
the number of characters transferred, are displayed.
10 !Upload an IBASIC program in Test Set to an external controller.
20 DIM Prog_line$[200] !Holds longest program line in Test Set
30 DIM File_name$[10] !Holds the name of file to store IBASIC program
40 Addr=714 !Test Set GPIB address
50 LINPUT "Enter name of file to store IBASIC program in:",File_name$
60 OUTPUT Addr;"PROG:DEF?"
70 ENTER Addr USING "X,D,#";Count_length !Get length of count field
80 !Get number of characters in program, includes CR/LF on each line
90 ENTER Addr USING VAL$(Count_length)&"D,#";Chars_total
100 !Create ASCII file to hold program, add 5 records for buffer
110 CREATE ASCII File_name$,(Chars_total/256)+5
120 ASSIGN @File TO File_name$
130 LOOP
140 ENTER Addr;Prog_line$ !Read in one program line
150 OUTPUT @File;Prog_line$ !Store in file
160 Chars_xferd=Chars_xferd+LEN(Prog_line$)+2 !CR/LF not read
170 DISP Chars_xferd;"of";Chars_total;"characters transferred."
180 EXIT IF Chars_xferd>=Chars_total
190 END LOOP
200 ENTER Addr;Msg_terminator$ !Terminate the block data transfer
210 ASSIGN @File TO * !Close the file
220 END