User`s guide

4-37
Programming
Programming Examples
Block diagram of the test system
This example test system uses an Agilent 8153A optical multimeter equipped
with an Agilent 81554SM laser source and an Agilent 81532A optical sensor.
This program periodically (every 5 minutes) measures the optical power
through each device under test and displays an error message if any measured
power drops below 1 microwatt.
Listing 10 INTEGER In_switch_addr,Out_switch_addr,
Opt_meter_addr
20 INTEGER Meas_count,Current_dut
30 REAL Watts_read,Min_power
40 DIM In_switch$[80],Out_switch$[80],Dummy$[50]
50 !
60 CLEAR SCREEN
70 PRINT "THIS PROGRAM MEASURES ALL DUT POWERS EVERY 5
MINUTES."
80 PRINT "IT WILL STOP MEASURING AFTER 50 MEASUREMENT
CYCLES."
90 PRINT "TO HALT PROGRAM EARLIER, PRESS F8."
100 !
110 GOSUB Init_system
120 !
130 ON TIME 300 GOSUB Measure_duts
140 ON KEY 8 LABEL "QUIT" GOTO End_prog
150 !
160 Meas_count=0