Operating instructions

Introduction To Programming
27
Power Supply Test Example Program
l0 ! Power Supply Test Example Program
20 !
30 Current=10 ! Load current in amperes
40 Burn_in_time=36000 ! One hour burn-in time
50 !
60 ON INTR 7 GOSUB Srq_service ! Set up interrupt linkage
70 ENABLE INTR 7;2 ! Enable interrupts for SRQs
80 !
90 OUTPUT 705;"INPUT OFF" ! Disables the inputs
l00 OUTPUT 705;"*SRE 4" ! Enable SRQ (SRQ enable)
110 OUTPUT 705;"STAT:CSUM:ENAB 2" ! Enable Chan 1 (channel summary)
120 OUTPUT 705;"STAT:CHAN:ENAB l024" ! Enable UNR bit (channel status)
130 OUTPUT 705;"MODE:CURRENT" ! Sets CC mode
140 OUTPUT 705;"CURRENT:LEVEL";Current ! Sets the CC level
l50 OUTPUT 705;"INPUT ON" ! Enables the inputs
160 !
170 PRINT "Burn-in test started at ";TIME$(TIMEDATE)
180 !
190 FOR I=1 TO Burn_in_time ! Loop on wait You can write your
200 WAIT .1 ! own power supply test routine and
210 NEXT I ! insert it in this section
220 !
230 OUTPUT 705;"INPUT OFF" ! Disables the inputs at end of test
240 PRINT "Burn-in test complete at ";TIME$(TIMEDATE)
250 STOP
260 !
270 Srq_service ! Service request subroutine
280 Load_status=SPOLL(705) ! Conduct serial poll
290 IF BIT(Load_status, 6) THEN ! Check if SRQ bit is set
300 GOSUB Check_unr
310 ELSE
320 PRINT "A condition other than UNR generated SRQ at ";TIME$(TIMEDATE)
330 END IF ! You can also check the other bits
340 ENABLE INTR 7 ! Re-enable interrupts before return
350 RETURN
360 !
370 Check_unr ! Check if UNR bit still set
380 WAIT 1 ! Wait 1 s before reading UNR bit
390 OUTPUT 705;"STAT:CHAN:COND?" ! Read channel condition register
400 ENTER 705;Value
410 IF Bit(Value, l0)=0 THEN ! Return value for UNR bit only
420 OUTPUT 705;"*CLS" ! If 0, clear channel event register
430 PRINT "UNR was momentarily asserted at ";TIME$(TIMEDATE)
440 ELSE
450 OUTPUT 705;"INPUT OFF" ! Disables the inputs
460 PRINT "UNR is asserted at ";TIME$(TIMEDATE);" Inputs are turned off"
470 STOP
480 END IF
490 RETURN
500 END