JDS Uniphase HA9 Series User Manual page 49

Extended range programmable optical attenuator
Table of Contents

Advertisement

Generating a Service Request Interrupt
A service request interrupt is generated when the attenuator completes changing the
attenuation setting.This example tests the service request interrupt function. It unmasks the
settled bit in the SRQ mask register and sends a new attenuation setting.
OPEN "GPIB0" FOR OUTPUT AS #1
OPEN "GPIB0" FOR INPUT AS #2
PRINT #1, "ABORT"
PRINT#1, "GPIBEOS IN CR LF"
PRINT#1, "GPIBEOS OUT CR LF"
ON PEN GOSUB SPOLL
PEN ON
PRINT #1, "OUTPUT 05;CSB;SRE 4"
PRINT #1 "OUTPUT 05;ATT 45"
' More code executed while attenuation set
'
'
WHILE (INKEY$ = "")
WEND
PEN OFF
END
SPOLL:
PRINT #1, "SPOLL 05"
INPUT #2, sr
PRINT sr
PRINT #1, "SPOLL 05"
INPUT #2, sr
PRINT sr
RETURN
Learn Query (LRN?)
This example demonstrates the use of the Learn query:
OPEN "GPIB0" FOR OUTPUT AS #1
OPEN "GPIB0" FOR INPUT AS #2
PRINT #1, "ABORT"
PRINT#1, "GPIBEOS IN CR LF"
PRINT#1, "GPIBEOS OUT CR LF"
PRINT #1, "OUTPUT 05;LRN?"
PRINT #1, "ENTER 05"
INPUT #2, fiber, block, srq_mask, cal, atten, wave
' The above variables can be saved in a data file before quitting the program and
' then later read back and used to restore the attenuator to the same state in ATT mode
Artisan Technology Group - Quality Instrumentation ... Guaranteed | (888) 88-SOURCE | www.artisantg.com
'enable SRQ interrupt
' clear status register and unmask
' settled bit in SRQ mask register
' change attenuation setting
' endless loop to simulate bigger program
' ends when any key is pressed
' serial poll the attenuator
' read status register
' verify SRQ bit is set
' serial poll again to verify SRQ bit is now cleared
' read status register
' send the learn query command
Programming Guide – 43

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents