User manual

Table Of Contents
MAUI Oscilloscopes Remote Control and Automation Manual
Serial Polling
Serial polling takes place once the SRQ interrupt line has been asserted, and is only advantageous when
you are using several oscilloscopes at once. The controller finds which oscilloscope has generated the
interrupt by inspecting the SRQ bit in the STB register of each. Because the service request is based on an
interrupt mechanism, serial polling offers a reasonable compromise in terms of servicing speed in
multiple-device configurations.
The following example uses the command INE 1 to enable the event "new signal acquired" for reporting
the INR to the INB bit of the status byte STB. The command *SRE 1 enables the INB of the status byte to
generate an SRQ whenever it is set. The function call IBWAIT instructs the computer to wait until one of
three conditions occurs:
l &H8000 in the mask (MASK%) corresponds to a GPIB error.
l &H4000 to a timeout error.
l &H0800 to the detection of RQS (ReQuest for Service) generated by the SRQ bit.
Whenever IBWAIT detects RQS, it automatically performs a serial poll to find out which oscilloscope
generated the interrupt. It only exits if a timeout occurs or if the oscilloscope (SCOPE%) generated SRQ.
The additional function call IBRSP fetches the value of the status byte, which may be further interpreted.
To work properly, the value of "Disable Auto Serial Polling" must be set to "off" in the GPIB handler (use
IBCONF.EXE to check).
Example: Serial Polling
CMD$ = "*CLS ; INE 1;*SRE 1"
CALL IBWRT (SCOPE%, CMD$)
MASK% = &HC800
CALL IBWAIT (SCOPE%, MASK%)
IF (IBSTA% AND &HC000) <> 0 THEN PRINT "GPIB or Timeout Error" : STOP
CALL IBRSP (SCOPE%, SPR%)
PRINT "Status Byte =.", SPR%
After the serial poll is completed, the RQS bit in the STB status register is cleared. Note that the other STB
register bits remain set until they are cleared by means of a *CLS command or the oscilloscope is reset. If
these bits are not cleared, they cannot generate another interrupt.
5-12