E-4
Example Programs
Generating SRQ on buffer full
When your program must wait until the Model 6514 has completed an operation, it is more
efficient to program the 6514 to assert the IEEE-488 SRQ line when it is finished, rather than
repeatedly serial polling the instrument. An IEEE-488 controller will typically address the in-
strument to talk and then unaddress it each time it performs a serial poll. Repeated polling of the
Model 6514 will generally reduce its overall reading throughput. Therefore, use the srq%() func-
tion call.
The Model 6514 provides a status bit for almost every operation it performs. It can be pro-
grammed to assert the IEEE-488 SRQ line whenever a status bit becomes true or false. The
IEEE-488 controller (your computer) can examine the state of the SRQ line without performing
a serial poll, thereby detecting when the 6514 has completed its task without interrupting it in
the process.
The following example program segment sets up the Model 6514 to assert SRQ when the
reading buffer has completely filled and then arms the reading buffer, initiates readings, and
waits for the Model 6514 to indicate that the buffer is full.
This is not a complete program. The commands to configure the trigger model and the reading
buffer (see the next example) are not shown. The example shown here can be modified for any
event in the Model 6514 status reporting system.
‘ For QuickBASIC 4.5 and CEC PC488 interface card, edit
‘ the following line where the QuickBASIC libraries are
‘ on your computer:
‘ $INCLUDE: ‘c:\qb45\ieeeqb.bi’
‘ Initialize the CEC interface as address 21:
CALL initialize(21, 0)
‘ Reset STATus subsystem (not affected by *RST)
CALL SEND(14, "stat:pres;*cls", status%)
CALL SEND(14, "stat:meas:enab 512", status%)
'enable BFL
CALL SEND(14, "*sre 1"' status%)
'enable MSB
CALL SEND(14, "trac:feed:cont next", status%)
‘ Start everything
CALL SEND(14, "init", status%)
WaitSRQ:
IF (NOT(srq%()) THEN GOTO WaitSRQ
CALL SPOLL(14, poll%, status%)
IF (poll% AND 64)=0 THEN GOTO WaitSRQ
After the program has detected an asserted SRQ line, it serial polls the Model 6514 to deter-
mine if it is the device requesting service. This is necessary for two reasons:
•
Serial polling the Model 6514 causes it to stop asserting the SRQ line.
•
In test systems that have more than one IEEE-488 instrument programmed to assert
SRQ, your program must determine which instrument is actually requesting service.
Содержание 6514
Страница 203: ...14 CommonCommands...
Страница 207: ...15 SCPISignalOriented MeasurementCommands...
Страница 235: ...18 PerformanceVerification...
Страница 254: ...19 Calibration...
Страница 274: ...20 RoutineMaintenance...
Страница 278: ...A Specifications...
Страница 282: ...B StatusandErrorMessages...
Страница 288: ...C GeneralMeasurement Considerations...
Страница 294: ...D DDCEmulationCommands...
Страница 299: ...E ExamplePrograms...
Страница 306: ...F IEEE 488BusOverview...
Страница 320: ...G IEEE 488andSCPI ConformanceInformation...
Страница 324: ...H CalibrationOptions...