Agilent Technologies E1465A Automobile Parts User Manual


 
Register-Based Programming 95Appendix B
Example: Scanning
Channels (BASIC)
This BASIC programming example scans through the bank 0 channels
(closing one switch at a time) and makes measurements between switch
closures. You must insert your own programming code for the measurement
part of this program. For example, if you are using the E1411B, see the
E1326B/E1411B Multimeter User's Manual for programming examples.
10 !**************************************************
20 !***** SCANNING *****
30 !**************************************************
40 OPTION BASE 1
50 !
Set up arrays to store register names and addresses
60 DIM Reg_name$(1:1)[32], Reg_addr(1:1)
70 !
80 !
Read register names and addresses into the arrays
90 READ Reg_name$(*)
100 READ Reg_addr(*)
110 !
Set base address variable
120 Base_addr = DVAL("DE00",16)
130 !
140 !
Map the A16 address space in the controller
150 CONTROL 16,25;2
160 !
Call the subprogram Scan_meas
170 Scan_meas(Base_addr, Reg_addr(*))
180 !
190 DATA Bank0 channels register
200 DATA 06
210 END
.
.
.
270 !
This subprogram sets all bits in bank0 open then scans through
280 !
bank 0, closing one channel at a time (waits for the channel to
290 !
be closed) so a measurement can be made.
300 SUB Scan_meas(Base_addr, Reg_addr(*))
310 !
320 WRITEIO -16, Base_addr + Reg_addr(1);0
330 FOR I= 0 to 15
340 WRITEIO -16, Base_addr + Reg_addr(1);2^I
350 REPEAT
360 UNTIL BIT(READIO(-16,Base_addr+4),7)
370 PRINT "Making Measurements"
.
. !
Make Measurements
.
420 NEXT I
430 WRITEIO -16,Base_addr + Reg_addr(1);0
440 SUBEND