Example 9. Monitoring The Status Registers - HP 86140A Series User Manual

Optical spectrum analyzer
Table of Contents

Advertisement

Description
Program

Example 9. Monitoring the status registers

This program presets the analyzer and then selects the largest signal using
automeasure. This program demonstrates the use of status registers to detect
programming errors. A serial poll is performed to read the instrument status
byte. The same status byte is read with *STB? . The internal error register is
also read and displayed. The error queue is queried to display the error condi-
tion.
PRINT "OSA Status Byte Example"
OUTPUT 723;"disp:wind:text:data 'OSA Status Byte Example'"
!
!****************** Initialization routine *****************************
!
PRINT
OUTPUT 723;"*rst"
PRINT "Presetting the analyzer"
!
PRINT
OUTPUT 723;"disp:wind:trac:all:scal:auto"
PRINT "Performing Automeasure"
!
!***********************************************************************
!
PRINT
! Next line is the operation complete query used so that the text is not printed
! until after the Automeasure is complete
OUTPUT 723;"*opc?"
ENTER 723;Dum
PRINT "... measurement begins"
!
OUTPUT 723;"*CLS"
!
OUTPUT 723;"*ESE 32"
!
OUTPUT 723;"init:imm"
! Next line is the operation complete query used so that the text is not printed
! until after the Autoalign is complete
OUTPUT 723;"*opc?"
ENTER 723;Dum
!
Sbyte=SPOLL(723)
PRINT
PRINT "Serial Poll Status Byte:";Sbyte
PRINT
!
OUTPUT 723;"*stb?"
ENTER 723;Stat
PRINT "Status Byte Register:";Stat
PRINT
Remote Operation
Example Programs
! Preset the analyzer
! Automeasure
! Clear Error Queue
! Set Standard Event Enable bit 5(32)
! Take a sweep
! Read serial poll status byte
! Read the Status Byte Register
4-29

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents