Generating A Service Request Interrupt; Learn Query (Lrn?); Rs232 Programming Examples - JDS Uniphase SB Series User Manual

Sb series fiberoptic switch
Hide thumbs Also See for SB Series:
Table of Contents

Advertisement

WEND
PRINT sr
END

Generating a Service Request Interrupt

This example tests the service request interrupt function. It unmasks the settled bit in the
SRQ mask register and selects a channel. An interrupt is generated when the switch reaches
the channel.
ON PEN GOSUB SPOLL
PEN ON
PRINT #1, "OUTPUT 07;CSB;SRE 4"
PRINT #1 "OUTPUT 07;CLOSE 6"
' More code executed while switch channel set
'
'
WHILE (INKEY$ = "")
WEND
PEN OFF
END
SPOLL:
PRINT #1, "SPOLL 07"
INPUT #2, sr
PRINT sr
PRINT #1, "SPOLL 07"
INPUT #2, sr
PRINT sr
RETURN

Learn Query (LRN?)

This example demonstrates the use of the learn query.
DIM LEARN$[100]
PRINT #1, "OUTPUT 07;LRN?"
PRINT #1, "ENTER 07"
LINE INPUT #2, LEARN$
' The above variables can be saved in a data file before quitting the program and
' then later read back and used to restore the switch to a same state.
' Like this...
PRINT#1, "OUTPUT 07;"LEARN$
' SB settings are now restored
END

RS232 Programming Examples

This section provides programming examples for controlling the SB switch over the RS232
interface. The examples were written in MS-DOS Qbasic and run on a personal computer
' print final value of sr
' enable SRQ interrupt
' clear status register and unmask
' settled bit in SRQ mask register
' change channel
' endless loop to simulate bigger program
' ends when any key is pressed
' serial poll the switch
' 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 – 32

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents