HP SB manual Setting the Interface Command Set, Querying Status, Reading the Status Register

Page 38

equipped with a serial port. COM port 2 of the computer is designated as the serial port and is connected to the switch.

Before using any of these examples, ensure that the active interface command set is SB.

The RS232 interface cannot receive an SRQ interrupt.

The RS232C commands that appear in this section do not always show the terminating character <CR>; however, it is implied.

Sending Commands

OPEN "COM2:1200,N,8,1" FOR RANDOM AS #3

A = 10

PRINT#3, "CLOSE ";A

PRINT#3, "XDRS 255"

END

Querying Status

This example queries and displays the current channel setting.

PRINT#3, "CLOSE?"

INPUT#3, A

PRINT A

END

Reading the Status Register

The serial polling function is not supported on any RS232 interface, but STB? can be used to query the status register since the query command performs the same function as serial polling.

This example changes the channel setting and reads the status register continuously until the output has settled.

OPEN "COM2:1200,N,8,1" FOR RANDOM AS #3

 

PRINT#3, "CSB"

' clear status register

PRINT#3, "CLOSE 5"

 

DO

' loop until motor settles

PRINT#3, "STB?"

 

INPUT#3, SR1

 

LOOP UNTIL (SR1 AND 4)

 

PRINT SR1

 

END

 

Setting the Interface Command Set

The SB switch can be set to emulate the interface command sets of earlier models of JDS Uniphase SC Series and SX Series switches.

Programming Guide – 33

Image 38 Contents
SB Series Fiberoptic Switch User’s ManualPage Contents Programming Guide SD000153 Rev. J May Safety Information, Instructions, and Symbols Safety InformationOperating the Unit Safety InstructionsBefore Initializing and Operating the Unit Safety Proceeding Safety SymbolsSymbol Compliance CE ComplianceGeneral Information General Information and SpecificationsSingle-Common SB-C Switch Configuration Dual-Common SB-D Switch Configuration Single Step Dual Common SB-E Switch ConfigurationStandard Accessories Dual-Common Blocking SB-F Switch ConfigurationKey Features Optional AccessoriesSpecifications Parameter Typical MaximumEnvironmental ElectricalPhysical Initial Inspection Getting StartedBefore Initializing and Operating the Unit Operating EnvironmentStoring and Shipping Cleaning Connectors Installing the Switch Connector Cleaning connector type can varyOperating Keys Operating and Maintenance InstructionsFront Panel Key DescriptionRear Panel External Switch Module ConnectionsExternal Switch Module without TTL Input Controls External Switch Module with TTL Input Controls Sample Driver Application Electrical Equivalent of DriverPowering Up the Switch Using and Selecting a ChannelControlling the Drivers Setting the Gpib AddressSetting the Interface Command Set for SC and SX Switches Controlling the Switch Remotely by RS232 Interface Controlling the Switch LocallyControlling the Switch Remotely by Gpib Interface Print #1, CLOSE? Input #1,A$ Print A$ END Calibrating the SwitchMaintaining the Switch Operating and Maintenance Instructions Programming Guide Gpib Pin AssignmentRS232 Pin Assignment RS232 Interface SpecificationsGpib Interface Functions Mnemonic FunctionCommand Parser Rules Operation and Query CommandsName Symbol Pin Number Signal Direction RS232 Driver Pin AssignmentClose Set Optical Channel Operation CommandsReset XDR i k Driver ControlQuery Commands Drivers Error NumberLast Number Error Learn Status Register Status Reporting and Service Request Control Condition Register SRQ Mask Register Bit Gpib Programming ExamplesSRQ Mask Register Sending Commands Serial Polling the Status RegisterLearn Query LRN? Generating a Service Request InterruptRS232 Programming Examples Reading the Status Register Setting the Interface Command SetQuerying Status Syntax Function SC Series Switch Command Set SCXXX-0XXX ModelsSX Series Switch Command Set Bit MessageRQS Busy Normal BAD Data Unit Failure