Using the Status Registers
This program teaches the following concepts:
How to use the Status Registers to generate an interrupt if a
SCPI
error occurs. The program sets up the Status Byte and Standard
Event register and interrupts the controller if an error is detected.
How to service the interrupt if an error occurs and read the function
generator’s error queue using the
SYST:ERR?
command.
BASIC / GPIB (Program 4)
10 !
20 ! This program uses the status registers to generate an
30 ! interrupt if a SCPI error occurs. The function generator
40 ! is programmed to output an FM waveform.
50 !
60 CLEAR 7 ! Clear interface - send "device clear"
70 ASSIGN @Fgen TO 710 ! Assign I/O path to address 710
80 COM @Fgen ! Use same address in subprogram
90 INTEGER Hpib,Mask,Value,B ! Declare integer variables
100 OUTPUT @Fgen;"*RST" ! Reset function generator
110 !
120 ! Set up error checking
130 !
140 Hpib=7 ! GPIB select code is "7"
150 ON INTR Hpib CALL Err_msg ! Call subprogram if error occurs
160 Mask=2 ! Bit 1 is SRQ
170 ENABLE INTR Hpib;Mask ! Enable SRQ to interrupt program
180 !
190 OUTPUT @Fgen;"*CLS" ! Clear status registers (clear out old errors)
200 OUTPUT @Fgen;"*SRE 32" ! Enable "Standard Event" bit in Status Byte
210 ! to pull the IEEE-488 SRQ line
220 OUTPUT @Fgen;"*ESE 60" ! Enable error bits (2, 3, 4, or 5) to set
230 ! "Standard Event" bit in Status Byte
240 ! and wait for operation complete
6
Chapter 6 Application Programs
Using the Status Registers
261
Содержание 33120A
Страница 2: ......
Страница 10: ...8 ...
Страница 14: ...Contents Contents 12 ...
Страница 15: ...1 Quick Start 1 ...
Страница 31: ...2 Front Panel Menu Operation 2 ...
Страница 55: ...3 Features and Functions 3 ...
Страница 126: ...124 ...
Страница 127: ...4 Remote Interface Reference 4 ...
Страница 204: ...SCPI Status System Chapter 4 Remote Interface Reference The SCPI Status Registers 202 ...
Страница 228: ...226 ...
Страница 229: ...5 Error Messages 5 ...
Страница 244: ...242 ...
Страница 245: ...6 Application Programs 6 ...
Страница 272: ...270 ...
Страница 273: ...7 Tutorial 7 ...
Страница 299: ...8 Specifications 8 ...
Страница 304: ...302 ...