Using The Status Registers - HP 34401A User Manual

Hide thumbs Also See for 34401A:
Table of Contents

Advertisement

Chapter 6 Application Programs

Using the Status Registers

Using the Status Registers
The following example shows how you can use the multimeter's status
registers to determine when a command sequence is completed. For
more information, see "The SCPI Status Model," starting on page 134.
The example is shown in HP BASIC and QuickBASIC (see page 190).
HP-IB Operation Using HP BASIC
10
REAL Aver,Min_rdg,Max_rdg
20
INTEGER Val,Hpib,Mask,Task
30
ASSIGN @Dmm TO 722
40
CLEAR 7
50
OUTPUT @Dmm; "*RST"
60
OUTPUT @Dmm; "*CLS"
70
OUTPUT @Dmm; "*ESE 1"
80
OUTPUT @Dmm; "*SRE 32" ! Enable "standard event" bit in status byte
90
OUTPUT @Dmm; "*OPC?"
100
ENTER @Dmm; Val
110
!
120
! Configure the multimeter to make measurements
130
!
140
OUTPUT @Dmm; "CONF:VOLT:DC 10"
150
OUTPUT @Dmm; "VOLT:DC:NPLC 10"
160
OUTPUT @Dmm; "TRIG:COUN 100"
170
OUTPUT @Dmm; "CALC:FUNC AVER;STAT ON"
180
OUTPUT @Dmm; "INIT"
190
OUTPUT @Dmm; "*OPC"
200
!
210
Hpib=7
220
ON INTR Hpib GOSUB Read_data
230
Mask=2
240
ENABLE INTR Hpib;Mask
250
!
260
! Execute other tasks while waiting for data
270
!
Continued on next page ’
188
! Clear HP-IB and dmm
! Reset dmm
! Clear dmm status registers
! Enable "operation complete" bit to set
! "standard event" bit in status byte
! to pull the IEEE-488 SRQ line
! Assure synchronization
! Set dmm to 10 volt dc range
! Set the integration time to 10 PLCs
! Dmm will accept 100 triggers
! Select min-max and enable math
! Place dmm in "wait-for-trigger" state
! Set "operation complete" bit in standard event
! registers when measurement is complete
! Bit 1 is SRQ
! Enable SRQ to interrupt the program

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

34401-90004

Table of Contents