Sample Program - Agilent Technologies E5052A Programmer's Manual

Signal source analyzer
Hide thumbs Also See for E5052A:
Table of Contents

Advertisement

Sample program

Example 5-1 shows a sample program for transferring files between the external controller
and the E5052A.
This program reads out data from a specified file on the E5052A and then writes them to a
specified file on the external controller.
Example 5-1
Sample of file transfer
1000
1010
1020
1030
1040
1050
1060
1070
1080
1090
1100
"&Dst_file$&"(@Controller)"
1110
1120
1130
1140
1150
1160
1170
1180
1190
1200
1210
1220
1230
1240
1250
1260
1270
1280
1290
1300
1310
1320
1330
1340
Chapter 5
DIM Src_file$[50],Dst_file$[50]
DIM Buff$[9],Img$[32],Src_size_char$[10]
INTEGER Max_bsize,Block_size
REAL Src_size
ASSIGN @Agte5052 TO 717
Src_file$="f:\state01.sta"
Dst_file$="a:state01.sta"
CREATE Dst_file$,1
ASSIGN @Dst_file TO Dst_file$
Max_bsize=24576
PRINT "Now Copying: "&Src_file$&"(@E5052) ->
OUTPUT @Agte5052;":MMEM:DATA? """&Src_file$&""""
WAIT .5
ENTER @Agte5052 USING "#,A";Buff$
ENTER @Agte5052 USING "#,A";Digit$
Img$="#, "&Digit$&"A"
ENTER @Agte5052 USING Img$;Src_size_char$
Src_size=VAL(Src_size_char$)
WHILE Src_size>0
IF Src_size>Max_bsize THEN
Block_size=Max_bsize
ELSE
Block_size=Src_size
END IF
ALLOCATE Dat$[Block_size]
Img$="#, "&VAL$(Block_size)&"A"
ENTER @Agte5052 USING Img$;Dat$
OUTPUT @Dst_file USING Img$;Dat$
DEALLOCATE Dat$
Src_size=Src_size-Block_size
END WHILE
PRINT "Done"
ENTER @Agte5052 USING "#,A";Buff$
ASSIGN @Dst_file TO *
END
Saving and Recalling (File Management)
Managing Files
81

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents