Sending Commands; Serial Polling The Status Register - JDS Uniphase SB Series User Manual

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

Advertisement

equipped with a National Instruments
Universal Language Interface drivers loaded. The commands that control the GPIB are similar
4
to Hewlett Packard
HP Basic commands. Most other controller board manufacturers provide
basic output and input statements for communicating messages to a GPIB instrument.
Before using any of these samples, ensure that the GPIB address is set to 7, the interface
command set is SB, the ULI.EXE driver is loaded, and the switch is connected to the computer
via a GPIB cable.
The GPIB commands provided in this section do not always show the terminating sequence
<CR><LF>; however, it is implied.

Sending Commands

This example sets the SB switch to channel 6 and turns on all the external relay drivers.
' set up the interface card and drivers
OPEN "GPIB0" FOR OUTPUT AS #1
OPEN "GPIB0" FOR INPUT AS #2
PRINT #1, "ABORT"
' set terminating character to CR LF sequence
PRINT #1, "GPIBEOS OUT CR LF"
PRINT #1, "GPIBEOS IN CR LF"
' sample commands"close 6; xdrs 255"
PRINT #1, "OUTPUT 07;CLOSE 6;XDRS 255"
' sample queries
PRINT #1, "OUTPUT 07;CLOSE?"
PRINT #1, "ENTER 07"
INPUT #2, a
PRINT "channel ",a
PRINT #1, "OUTPUT 07;XDRS?"
PRINT #1, "ENTER 07"
INPUT #2, a
PRINT "driver state ",a
END

Serial Polling the Status Register

This example changes the channel setting and reads the status register continuously until the
output has settled.
PRINT #1, "OUTPUT 07;csb"
bit
PRINT #1, "OUTPUT 07;CLOSE 12"
sr = 0
WHILE ((sr AND 4 ) =0)
PRINT #1, "SPOLL 07"
INPUT #2, sr
3
ational Instruments is a trademark of National Instruments.
N
4
ewlett Packard is a registered trademark of Hewlett-Packard Co.
H
3
GPIB interface board, with National Instruments
' clearing the status byte clears the settling
' change channel
' initialize sr variable to enter the while loop
' loop until settled bit is true
' serial poll SB switch
Programming Guide – 31

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents