Agilent Technologies A.18.00 Weather Radio User Manual


 
389
Chapter 7, IBASIC Controller
Method #3. Developing Programs Using Word Processor on a PC (Least Preferred)
10 ! ASCII_DN
20 ! Program to download ASCII program file from PC to the Test Set through RS-232
30 ! ######################################################################
40 !
50 ! This program must be loaded into the Test Set and run on the Test Set.
60 ! It directs ASCII characters that come in the Serial Port 9 to a file
70 ! named "TEMP_CODE" on an SRAM card. After the transfer is complete,
80 ! you must SCRATCH this program and GET the transferred program from
90 ! the "TEMP_CODE" file.
100 !
110 ! #####################################################################
120 COM /File_name/ File_name$[10]
130 DIM In$[200]
140 File_name$="TEMP_CODE" !File name on RAM card
150 CLEAR SCREEN
160 CLEAR 9 !Clears Test Set serial bus
170 OUTPUT 800;"*RST"
180 ! Set up Test Set Serial Port 9 to receive ASCII text file
190 OUTPUT 800;"CONF:SPORT:BAUD ’9600’;PAR ’None’;DATA ’8 Bits’"
200 OUTPUT 800;"CONF:SPORT:STOP ’1 Bit’;RPAC ’Xon/Xoff’;XPAC ’Xon/Xoff’"
210 OUTPUT 800;"CONF:SPORT:SIN ’IBASIC’;IBECHO ’OFF’"
220 CALL Code(File_name$,In$)
230 END
240 Purge_it:SUB Purge_it !Purges File_name on card
250 COM /File_name/ File_name$
260 OFF ERROR
270 PURGE File_name$&":INTERNAL"
280 SUBEND
290 Code:SUB Code(File_name$,In$)
300 ON ERROR CALL Purge_it !Branches if CREATE statement returns error
310 CREATE ASCII File_name$&":INTERNAL",650 !Creates file on card
320 OFF ERROR
330 ASSIGN @File TO File_name$&":INTERNAL"
340 PRINT TABXY(1,5);"Ready to receive ASCII file data."
350 PRINT
360 Begin:ON TIMEOUT 9,1 GOTO Begin !Loops until data begins coming
370 ENTER 9;In$
380 OUTPUT @File;In$
390 PRINT In$
400 Transfer:LOOP !Loops to bring in ASCII file one line at a time
410 ON TIMEOUT 9,5 GOTO Done !Exit loop if data stops for >5 sec.
420 ENTER 9;In$
430 PRINT In$
440 OUTPUT @File;In$
450 END LOOP
460 Done:ASSIGN @File TO *
470 CLEAR SCREEN
480 ! Returns Test Set Serial Port 9 input to "instrument" allowing serial
490 ! communication to the IBASIC Command line field.
500 OUTPUT 800;"CONF:SPORT:SIN ’Inst’;IECHO ’ON’;IBECHO ’ON’"
510 PRINT TABXY(1,5);"Down load of ASCII file is complete."
520 SUBEND