Programming Examples
92
Agilent
8169A
Polarization Controller, Second Edition
510
520
530
540
550
560
570
580
590
600
610
620
630
640
650
660
670
680
690
700
710
720
730
740
750
760
770
780
790
800
810
820
830
840
850
860
870
880
900
910
920
930
940
950
960
970
980
990
1000
1010
1020
1030
1040
1050
1060
1070
Inc=-Inc/2
ELSE
Inc=-Inc
Maxward=True
END IF
ELSE
Maxpow=Newpow
Maxward=True
END IF
UNTIL ABS(Inc)<.05
!
! Now search for the worst-case polarization when changing thetap
!
Angle=0
Inc=10
Minward=False
Minpow=Maxpow
REPEAT
Angle=Angle+Inc
OUTPUT Pol;"circle:thetap ";Angle
OUTPUT Mm;"read2:power?"
ENTER Mm;Newpow
IF Newpow>Minpow THEN
IF Minward=True THEN
Inc=-Inc/2
ELSE
Inc=-Inc
Minward=True
END IF
ELSE
Minpow=Newpow
Minward=True
END IF
UNTIL ABS(Inc)<.05
!
! Now search for the overall worst-case polarization by changing epsilonb
!
Angle=0
Minward=False
REPEAT
Angle=Angle+Inc
OUTPUT Pol;"circle:epsilonb ";Angle
OUTPUT Mm;"read2:power?"
ENTER Mm;Newpow
IF Newpow>Minpow THEN
IF Minward=True THEN
Inc=-Inc/2
ELSE
Inc=-Inc
Minward=True
END IF
ELSE
Minpow=Newpow
Minward=True
END IF
UNTIL ABS(Inc)<.05