Chapter 7 BASIC Language for the 3458A 265
3458A BASIC Language Example Program
The following example program illustrates the use of the 3458A's internal
BASIC language along with the use of new multimeter commands. This
program example uses a Series 300 BASIC computer for program
development and for downloading the program to the multimeter over the
GPIB interface. The multimeter's bus address is 22 and the computer's GPIB
interface address is set to 700.
10 !
20 ! The following program uses the 3458A to calculate
30 ! the mean (throwing away the largest and smallest values).
40 ! Four BASIC language commands are used:
50 ! RMATHV, LET, REAL, and OUTPUT.
60 !
70 !
80 ! RMATHV - Fills a variable with the present value of
90 ! a math register; similar to RMATH.
100 !
110 ! OUTPUT - Returns the value to the source from which the command
120 ! was executed (since the example called the
130 ! subprogram from the GPIB bus, the value of
140 ! AVG is sent over the bus).
150 !
160 ! LET and REAL - Assign values to the specified variables.
170 !
180 !
190 !
200 DIM Rdgs(1:300) ! Dimension data array in computer
210 ASSIGN @Dvm TO 722 ! Set up GPIB address
220 !
230 CLEAR @Dvm
240 OUTPUT @ Dvm; "RESET"
250 WAIT 0.5
260 !
270 OUTPUT @Dvm; "PRESET FAST"
280 OUTPUT @Dvm; "OHM 1000"
290 OUTPUT @Dvm; "APER 167E-6"
300 OUTPUT @ Dvm; "OFORMAT ASCII"
310 OUTPUT @Dvm; "MEM FIFO"
320 OUTPUT @Dvm; "NRDGS 300,TIMER" ! Set up to acquire 300 readings
330 OUTPUT @Dvm; "TIMER 0.0002" ! 5000 Rdgs/sec sample rate
340 !
350 !
360 !
370 OUTPUT @Dvm; "SUB CALC_MEAN" ! Start of DMM subprogram
380 OUTPUT @Dvm; "REAL BIG,SMALL,AVG"! Dimension user variables
390 OUTPUT @Dvm; "MMATH STAT"
400 OUTPUT @Dvm; "RMATHV MEAN, AVG"! New DMM command
410 OUTPUT @Dvm; "RMATHV UPPER, BIG"! New DMM command
420 OUTPUT @Dvm; "RMATHV LOWER, SMALL"! New DMM command
430 OUTPUT @Dvm; "LET M=(AVG*300-BIG-SMALL)/298"!Expression to calc M
440 OUTPUT @Dvm; "OUTPUT M" ! Send calc'ed result to bus
450 OUTPUT @Dvm; "SUBEND" ! End of DMM subprogram
460 OUTPUT @Dvm; "TARM SGL" ! Trigger dmm acquisition
470 T0=TIMEDATE ! Store start time
480 T1=TIMEDATE
490 OUTPUT @ Dvm; "CALL CALC_MEAN"! Tell DMM to execute sub