Agilent Technologies E1470A user manual Vxie

Page 47

Writing to Relay Control

To set one or more relays write a “1” to the bit controlling that relay:

Registers

1. Determine the register and bit locations for the relays you want to set.

 

 

2. Add the decimal values for each bit you want to set in a register.

 

3. Use the VXI:REG:WRITe command to write that decimal value to that

 

register.

 

 

 

 

Examples: Writing to Relay Control Registers

 

In these examples, since you are writing 1s to specific bits, the process

 

actually writes 0s to all other bits in that register thus resetting those relays.

 

To maintain previously established signal paths, you should read the

 

register state and “mask” those bits when writing to the register.

NOTE

 

If Bit 15 is a “1”, BASIC language programming uses a 2s compliment

 

number so the decimal value is negative. For example, FFFFh = -1,

 

8000h = -32768.

 

 

 

If all relays are in their power-on/reset state, to set relay K002 (connect

 

channel CH002 to COM 00), set bit 1 (decimal value 2) in register (base +

 

20h). Use the commands:

 

 

 

 

!Selects logical address

 

VXI:E

 

 

!Writes value 2 to register 20h

 

To set relays K001, K003, K014, K013, and K024 (connect CH 001 to

 

COM 02) set bits

2, 7, 6, and 11 (decimal values 1, 4, 128, 64, 2048

 

respectively), send the decimal value 2245 (1 + 4 + 128 + 64 + 2048 = 2245)

 

to register 20h. Use the commands:

 

 

 

 

!Selects logical address

 

Similarly,VXI:REG:WRITto reset20,2245a relay to its power-on/reset state, write a “0” to the

 

respective bit.

 

 

 

Reading from Relay

Use the VXI:REG:READ? command to read the value of a register. The

Control Registers

value returned is the decimal-weighted sum of all the bits in that register that

 

are set to “” (relays in the “set” state). At power-on/reset, the value returned

 

should be . Use the command:

 

SL120

 

 

!Selects logical address

 

 

 

!Reads from register base + 20h

 

RG:WRIT20,2

 

 

Examples: Writing to Relay Control Registers

 

VXI:The followingE

table shows examples of the decimal values needed to write

 

to a register(s) to connect signal paths. Hundreds more combinations are

 

possible. These tables only show representative samples. Negative values

 

are 2s compliment.

 

 

SL120

 

 

 

Appendix B

SLRG:READ?120

20

Register-Based Programming 47

Image 47
Contents E1470-90002 Page Contents Appendix C RF Switch Error Messages Index Government Restricted Rights Agilent Technologies Warranty StatementDocumentation History Safety SymbolsModel Number Manufacturer’s NameManufacturer’s Address Declares, that the product Product NamePage Chapter Using This ChapterSwitching Diagram Cascade Relays COM 33 332 Creating Multiple Multiplexers Configuring the RF Switch ChapterOn this module RF Switch ConfigurationMaximum POWER. The maximum RF power that can be applied Chapter Configuring the RF SwitchSetting the Logical Address Setting the Interrupt Request Level Installing User Wiring Configuring the RF Switch Chapter Connecting User WiringSMB Connectors and Connector Housings Assembling SMB Connector JacksUser Connections Wiring RF Switch Installing Device DriversProgramming the RF Switch Chapter Addressing the SwitchProgramming Examples Chapter Programming the RF SwitchProgramming the RF Switch Chapter Example Closing a Signal Path Example Opening Closing Signal Paths Example Saving Recalling Module States Programming the RF Switch Chapter Chapter RF Switch Command Reference Command TypesCommon Commands Format Scpi Commands FormatRF Switch Command Reference Chapter Scpi Command ReferenceLinking Commands DIAGnosticCLOSe DIAGnosticReset to its power-on state Common to NC DIAGnosticCLOSe?DIAGnosticOPEN DIAGnosticOPEN relay,relay... opens individual relays onDIAGOPEN333 DIAGnosticOPEN?RSTDIAGThis programCLOS042,043,053,054,256REL?returns DIAGnosticRELAY?ROUTePATHCOMMon ROUTeExample Closing Channel Path 10002 SYSTemVERSion? SYSTemERRor?SYSTem Command Ieee 488.2 Common Commands Quick ReferenceDescription Commands Quick ReferenceAppendix a Appendix a RF Switch SpecificationsRF Switch Specifications Appendix a Addressing Overview Appendix BAbout This Appendix Register AddressingFigure B-1. Register Address Locations Within VXI A16 Base AddressA16 Address Space Outside the Command Module Register-Based Programming Appendix B Register DefinitionsTable B-1. General Register-based Programming Method Table B-2. Register MapTable B-4. Control Register Bit Pattern write Table B-3. Status Register Bit Patterns readRelay Control Registers Vxie Table B-10. Writing to Relay Control Registers Create and open a device session Register Programming ExampleWait 5 seconds before resetting module Void errhandler /* Error Handling Routine Register-Based Programming Appendix B Appendix C Appendix C RF Switch Error MessagesRF Switch Error Messages Appendix C Index IndexIndex E1470-90002