User`s guide

Table Of Contents
Chapter 9 143
Saving and Recalling (File Management)
Managing Files
9. Saving and Recalling
(File Management)
Example 9-2 File transfer (file_xfr.htb)
10 DIM Src_file$[50],Dst_file$[50],Src_size_char$[50],Inp_char$[30]
20 INTEGER Direction
30 ASSIGN @Agte507x TO 717
40 !
50 CLEAR SCREEN
60 ON ERROR GOTO Direct_select
70 Direct_select: !
80 PRINT "#### File Transfer ####"
90 PRINT " 1: E507x -> Controller"
100 PRINT " 2: Controller -> E507x"
110 PRINT ""
120 PRINT "Input 1 or 2"
130 INPUT "Number?",Inp_char$
140 Direction=IVAL(Inp_char$,10)
150 IF Direction<1 OR Direction>2 THEN Direct_select
160 OFF ERROR
170 !
180 PRINT ""
190 PRINT " Input source file name. ";
200 INPUT "Name?",Src_file$
210 PRINT ": "&Src_file$
220 !
230 IF Direction=2 THEN
240 PRINT " Input source file size. ";
250 INPUT "Size[Byte]?",Src_size_char$
260 PRINT ": "&Src_size_char$&"[Byte]"
270 END IF
280 !
290 PRINT " Input destination file name. ";
300 INPUT "Name?",Dst_file$
310 PRINT ": "&Dst_file$
320 PRINT ""
330 !
340 IF Direction=1 THEN
350 Copy_to_contr(@Agte507x,Src_file$,Dst_file$)
360 ELSE
370 Copy_to_e507x(@Agte507x,Src_file$,Src_size_char$,Dst_file$)
380 END IF
390 !
400 END
410 !=============================================
420 ! File Transfer Function (E507x -> Controller)
430 !=============================================
440 SUB Copy_to_contr(@Agte507x,Src_file$,Dst_file$)
450 DIM Img$[32],Src_size_char$[10],Buff$[9],Err_msg$[100]
460 INTEGER Max_bsize,Block_size,Err_no
470 REAL Src_size
480 !
490 ON ERROR GOTO Skip_purge
500 PURGE Dst_file$
510 Skip_purge: OFF ERROR
520 CREATE Dst_file$,1
530 ASSIGN @Dst_file TO Dst_file$
540 Max_bsize=24576 ! 24KByte
550 !
560 OUTPUT @Agte507x;"*ESE 60"
570 OUTPUT @Agte507x;"*SRE 32"
580 OUTPUT @Agte507x;"*CLS"
590 OUTPUT @Agte507x;"*OPC?"
600 ENTER @Agte507x;Buff$
610 !