58542 VXIbus Universal Power Meter
A-46
Publication 21555, Rev. E, September 2002
A.10
SRQ Interrupt Examples
10
ASSIGN @Pwr_mtr to 70101
! Set GPIB address
20
DIM Buf$[100]
! Define data buffer
30
ON INTR 7 GOSUB Srq_isp
! Assign interrupt service function
40
ENABLE INTR 7;2
! enable interrupt
50
!
60
CLEAR @Pwr_mtr
! Reset instrument
70
WAIT 1
80
OUTPUT @Pwr_mtr;*CLS
! Clear interface and output queue
90
WAIT 0.3
100
!
110
OUTPUT @Pwr_mtr;*ESE 1
! Enable OPC bit
120
OUTPUT @Pwr_mtr;STAT:OPER:ENAB 7712
! Enable channel 1 & 2 limit and trigger wait mask
130
!
140
Srq_flag=0
! Reset task done flag
150
OUTPUT @Pwr_mtr;CAL1:ZERO?;*OPC
! Zero sensor 1
160
WHILE Srq_flag = 0
! Wait until it is done
170
END WHILE
180
ENTER @Pwr_mtr;Result
! Read zero result
190
IF Result = 0 THEN PRINT Zero is good
200
ELSE
210
PRINT Zero is no good
220
END IF
230
ENTER @Pwr_mtr;Esr_val
! Read ESR status
240
!
250
Srq_flag = 0
! Reset task done flag
260
Meas_flag = 0
! Reset measurement flag
270
OUTPUT @Pwr_mtr;MEAS1?;*OPC
! Measure channel 1 data
280
WHILE Srq_flag = 0
! Wait until it is done
290
END WHILE
300
IF Meas_flag = 0 THEN
! If data is not read
310
ENTER @Pwr_mtr;Result
! Read measurement data
320
END IF
330
ENTER @Pwr_mtr;Esr_val
! Read ESR status
340
!
350
STOP
360
!
370
Srq_isp:!
380
State = SPOLL(@Pwr_mtr)
! Serial poll
390
!
400
IF BIT(State,3) THEN
! Error bit
410
OUTPUT @Pwr_mtr;SYST:ERR?
! Query error message
420
ENTER @Pwr_mtr;Buf$
! Read in
430
PRINT Error:;Buf$
! Print out message
440
END IF
450
!
460
IF BIT(State,7) THEN
! OSB bit
470
!
480
IF BIT(State,4) THEN
! MAV bit
490
ENTER @Pwr_mtr;Result
! Query measurement data
500
Meas_flag = 1
! Set data read flag
510
END IF
520
!
530
OUTPUT @Pwr_mtr;STAT:OPER?
! Query operation status register
540
ENTER @Pwr_mtr;Status
550
PRINT OSB;Status
560
IF BIT(Status,5) THEN PRINT Swift/Burst trigger ready
570
IF BIT(Status,8) THEN PRINT Channel 1 lower limit
580
IF BIT(Status,9) THEN PRINT Channel 1 upper limit
590
IF BIT(Status,10) THEN PRINT Channel 2 lower limit
600
IF BIT(Status,11) THEN PRINT Channel 2 upper limit
610
END IF
620
!
Содержание 58542
Страница 3: ...DECLARATION OF CONFORMITY ...
Страница 4: ......
Страница 18: ...58542 VXIbus Universal Power Meter xiv Publication 21555 Rev E September 2002 ...
Страница 20: ...58542 VXIbus Universal Power Meter xvi Publication 21555 Rev E September 2002 ...
Страница 30: ...58452 VXIbus Universal Power Meter 1 10 Publication 21555 Rev E September 2002 ...
Страница 92: ...58542 VXIbus Universal Power Meter 2 62 Publication 21555 Rev E September 2002 ...
Страница 104: ...58452 VXIbus Universal Power Meter 3 12 Publication 21555 Rev E September 2002 ...
Страница 126: ...58452 VXIbus Universal Power Meter 5 8 Publication 21555 Rev E September 2002 ...
Страница 171: ......
Страница 172: ......
Страница 173: ......
Страница 174: ...21360 Rev A has not been u ...
Страница 175: ......
Страница 176: ......
Страница 177: ......
Страница 178: ......
Страница 179: ......
Страница 180: ......
Страница 181: ......
Страница 182: ......
Страница 248: ...58542 VXIbus Universal Power Meter C 2 Publication 21555 Rev E September 2002 ...