A - 12 APPLICATION PROGRAM EXAMPLES
A.5.3 Running a pass/fail test
In the following example the current pass/fail test setup is started and monitored.
During monitoring, use is made of the pass/fail status bit (bit 10) in the OPERation
status register to detect a failing waveform. The OPERation bit (bit 7) in the
standard status byte is used to generate a service request (SRQ) when a failing
waveform is detected. If so, the failing waveform is read from memory register 3.1,
and stored on disk under file name FAILTRAC.DAT. In this example, this is
repeated for five failing waveforms.
Application summary:
•
Enable the pass/fail status bit (bit 10 = value 1024) in the OPERation status
register to be reported by sending: STATus:OPERation:ENABle 1024
•
Enable the OPERation status event bit (bit 7 = value 128) in the standard
status byte (STB) to be reported by sending:
*
SRE 128
•
Enable the SRQ mechanism to generate an interrupt after "OPERation event"
(routine ServReq is executed).
•
Open the file FAILTRAC.DAT for output.
•
Start pass/fail checking by sending:
DISPlay:MENU MEASure Enables display of MEASURE menu.
SYSTem:KEY 6 Selects PASS/FAIL.
SYSTem:KEY 5 Sets PASS/FAIL at run.
DISPlay:MENU:STATe OFF Disables display of MEASURE menu.
•
Let the program execution sleep (or do something else) to wait for a service
request to be generated at the occurrence of a failing waveform.
•
If an SRQ is generated (failing waveform), do the following:
- Stop pass/fail checking by sending:
DISPlay:MENU MEASure Enables display of MEASURE menu.
SYSTem:KEY 6 Selects PASS/FAIL.
SYSTem:KEY 5 Sets PASS/FAIL at stop.
- Read the failing waveform from memory 3.1 by sending: TRACe? M3_1
and by reading the response trace data.
- Write the trace data buffer to the opened file FAILTRAC.DAT.
- Start pass/fail checking again by sending:
SYSTem:KEY 5 Sets PASS/FAIL at run.
DISPlay:MENU:STATe OFF Disables display of MEASURE menu.
- Repeat this test 5 times.
•
Routine ServReq does the following:
- Serial polls the status byte to reset the SRQ mechanism.
- Reads the OPERation event status register to clear the FAIL bit.
- Sets the SRQ.detected flag to signal that an SRQ interrupt occurred.
Application program:
Note: The Q(uick)BASIC program is supplied on floppy under file name
EXAPPA53.BAS. The program code that runs under TestTeam Plus and
LabWindows is supplied on floppy under file name EXAPPB53.BAS.