Agilent Technologies E1446A user manual Case, END Select, Else, END if

Models: E1446A

1 161
Download 161 pages 46.15 Kb
Page 153
Image 153

640! If output relay open (disabled) but should be closed, clear main

650! output enable bit.

660!

670IF Out1_state AND NOT BINAND(READIO(-16,Base_addr+ 4),256) THEN

680WRITEIO -16,Base_addr+ 10;BINAND(READIO(-16,Base_addr+ 10),-17)

690END IF

700!

710! Set up output and input relays. Close new relays, particularly the

720! attenuation and impedance relays, before opening old relays to prevent

730! a possible momentary all-open situation which could output a high-

740! voltage glitch.

750!

760! Do output side first

770!

780

SELECT Out1_atten

! Set main output attenuation

790

CASE 0.

 

800

Out_ctrl= 128

! Close 0 dB path relay

810

CASE 20.

 

820

Out_ctrl= 64

! Close 20 dB path relay

830END SELECT

840!

850

SELECT Out1_imped

! Set main output impedance

860

CASE 0.

 

870

Out_ctrl= BINIOR(Out_ctrl,34)

! Close 0 Ohm relay

880

CASE 50.

 

890

Out_ctrl= BINIOR(Out_ctrl,32)

! Close 50 Ohm relay

900

CASE 75.

 

910

Out_ctrl= BINIOR(Out_ctrl,0)

! 75 Ohm - no action

920END SELECT

930!

940! If output relay was closed (enabled), set new state here. If it

950! was open, close it before previous configuration is removed.

960!

970IF BINAND(READIO(-16,Base_addr+ 4),256) THEN

980IF Out1_state THEN

990

Out_ctrl= BINIOR(Out_ctrl,16)

! Relay close

1000

ELSE

 

1010

Out_ctrl= BINAND(Out_ctrl,-17)

! Relay open

1020

END IF

 

1030

END IF

 

1040

!

 

Continued on Next Page

C-28 Register-Based Programming

Example Programs

Page 153
Image 153
Agilent Technologies E1446A user manual Case, END Select, Else, END if