Agilent Technologies E1442-90003 Switch User Manual


 
E1442A Application Examples 45Chapter 2
Using Scanning
Trigger Sources
The 75,*6285 command specifies the source to advance the scan.
You can use the 75,* command to advance the scan when 75,*6285%86
or 75,*6285+2/' is set. The 2873XW command can be used to enable
the E1406A Command Module Trig Out port.
Using the Scan
Complete Bit
You can use the Scan Complete bit (bit 8) in the Operation Status Register
of a switchbox to determine when a scanning cycle completes (no other bits
in the register apply to the switchbox). Bit 8 has a decimal value of 256 and
you can read it directly with the 67$723(5" command. See the
67$7H23(5DWLRQDO>(9(1W@" command in Chapter 3 for an example.
When enabled by the STAT:OPER:ENAB 256 command, the Scan
Complete bit will be reported as bit 7 of the Status Register. Use the GPIB
Serial Poll or the IEEE 488.2 Common command *STB? to read the Status
Register.
When bit 7 of the Status Register is enabled by the *SRE Common
command to assert a GPIB Service Request (SRQ), you can interrupt the
computer when the Scan Complete bit is set after a scanning cycle
completes. This allows the computer to do other operations while the
scanning cycle is in progress.
The following example monitors bit 7 in the Status Register to determine
when the scanning cycle completes. This example uses BASIC as the
programming language. The computer interfaces with an E1406 Command
Module over GPIB. The GPIB select code is 7, the GPIB primary address is
09, and the GPIB secondary address is 15.
10 OUTPUT 70915;"*CLS"
!Clear all switchbox status structure
20 OUTPUT 70915;"STAT:OPER:ENAB 256"
(Qable Scan Complete Bit to set bit 7 in Status Reg
30 OUTPUT 70915;"*SRE 128"
!Enable bit 7 of Status Register to assert SRQ
40 OUTPUT 70915;"TRIG:SOUR EXT"
!Set to external trigger mode
50 OUTPUT 70915;"SCAN (@100:147)"
!Select channels to be scanned
60 OUTPUT 70915;"INIT"
!Start scanning cycle
70 WHILE NOT BIT(SPOLL(70915),7)
!Waiting for scan complete
80 PRINT "DO OTHER OPERATION HERE"
!Enter program lines for computer to do other oper
90 END WHILE
100 PRINT "INTERRUPT GENERATED"
!Program goes to this line after interrupt is generated
!by a completed scanning cycle.