7-74
Chapter 7
Programming Examples
Measurement Process Synchronization Examples
300 Stat=SPOLL(@Nwa)
! Clear any pending SRQs
310 ENABLE INTR 7;2
! Set interrupt on HP-IB bit 2 (SRQ)
320 !
330 DISP "Waiting for bad syntax"
340 WAIT 2
! Pause for 2 seconds
350 !
360 OUTPUT @Nwa;"STIP 2GHZ;;"
! Send bad STOP command syntax
370 !
380 WAIT 2
! Pause for 2 seconds
390 DISP ""
! Clear display line
400 GOTO Finish
! Exit program example
410 !
420 !************************** Subroutines ******************************
430 !
440 Srq_det:
! SRQ handler
450 Stat=SPOLL(@Nwa)
! Read serial poll byte from HP-IB
460 PRINT "Stat from Serial Poll";Stat
470 IF BIT(Stat,6) THEN
! Test for SRQ
480
PRINT "SRQ received from analyzer"
490 ELSE
! No SRQ from analyzer
500
PRINT "SRQ from other device"
510
STOP
! Stop if not from analyzer
520 END IF
530 !
540 IF BIT(Stat,5) THEN
! Event status register bit set
550
PRINT "Event Status Register caused SRQ"
560 ELSE
! Some other bit set
570
PRINT "Some other bit caused the SRQ"
580
STOP
! Stop if bit not set
590 END IF
600
!
610 REPEAT
620
OUTPUT @Nwa;"OUTPERRO;"
! Read analyzer error queue
630
ENTER @Nwa;Err,Error$
! Read error number and string
640
PRINT Err,Error$
! Print error message
650 UNTIL Err=0
! No more errors in queue
660 !
670 PRINT
! White space
680 ENABLE INTR 7;2
! Re-enable SRQ interrupt on HP-IB
690 RETURN
700 !
710 !************************** End Subroutines ******************************
720 !
730 Finish:
! End of program and exit
740 DISP "Finished"
750 OFF INTR 7
! Turn off interrupt
760 LOCAL @Nwa
! Release HP-IB control
770 END
Summary of Contents for 8719ES
Page 15: ...1 1 1 Alphabetical Command Reference ...
Page 293: ...2 1 2 Introduction to Instrument Control ...
Page 310: ...3 1 3 GPIB Programming ...
Page 334: ...4 1 4 Reading Analyzer Data ...
Page 343: ...5 1 5 Data Processing Chain ...
Page 350: ...6 1 6 Error Reporting ...
Page 364: ...7 1 7 Programming Examples ...
Page 502: ...A 1 A Preset Conditions ...
Page 517: ...B 1 B Command Listings ...