1000 !*************************************************
1010 !*
1020 !* FILE       :  DCDAHC
1030 !* DESCRIPTION:  Program for DC Drain Avalanche
1040 !*                       Hot Carrier Induced
1050 !*                       Degradation Test
1090 !* PRODUCT    :  4155,4156
1100 !* REVISION   :  Rev.A.02.03
1110 !*
1120 !*   (c) Copyright Agilent Technologies 1994, 1995
1130 !*              All rights reserved.
1140 !*
1150 !*
1160 !*  Customer shall have the personal, non-
1170 !* transferable right to use, copy or modify
1180 !* this SAMPLE PROGRAM for Customer's internal
1190 !* operations.  Customer shall use the SAMPLE
1200 !* PROGRAM solely and exclusively for its own
1210 !* purpose and shall not license, lease, market
1220 !* or distribute the SAMPLE PROGRAM or modification
1230 !* or any part thereof.
1240 !*
1250 !*  Agilent shall not be liable for the quality,
1260 !* performance or behavior of the SAMPLE PROGRAM.
1270 !* Agilent especially disclaims that the operation
1280 !* of the SAMPLE PROGRAM shall be uninterrupted or
1290 !* error free.  This SAMPLE PROGRAM is provided
1300 !* AS IS.
1310 !*
1320 !*  AGILENT DISCLAIMS THE IMPLIED WARRANTIES OF
1330 !* MERCHANTABILITY AND FITNESS FOR A PARTICULAR
1340 !* PURPOSE.
1350 !*
1360 !*  Agilent shall not be liable for any infringement
1370 !* of any patent, trademark copyright or other
1380 !* proprietary rights by the SAMPLE PROGRAM or
1390 !* its use. Agilent does not warrant that the SAMPLE
1400 !* PROGRAM is free from infringements or such
1410 !* right of third parties. However, Agilent will not
1420 !* knowingly infringe or deliver a software that
1430 !* infringes the patent, trademark, copyright or
1440 !* other proprietary right of a third party.
1450 !*
1460 !*************************************************
1470  COM @Hp415x,@Form_off,INTEGER Hpib_sc,Swm
1480  COM /File_name1/ Param_file$[12],Str_file$[12]
1490  COM /File_name2/ Idvd_file$[12],Ibvg_file$[12]
1500  COM /File_name3/ Igleak_file$[12],Idleak_file$[12],Isleak_file$[12]
1510  COM /File_name4/ Idlin_data$[4],Gmmax_data$[4],Vtext_data$[4],Vtci_data$[4]
1520  COM /Meas_info1/ INTEGER Meas_points,Present,Device,REAL Meas_str_time(1:30)
1530  COM /Meas_info2/ INTEGER Gate(1:12),Source(1:12),Drain(1:12),Bulk(1:12)
1540  COM /Meas_info3/ INTEGER Pin_port(1:48),Result(1:12),No_of_devices,Invalid(1:12)
1550  COM /Meas_info4/ INTEGER Gate_str,Source_str,Drain_str,Bulk_str
1560  COM /Meas_info5/ REAL Vdstr,Vgstr,Vdd,Vbb,Gate_length,Gate_width
1570  COM /Meas_data1/ Vtci_init(1:12),Vtci_shift(1:12,1:30),Idlin_init(1:12),Idlin_shift(1:12,1:30)
1580  COM /Meas_data2/ Gmmax_init(1:12),Gmmax_shift(1:12,1:30),Vtext_init(1:12),Vtext_shift(1:12,1:30)
1590  COM /Meas_data3/ Igleak(1:12),Idleak(1:12),Isleak(1:12)
1600  COM /Device_spec/ REAL Igleak_max,Idleak_max,Isleak_max
1610  COM /Err/ Err_num(1:6),Err_message$(1:6)[50]
1620  INTEGER Show_device,Show_param,Save_at_last,Last_test(1:12)
1630  !
1640  ! ---------- GPIB Setup -------------------------------------------------
1650  INTEGER Hpib_addr,Swm_sc,Swm_addr
1660  !
1670  Hpib_sc=8            ! 415X GPIB Select Code
1680  Hpib_addr=0          ! 415X GPIB Address
1690  !
1700  ASSIGN @Hp415x TO Hpib_sc*100+Hpib_addr
1710  ASSIGN @Form_off TO Hpib_sc*100+Hpib_addr;FORMAT OFF
1720  !
1730  Swm_sc=7              ! 4084B(SWM controller) GPIB Select Code
1740  Swm_addr=22           ! 4084B(SWM controller) GPIB Address
1750  Swm=Swm_sc*100+Swm_addr
1760  !
1770  ! ---------- Input Parameters --------------------------------------------
1780  !
1790  No_of_devices=4      ! Number of test devices
1800  Meas_points=13       ! Number of times to repeat measurements
1810  REDIM Meas_str_time(1:Meas_points)
1820  REDIM Last_test(No_of_devices)
1830  !
1840  ! ---------- Limits for leakage tests ------------------------------------
1850  Igleak_max=2.E-10    ! Maximum gate leakage current
1860  Idleak_max=1.E-8     ! Maximum drain leakage current
1870  Isleak_max=1.E-8     ! Maximum source leakage current
1880  !
1890  ! ----- Drain stress voltage should be determined by Id-Vd characteristics
1900  Vdstr=5              ! Drain stress voltage
1910  Vgstr=2.5            ! Gate stress voltage
1920  Vdd=5                ! Drain nominal voltage
1930  Vbb=0                ! Bulk nominal voltage
1940  !
1950  ! ---------- Device geometries -------------------------------------------
1960  Gate_length=1.E-6    ! Gate length
1970  Gate_width=1.E-5     ! Gate width
1980  !
1990  ! ---------- Pin assignment to determine stress bias condition -----------
2000  Source_str=1         ! Pin assignment of source (Stress)
2010  Drain_str=2          ! Pin assignment of drain (Stress)
2020  Gate_str=3           ! Pin assignment of gate (Stress)
2030  Bulk_str=4           ! Pin assignment of bulk (Stress)
2040  !
2050  ! ---------- Pin assignment for forcing stresses and interim measurements
2060  ! Pin assignment for Device No. = 1
2070  Source(1)=5
2080  Drain(1)=6
2090  Gate(1)=7
2100  Bulk(1)=8
2110  !
2120  ! Pin assignment for Device No. = 2
2130  Source(2)=9
2140  Drain(2)=10
2150  Gate(2)=11
2160  Bulk(2)=12
2170  !
2180  ! Pin assignment for Device No. = 3
2190  Source(3)=13
2200  Drain(3)=14
2210  Gate(3)=15
2220  Bulk(3)=16
2230  !
2240  ! Pin assignment for Device No. = 4
2250  Source(4)=17
2260  Drain(4)=18
2270  Gate(4)=19
2280  Bulk(4)=20
2290  !
2300  ! Pin assignment for Device No. = X
2310  ! Source(X)=XX
2320  ! Drain(X)=XX
2330  ! Gate(X)=XX
2340  ! Bulk(X)=XX
2350  !
2360  ! ---------- Definition of measurement and stress setup files ------------
2370  !
2380  Ibvg_file$="IBVG.MES"     ! Ib-Vg measurement to determine Vgstr
2390  Igleak_file$="IGLEAK.MES" ! Ig - time measurement to check gate leakage
2400  Idleak_file$="IDLEAK.MES" ! Id - time measurement to check drain leakage
2410  Isleak_file$="ISLEAK.MES" ! Is - time measurement to ckeck source leakage
2420  !
2430  Str_file$="DCDAHC.STR"    ! DC stress setup file
2440  ! Str_file$="ACDAHC.STR"  ! AC stress setup file
2450  !
2460  Param_file$="PARAM.MES"   ! Idlin/Gmmax/Vtext/Vtci measurement setup file
2470  !
2480  ! ---------- File name to save ASCII data --------------------------------
2490  Idlin_data$="ID"          ! Idlin shift data file name
2500  Gmmax_data$="GM"          ! Gmmax shift data file name
2510  Vtext_data$="VTE"         ! Vtext shift data file name
2520  Vtci_data$="VTI"          ! Vtci shift data file name
2530  !
2540  ! ---------- Stress duration setup ---------------------------------------
2550 Str_time: !                      ! Stress duration data
2560  DATA      10,     20,     50
2570  DATA     100,    200,    500
2580  DATA    1000,   2000,   5000
2590  DATA   10000,  20000,  50000
2600  DATA  100000
2610  RESTORE Str_time
2620  READ Meas_str_time(*)
2630  !
2640  ! ---------- Setup for drawing / saving data in main menu ----------------
2650  Show_device=0       ! 0:Draw graphs of all devices, Specify device No.
2660  Show_param=0        ! 0:Draw graphs of all params
2670                      ! 1:Idlin, 2:Gmmax, 3:Vtext, 4:Vtci, -1:No graphs
2680  Save_at_last=0   ! 0:Save ASCII data files after each interim test
2690                   ! 1:Save all ASCII data files after completing whole test
2700  !
2710  !///////////////// Main /////////////////////////////
2720  !
2730  CALL Initial_setting             ! Initial setting
2740  CALL Init_hp415x                 ! Initialize 415X
2750  ON INTR Hpib_sc CALL Err_check   ! Enables GPIB interrupt
2760  ENABLE INTR Hpib_sc;2
2770  !
2780  ! --------- Determine Stress Bias Condition ---------
2790  CALL Str_define                  ! Determine DC stress condition
2800  DISP "Connect HCI degradation test devices and press [Continue]."
2810  PAUSE
2820  DISP 
2830  !
2840  ! --- Select Test Device/Initial Characterization ---
2850  Present=0
2860  FOR Device=1 TO No_of_devices
2870    CALL Swm_connect                  ! Connect test device
2880    CALL Device_check                 ! Select test device
2890    IF Invalid(Device)=0 THEN         ! In case of valid device
2900      CALL Param_meas                 ! Initial characterization
2910    ELSE                              ! In case of invalid device
2920      CALL Record_iddata(Present,0)   ! Record Idlin_shift data
2930      CALL Record_gmdata(Present,0)   ! Record Gmmax_shift data
2940      CALL Record_vtedata(Present,0)  ! Record Vtext_shift data
2950      CALL Record_vtidata(Present,0)  ! Record Vtci_shift data
2960    END IF
2970    CALL Swm_clear                 ! Disconnect test device
2980  NEXT Device
2990  !
3000  ! --------- Stress/Interim Characterization ---------
3010  FOR Present=1 TO Meas_points     ! Start stress/measurement cycles
3020    FOR Device=1 TO No_of_devices  ! Connect all test devices
3030      IF Invalid(Device)=0 AND Result(Device)=0 THEN   ! Valid and not exceed Tdc
3040        CALL Swm_connect           ! Connect test devices in parallel
3050      END IF
3060    NEXT Device
3070    !
3080    ! ------------------ Stress -----------------------
3090    CALL Stress                    ! Inclement stress time and force stress
3100    CALL Swm_clear                 ! Disconnect all test devices
3110    !
3120    ! ------------------ 415X calibration ----------
3130    ! IF Meas_str_time(Present)>=1800 THEN CALL Calibration
3140    ! Uncomment above line if calibration is needed before measurements
3150    !
3160    ! ---------- Interim Characterization -------------
3170    FOR Device=1 TO No_of_devices
3180      IF Invalid(Device)=0 AND Result(Device)=0 THEN 
3190      !
3200      ! Measure parameters
3210      !
3220        CALL Swm_connect           ! Connect test device
3230        CALL Param_meas            ! Interim measurement
3240        CALL Swm_clear             ! Disconnect test device
3250        !
3260        ! Record measured data
3270        !
3280        IF Save_at_last=0 THEN     ! Save ASCII data file after each interim meas
3290          CALL Record_iddata(Present,Save_at_last)  ! Record Idlin_shift data
3300          CALL Record_gmdata(Present,Save_at_last)  ! Record Gmmax_shift data
3310          CALL Record_vtedata(Present,Save_at_last) ! Record Vtext_shift data
3320          CALL Record_vtidata(Present,Save_at_last) ! Record Vtci_shift data
3330        END IF
3340        ! IF Save_at_last=0 THEN   ! Save DAT type data file after each interim meas
3350        !   CALL Record_data
3360        ! END IF
3370        !
3380        ! Draw shift graph(s)
3390        !
3400        SELECT Show_device
3410        CASE 0                     ! Draw graphs of all devices
3420          SELECT Show_param
3430          CASE 0                   ! Draw graphs of all parameters
3440            CALL Stress_idgraph    ! Idlin_shift graph
3450            CALL Stress_gmgraph    ! Gmmax_shift graph
3460            CALL Stress_vtegraph   ! Vtext_shift graph
3470            CALL Stress_vtigraph   ! Vtci_shift graph
3480          !
3490          CASE 1                   ! Draw a graph of specified parameter
3500            CALL Stress_idgraph    ! Idlin_shift graph
3510          CASE 2
3520            CALL Stress_gmgraph    ! Gmmax_shift graph
3530          CASE 3
3540            CALL Stress_vtegraph   ! Vtext_shift graph
3550          CASE 4
3560            CALL Stress_vtigraph   ! Vtci_shift graph
3570          END SELECT
3580        CASE ELSE                      ! Draw graphs of specified device
3590          IF Show_device=Device THEN   ! Select device to draw graphs
3600            SELECT Show_param          ! Select parameter to draw graphs
3610            CASE 0                     ! Draw graphs of all parameters
3620              CALL Stress_idgraph      ! Idlin_shift graph
3630              CALL Stress_gmgraph      ! Gmmax_shift graph
3640              CALL Stress_vtegraph     ! Vtext_shift graph
3650              CALL Stress_vtigraph     ! Vtci_shift graph
3660            CASE 1                     ! Draw a graph of specified parameter
3670              CALL Stress_idgraph      ! Idlin_shift graph
3680            CASE 2
3690              CALL Stress_gmgraph      ! Gmmax_shift graph
3700            CASE 3
3710              CALL Stress_vtegraph     ! Vtext_shift graph
3720            CASE 4
3730              CALL Stress_vtigraph     ! Vtci_shift graph
3740            END SELECT
3750          END IF
3760        END SELECT
3770      !
3780      END IF
3790      !
3800      ! Check measured data
3810      !
3820      IF Idlin_shift(Device,Present)>=10 THEN         ! Idlin changed 10%
3830        Result(Device)=1
3840        Last_test(Device)=Present
3850      END IF
3860      !
3870      IF Gmmax_shift(Device,Present)>=10 THEN         ! Gmmax changed 10%
3880        Result(Device)=1
3890        Last_test(Device)=Present
3900      END IF
3910      !
3920      IF ABS(Vtext_shift(Device,Present))>+.02 THEN   ! Vtext changed 20 mV
3930        Result(Device)=1
3940        Last_test(Device)=Present
3950      END IF
3960      !
3970      IF ABS(Vtci_shift(Device,Present))>+.02 THEN    ! Vtci changed 20 mV
3980        Result(Device)=1
3990        Last_test(Device)=Present
4000      END IF
4010      !
4020    NEXT Device
4030  !
4040  !
4050  ! Check termination of test
4060  !
4070    Sum_result=SUM(Invalid)+SUM(Result)   ! No. of devices invalid or exceed Tdc
4080    IF Sum_result=No_of_devices THEN GOTO Complete_test
4090    IF Meas_str_time(Present)>1.E+10^5 THEN GOTO Complete_test
4100  NEXT Present
4110  !
4120 Complete_test: ! End of test
4130  IF Save_at_last=1 THEN  ! Save ASCII data files after completing whole test
4140    FOR Device=1 TO No_of_devices
4150      IF Result(Device)=0 THEN Last_test(Device)=Meas_points
4160      CALL Record_iddata(Last_test(Device),Save_at_last)   ! Record Idlin_shift data
4170      CALL Record_gmdata(Last_test(Device),Save_at_last)   ! Record Gmmax_shift data
4180      CALL Record_vtedata(Last_test(Device),Save_at_last)  ! Record Vtext_shift data
4190      CALL Record_vtidata(Last_test(Device),Save_at_last)  ! Record Vtci_shift data
4200    NEXT Device
4210  END IF
4220  CALL Test_end
4230  DISP "HCI Degradation Test is Completed!!"
4240  !
4250  END
4260  !
4270  !/////////////// Sub //////////////////////////////////////////////
4280 Initial_setting:SUB Initial_setting
4290    COM @Hp415x,@Form_off,INTEGER Hpib_sc,Swm
4300    COM /File_name1/ Param_file$,Str_file$
4310    COM /File_name2/ Idvd_file$,Ibvg_file$
4320    COM /File_name3/ Igleak_file$,Idleak_file$,Isleak_file$
4330    COM /Meas_info1/ INTEGER Meas_points,Present,Device,REAL Meas_str_time(*)
4340    COM /Meas_info2/ INTEGER Gate(*),Source(*),Drain(*),Bulk(*)
4350    COM /Meas_info3/ INTEGER Pin_port(*),Result(*),No_of_devices,Invalid(*)
4360    COM /Meas_info4/ INTEGER Gate_str,Source_str,Drain_str,Bulk_str
4370    COM /Meas_info5/ REAL Vdstr,Vgstr,Vdd,Vbb,Gate_length,Gate_width
4380    COM /Meas_data1/ Vtci_init(*),Vtci_shift(*),Idlin_init(*),Idlin_shift(*)
4390    COM /Meas_data2/ Gmmax_init(*),Gmmax_shift(*),Vtext_init(*),Vtext_shift(*)
4400    COM /Meas_data3/ Igleak(*),Idleak(*),Isleak(*)
4410    COM /Device_spec/ REAL Igleak_max,Idleak_max,Isleak_max
4420    !
4430    ! Redimention of stress time data and measurement data
4440    !
4450    REDIM Meas_str_time(1:Meas_points),Vtci_shift(1:No_of_devices,1:Meas_points)
4460    REDIM Idlin_shift(1:No_of_devices,1:Meas_points),Gmmax_shift(1:No_of_devices,1:Meas_points)
4470    REDIM Vtext_shift(1:No_of_devices,1:Meas_points)
4480    REDIM Vtci_init(1:No_of_devices),Idlin_init(1:No_of_devices)
4490    REDIM Gmmax_init(1:No_of_devices),Vtext_init(1:No_of_devices)
4500    REDIM Igleak(1:No_of_devices),Idleak(1:No_of_devices),Isleak(1:No_of_devices)
4510    REDIM Result(1:No_of_devices),Invalid(1:No_of_devices)
4520    !
4530    ! Initialize test result data
4540    !
4550    FOR Device=1 TO No_of_devices
4560      Invalid(Device)=0
4570      Result(Device)=0
4580    NEXT Device
4590    !
4600    !
4610    DISP 
4620    !
4630  SUBEND
4640    !
4650 Init_hp415x:SUB Init_hp415x
4660    COM @Hp415x,@Form_off,INTEGER Hpib_sc,Swm
4670    COM /File_name1/ Param_file$,Str_file$
4680    COM /File_name2/ Idvd_file$,Ibvg_file$
4690    COM /File_name3/ Igleak_file$,Idleak_file$,Isleak_file$
4700    COM /Meas_info4/ INTEGER Gate_str,Source_str,Drain_str,Bulk_str
4710    COM /Meas_info5/ REAL Vdstr,Vgstr,Vdd,Vbb,Gate_length,Gate_width
4720    !
4730    CLEAR SCREEN
4740    CLEAR @Hp415x
4750    OUTPUT @Hp415x;"*RST"                  ! Device reset
4760    OUTPUT @Hp415x;"*CLS"                  ! Clear status data
4770    OUTPUT @Hp415x;":STAT:PRES"            ! Preset event enable mask register
4780    OUTPUT @Hp415x;":DISP:WIND:STAT OFF"   ! Screen update off
4790    OUTPUT @Hp415x;":CAL:AUTO OFF"         ! Auto calibration off
4800    OUTPUT @Hp415x;"*ESE 60;*SRE 32;*OPC?" ! Event status/service request enable register setup
4810    ENTER @Hp415x;A
4820    OUTPUT @Hp415x;":DISP:WIND:ALL BST"    ! Display IBASIC status screen
4830    !
4840    ! Load initial/interim characterization setup file into internal memory
4850    !
4860    OUTPUT @Hp415x;":MMEM:LOAD:STAT 0,'"&Param_file$&"','DISK'"
4870    OUTPUT @Hp415x;":PAGE:MEAS:SWE:VAR1:STOP "&VAL$(Vdd)
4880    OUTPUT @Hp415x;":PAGE:MEAS:SWE:CONS:SMU4 "&VAL$(Vbb)
4890    OUTPUT @Hp415x;":PAGE:DISP:ANAL:LINE1:POINT1:POS 'VG','"&VAL$(Vdd)&"'"
4900    OUTPUT @Hp415x;":PAGE:DISP:ANAL:LINE2:POINT1:POS 'ID','"&VAL$(Gate_width/Gate_length)&"u'"
4910    OUTPUT @Hp415x;":PAGE:DISP:ANAL:LINE2:POINT2:POS 'ID','"&VAL$(Gate_width/Gate_length)&"u'"
4920    OUTPUT @Hp415x;":MMEM:STOR:STAT 0,'MEM1.MES','MEMORY'"
4930    OUTPUT @Hp415x;":MMEM:DEL '"&Param_file$&"','DISK',"
4940    OUTPUT @Hp415x;":MMEM:STOR:STAT 0,'"&Param_file$&"','DISK'"
4950    !
4960    ! Load stress setup file to 4155/4156
4970    !
4980    OUTPUT @Hp415x;":MMEM:LOAD:STAT 0,'"&Str_file$&"','DISK'"
4990    OUTPUT @Hp415x;":PAGE:STR:SET:CONS:SMU3 ";Vdstr
5000    OUTPUT @Hp415x;":PAGE:STR:SET:CONS:SMU1 ";Vgstr
5010    OUTPUT @Hp415x;":PAGE:STR:SET:CONS:SMU4 ";Vbb
5020    OUTPUT @Hp415x;":MMEM:DEL '"&Str_file$&"','DISK'"
5030    OUTPUT @Hp415x;":MMEM:STOR:STAT 0,'"&Str_file$&"','DISK'"
5040    !
5050  SUBEND
5060    !
5070 Str_define:SUB Str_define
5080    COM @Hp415x,@Form_off,INTEGER Hpib_sc,Swm
5090    COM /File_name1/ Param_file$,Str_file$
5100    COM /File_name2/ Idvd_file$,Ibvg_file$
5110    COM /Meas_info1/ INTEGER Meas_points,Present,Device,REAL Meas_str_time(*)
5120    COM /Meas_info2/ INTEGER Gate(*),Source(*),Drain(*),Bulk(*)
5130    COM /Meas_info3/ INTEGER Pin_port(*),Result(*),No_of_devices,Invalid(*)
5140    COM /Meas_info4/ INTEGER Gate_str,Source_str,Drain_str,Bulk_str
5150    COM /Meas_info5/ REAL Vdstr,Vgstr,Vdd,Vbb,Gate_length,Gate_width
5160    DIM Comment$[58]
5170    !
5180    Connect(FNSmu(1),Gate_str)
5190    Connect(FNSmu(2),Source_str)
5200    Connect(FNSmu(3),Drain_str)
5210    Connect(FNSmu(4),Bulk_str)
5220    !
5230    OUTPUT @Hp415x;":MMEM:LOAD:STAT 0,'"&Ibvg_file$&"','DISK'"
5240    Comment$="Determine DC Stress Condition"
5250    OUTPUT @Hp415x;":PAGE:CHAN:COMM '"&Comment$&"'"
5260    !
5270    OUTPUT @Hp415x;":PAGE:MEAS:SWE:CONS:SMU3 ";Vdstr
5280    OUTPUT @Hp415x;":PAGE:GLIS"
5290    OUTPUT @Hp415x;":DISP:WIND:STAT ON"
5300    OUTPUT @Hp415x;":PAGE:SCON:SING"
5310    OUTPUT @Hp415x;"*OPC?"
5320    ENTER @Hp415x;A
5330    OUTPUT @Hp415x;":DISP:WIND:STAT OFF"
5340    OUTPUT @Hp415x;":TRAC? 'VGSTR'"
5350    ENTER @Hp415x;Vgstr
5360    !
5370    CALL Swm_clear
5380    !
5390    OUTPUT @Hp415x;":PAGE:STR:SET:CONS:SMU1 ";Vgstr
5400    OUTPUT @Hp415x;":MMEM:DEL '"&Str_file$&"','DISK'"
5410    OUTPUT @Hp415x;":MMEM:STOR:STAT 0,'"&Str_file$&"','DISK'"
5420  SUBEND
5430  !
5440 Device_check:SUB Device_check
5450    COM @Hp415x,@Form_off,INTEGER Hpib_sc,Swm
5460    COM /File_name3/ Igleak_file$,Idleak_file$,Isleak_file$
5470    COM /Meas_info1/ INTEGER Meas_points,Present,Device,REAL Meas_str_time(*)
5480    COM /Meas_info3/ INTEGER Pin_port(*),Result(*),No_of_devices,Invalid(*)
5490    COM /Meas_data3/ Igleak(*),Idleak(*),Isleak(*)
5500    COM /Device_spec/ REAL Igleak_max,Idleak_max,Isleak_max
5510    DIM Comment$[58]
5520    !
5530    ! -------- Gate Leakage Current --------
5540    !
5550    OUTPUT @Hp415x;":MMEM:LOAD:STAT 0,'"&Igleak_file$&"','DISK'"
5560    Comment$="Gate Leakage Test for Device No. = "&VAL$(Device)
5570    OUTPUT @Hp415x;":PAGE:CHAN:COMM '"&Comment$&"'"
5580    !
5590    OUTPUT @Hp415x;":PAGE:GLIS"
5600    OUTPUT @Hp415x;":DISP:WIND:STAT ON"
5610    OUTPUT @Hp415x;":PAGE:SCON:SING"
5620    OUTPUT @Hp415x;"*OPC?"
5630    ENTER @Hp415x;A
5640    OUTPUT @Hp415x;":DISP:WIND:STAT OFF"
5650    OUTPUT @Hp415x;":TRAC? 'Igleak'"
5660    ENTER @Hp415x;Ig
5670    Igleak(Device)=Ig
5680    !
5690    IF ABS(Igleak(Device))>Igleak_max THEN 
5700      BEEP 
5710      DISP "Igleak =";Igleak(Device);"(A) (Out of spec)"
5720      PAUSE
5730      DISP "DEVICE No. =";Device;" shall not be used"
5740      PAUSE
5750      Invalid(Device)=1
5760    ELSE
5770    !
5780    ! -------- Drain Leakage Current --------
5790    !
5800      OUTPUT @Hp415x;":MMEM:LOAD:STAT 0,'"&Idleak_file$&"','DISK'"
5810      Comment$="Drain Leakage Test for Device No. = "&VAL$(Device)
5820      OUTPUT @Hp415x;":PAGE:CHAN:COMM '"&Comment$&"'"
5830    !
5840      OUTPUT @Hp415x;":PAGE:GLIS"
5850      OUTPUT @Hp415x;":DISP:WIND:STAT ON"
5860      OUTPUT @Hp415x;":PAGE:SCON:SING"
5870      OUTPUT @Hp415x;"*OPC?"
5880      ENTER @Hp415x;A
5890      OUTPUT @Hp415x;":DISP:WIND:STAT OFF"
5900      OUTPUT @Hp415x;":TRAC? 'Idleak'"
5910      ENTER @Hp415x;Id
5920      Idleak(Device)=Id
5930    !
5940      IF ABS(Idleak(Device))>Idleak_max THEN 
5950        BEEP 
5960        DISP "Idleak =";Idleak(Device);"(A) (Out of spec)"
5970        PAUSE
5980        DISP "DEVICE No. =";Device;" shall not be used"
5990        PAUSE
6000        Invalid(Device)=1
6010      ELSE
6020    !
6030    ! -------- Source Leakage Current --------
6040    !
6050        OUTPUT @Hp415x;":MMEM:LOAD:STAT 0,'"&Isleak_file$&"','DISK'"
6060        Comment$="Source Leakage Test for Device No. = "&VAL$(Device)
6070        OUTPUT @Hp415x;":PAGE:CHAN:COMM '"&Comment$&"'"
6080    !
6090        OUTPUT @Hp415x;":PAGE:GLIS"
6100        OUTPUT @Hp415x;":DISP:WIND:STAT ON"
6110        OUTPUT @Hp415x;":PAGE:SCON:SING"
6120        OUTPUT @Hp415x;"*OPC?"
6130        ENTER @Hp415x;A
6140        OUTPUT @Hp415x;":DISP:WIND:STAT OFF"
6150        OUTPUT @Hp415x;":TRAC? 'Isleak'"
6160        ENTER @Hp415x;Is
6170        Isleak(Device)=Is
6180    !
6190        IF ABS(Isleak(Device))>Isleak_max THEN 
6200          BEEP 
6210          DISP "Isleak =";Isleak(Device);"(A) (Out of spec)"
6220          PAUSE
6230          DISP "DEVICE No. =";Device;" shall not be used"
6240          PAUSE
6250          Invalid(Device)=1
6260        ELSE
6270          DISP "DEVICE No. =";Device;" can be used"
6280          WAIT 3
6290        END IF
6300      END IF
6310    END IF
6320    DISP 
6330  SUBEND
6340  !
6350 Param_meas:SUB Param_meas
6360    COM @Hp415x,@Form_off,INTEGER Hpib_sc,Swm
6370    COM /Meas_info1/ INTEGER Meas_points,Present,Device,REAL Meas_str_time(*)
6380    COM /Meas_data1/ Vtci_init(*),Vtci_shift(*),Idlin_init(*),Idlin_shift(*)
6390    COM /Meas_data2/ Gmmax_init(*),Gmmax_shift(*),Vtext_init(*),Vtext_shift(*)
6400    DIM Comment$[58]
6410    REAL Idlin,Gmmax,Vtext,Vtci
6420    !
6430    OUTPUT @Hp415x;":MMEM:LOAD:STAT 0,'MEM1.MES','MEMORY'"
6440    !
6450    IF Present=0 THEN 
6460      Comment$="HCI, Initial characterization for Device="&VAL$(Device)
6470    ELSE
6480      Comment$="HCI, Interim characterization. @"&VAL$(Meas_str_time(Present))
6490      Comment$=Comment$&"sec, Device="&VAL$(Device)
6500    END IF
6510    OUTPUT @Hp415x;":PAGE:CHAN:COMM '"&Comment$&"'"
6520    OUTPUT @Hp415x;":PAGE:GLIS"
6530    OUTPUT @Hp415x;":DISP:WIND:STAT ON"
6540    OUTPUT @Hp415x;":PAGE:SCON:SING"
6550    OUTPUT @Hp415x;"*OPC?"
6560    ENTER @Hp415x;A
6570    OUTPUT @Hp415x;":DISP:WIND:STAT OFF"
6580    OUTPUT @Hp415x;":TRAC? 'Idlin'"
6590    ENTER @Hp415x;Idlin
6600    OUTPUT @Hp415x;":TRAC? 'Gmmax'"
6610    ENTER @Hp415x;Gmmax
6620    OUTPUT @Hp415x;":TRAC? 'Vtci'"
6630    ENTER @Hp415x;Vtci
6640    OUTPUT @Hp415x;":TRAC? 'Vtext'"
6650    ENTER @Hp415x;Vtext
6660    IF Present=0 THEN 
6670      Idlin_init(Device)=Idlin
6680      Gmmax_init(Device)=Gmmax
6690      Vtext_init(Device)=Vtext
6700      Vtci_init(Device)=Vtci
6710    ELSE
6720      Idlin_shift(Device,Present)=DROUND(ABS((Idlin-Idlin_init(Device))/Idlin_init(Device))*100,6)
6730      Gmmax_shift(Device,Present)=DROUND(ABS((Gmmax-Gmmax_init(Device))/Gmmax_init(Device))*100,6)
6740      Vtext_shift(Device,Present)=DROUND(ABS(Vtext-Vtext_init(Device)),6)
6750      Vtci_shift(Device,Present)=DROUND(ABS(Vtci-Vtci_init(Device)),6)
6760    END IF
6770  SUBEND
6780    !
6790 Stress:SUB Stress
6800    COM @Hp415x,@Form_off,INTEGER Hpib_sc,Swm
6810    COM /Meas_info1/ INTEGER Meas_points,Present,Device,REAL Meas_str_time(*)
6820    REAL Duration,Acc_str
6830    !
6840    DISP "Accumulated Stress Time = "&VAL$(Meas_str_time(Present))
6850    OUTPUT @Hp415x;":STAT:MEAS?"
6860    ENTER @Hp415x;Meas_stat
6870    !
6880    IF Present=1 THEN 
6890      Duration=Meas_str_time(Present)
6900    ELSE
6910      Duration=Meas_str_time(Present)-Meas_str_time(Present-1)
6920    END IF
6930    OUTPUT @Hp415x;":PAGE:STR:SET:DUR "&VAL$(Duration)
6940    IF Duration>10 THEN OUTPUT @Hp415x;":PAGE:STR:SET:SST ABN"
6950    !
6960    OUTPUT @Hp415x;":PAGE:SCON:STR"
6970    REPEAT
6980      OUTPUT @Hp415x;":PAGE:SCON:STAT?"
6990      ENTER @Hp415x;Stat$
7000      OUTPUT @Hp415x;":PAGE:STR:FORC:ACC?"
7010      ENTER @Hp415x;Acc_str
7020      DISP Acc_str;"sec /";Meas_str_time(Present);"sec"
7030    UNTIL Stat$<>"STR"
7040    !
7050    OUTPUT @Hp415x;":STAT:MEAS?"
7060    ENTER @Hp415x;Meas_stat
7070    IF Meas_stat<>0 THEN 
7080      OUTPUT @Hp415x;":PAGE:STR:FORC:ACC?"
7090      ENTER @Hp415x;Acc_str
7100      PRINT "Abnormal Stress Status Occurred!  Resister=";Meas_stat
7110      PRINT "### TEST ABORTED ###";Acc_str;"/";Meas_str_time(Meas_points)
7120      DISP "Abnormal Stress Status Occurred!  Resister=";Meas_stat
7130      STOP
7140    END IF
7150    DISP 
7160  SUBEND
7170    !
7180 Record_iddata:SUB Record_iddata(INTEGER Last_test,Save_at_last)
7190    COM @Hp415x,@Form_off,INTEGER Hpib_sc,Swm
7200    COM /Meas_info1/ INTEGER Meas_points,Present,Device,REAL Meas_str_time(*)
7210    COM /Meas_info3/ INTEGER Pin_port(*),Result(*),No_of_devices,Invalid(*)
7220    COM /Meas_info4/ INTEGER Gate_str,Source_str,Drain_str,Bulk_str
7230    COM /Meas_info5/ REAL Vdstr,Vgstr,Vdd,Vbb,Gate_length,Gate_width
7240    COM /File_name4/ Idlin_data$,Gmmax_data$,Vtext_data$,Vtci_data$
7250    COM /Meas_data1/ Vtci_init(*),Vtci_shift(*),Idlin_init(*),Idlin_shift(*)
7260    !
7270    Save_file$=Idlin_data$&VAL$(Device)
7280    IF Last_test=0 THEN                   ! Invalid device
7290      ON ERROR GOSUB Error
7300      CREATE Save_file$,100
7310      OFF ERROR 
7320      ASSIGN @File TO Save_file$;FORMAT ON
7330      OUTPUT @File;Vdstr,Vgstr,Gate_length,Gate_width
7340      OUTPUT @File;Last_test,0
7350    ELSE                                  ! Valid device
7360      REDIM Meas_str_time(1:Last_test)
7370      ALLOCATE Shift_data(1:Last_test)
7380      !
7390      FOR I=1 TO Last_test
7400        Shift_data(I)=Idlin_shift(Device,I)
7410      NEXT I
7420      !
7430      ! ---------- Purge old Idlin data file ----------------
7440      IF Save_at_last=0 AND Present>=2 THEN 
7450        PURGE Save_file$
7460      END IF
7470      ! ---------- Create Idlin data file ----------------
7480      ON ERROR GOSUB Error
7490      CREATE Save_file$,100
7500      OFF ERROR 
7510      ASSIGN @File TO Save_file$;FORMAT ON
7520      OUTPUT @File;Vdstr,Vgstr,Gate_length,Gate_width
7530      OUTPUT @File;Last_test,Idlin_init(Device)
7540      OUTPUT @File;Shift_data(*)
7550      OUTPUT @File;Meas_str_time(*)
7560      ASSIGN @File TO *
7570      !
7580      DEALLOCATE Shift_data(*)
7590      REDIM Meas_str_time(1:Meas_points)
7600    END IF
7610    SUBEXIT
7620    !
7630 Error:   !
7640    !
7650    OUTPUT @Hp415x;":DISP:WIND:ALL BAS"    ! All IBASIC screen
7660    IF ERRN=56 THEN 
7670      PRINT "Old";Save_file$;"exists. Purge old file and press [Continue]."
7680    ELSE
7690      PRINT ERRM$
7700      PRINT "Take measure(s) to prevent the error and press [Continue]."
7710    END IF
7720    PAUSE
7730    !
7740    CLEAR SCREEN
7750    OUTPUT @Hp415x;":DISP:WIND:ALL BST"    ! Display IBASIC status screen
7760    !
7770    RETURN 
7780    !
7790  SUBEND
7800    !
7810 Record_gmdata:SUB Record_gmdata(INTEGER Last_test,Save_at_last)
7820    COM @Hp415x,@Form_off,INTEGER Hpib_sc,Swm
7830    COM /Meas_info1/ INTEGER Meas_points,Present,Device,REAL Meas_str_time(*)
7840    COM /Meas_info3/ INTEGER Pin_port(*),Result(*),No_of_devices,Invalid(*)
7850    COM /Meas_info4/ INTEGER Gate_str,Source_str,Drain_str,Bulk_str
7860    COM /Meas_info5/ REAL Vdstr,Vgstr,Vdd,Vbb,Gate_length,Gate_width
7870    COM /File_name4/ Idlin_data$,Gmmax_data$,Vtext_data$,Vtci_data$
7880    COM /Meas_data1/ Vtci_init(*),Vtci_shift(*),Idlin_init(*),Idlin_shift(*)
7890    COM /Meas_data2/ Gmmax_init(*),Gmmax_shift(*),Vtext_init(*),Vtext_shift(*)
7900    !
7910    Save_file$=Gmmax_data$&VAL$(Device)
7920    IF Last_test=0 THEN                   ! Invalid device
7930      ON ERROR GOSUB Error
7940      CREATE Save_file$,100
7950      OFF ERROR 
7960      ASSIGN @File TO Save_file$;FORMAT ON
7970      OUTPUT @File;Vdstr,Vgstr,Gate_length,Gate_width
7980      OUTPUT @File;Last_test,0
7990    ELSE                                  ! Valid device
8000      REDIM Meas_str_time(1:Last_test)
8010      ALLOCATE Shift_data(1:Last_test)
8020      !
8030      FOR I=1 TO Last_test
8040        Shift_data(I)=Gmmax_shift(Device,I)
8050      NEXT I
8060      !
8070      ! ---------- Purge old Gmmax data file ----------------
8080      IF Save_at_last=0 AND Present>=2 THEN 
8090        PURGE Save_file$
8100      END IF
8110      ! ---------- Create Gmmax data file ---------------
8120      ON ERROR GOSUB Error
8130      CREATE Save_file$,100
8140      OFF ERROR 
8150      ASSIGN @File TO Save_file$;FORMAT ON
8160      OUTPUT @File;Vdstr,Vgstr,Gate_length,Gate_width
8170      OUTPUT @File;Last_test,Gmmax_init(Device)
8180      OUTPUT @File;Shift_data(*)
8190      OUTPUT @File;Meas_str_time(*)
8200      ASSIGN @File TO *
8210      !
8220      DEALLOCATE Shift_data(*)
8230      REDIM Meas_str_time(1:Meas_points)
8240    END IF
8250    SUBEXIT
8260    !
8270 Error:   !
8280    !
8290    OUTPUT @Hp415x;":DISP:WIND:ALL BAS"    ! All IBASIC screen
8300    IF ERRN=56 THEN 
8310      PRINT "Old";Save_file$;"exists. Purge old file and press [Continue]."
8320    ELSE
8330      PRINT ERRM$
8340      PRINT "Take measure(s) to prevent the error and press [Continue]."
8350    END IF
8360    PAUSE
8370    !
8380    CLEAR SCREEN
8390    OUTPUT @Hp415x;":DISP:WIND:ALL BST"    ! Display IBASIC status screen
8400    !
8410    RETURN 
8420    !
8430  SUBEND
8440    !
8450 Record_vtedata:SUB Record_vtedata(INTEGER Last_test,Save_at_last)
8460    COM @Hp415x,@Form_off,INTEGER Hpib_sc,Swm
8470    COM /Meas_info1/ INTEGER Meas_points,Present,Device,REAL Meas_str_time(*)
8480    COM /Meas_info3/ INTEGER Pin_port(*),Result(*),No_of_devices,Invalid(*)
8490    COM /Meas_info4/ INTEGER Gate_str,Source_str,Drain_str,Bulk_str
8500    COM /Meas_info5/ REAL Vdstr,Vgstr,Vdd,Vbb,Gate_length,Gate_width
8510    COM /File_name4/ Idlin_data$,Gmmax_data$,Vtext_data$,Vtci_data$
8520    COM /Meas_data1/ Vtci_init(*),Vtci_shift(*),Idlin_init(*),Idlin_shift(*)
8530    COM /Meas_data2/ Gmmax_init(*),Gmmax_shift(*),Vtext_init(*),Vtext_shift(*)
8540    !
8550    Save_file$=Vtext_data$&VAL$(Device)
8560    IF Last_test=0 THEN                   ! Invalid device
8570      ON ERROR GOSUB Error
8580      CREATE Save_file$,100
8590      OFF ERROR 
8600      ASSIGN @File TO Save_file$;FORMAT ON
8610      OUTPUT @File;Vdstr,Vgstr,Gate_length,Gate_width
8620      OUTPUT @File;Last_test,0
8630    ELSE                                  ! Valid device
8640      REDIM Meas_str_time(1:Last_test)
8650      ALLOCATE Shift_data(1:Last_test)
8660      !
8670      FOR I=1 TO Last_test
8680        Shift_data(I)=Vtext_shift(Device,I)
8690      NEXT I
8700      !
8710      ! ---------- Purge old Vtex data file ----------------
8720      IF Save_at_last=0 AND Present>=2 THEN 
8730        PURGE Save_file$
8740      END IF
8750      ! ---------- Create Vtex data file ----------------
8760      ON ERROR GOSUB Error
8770      CREATE Save_file$,100
8780      OFF ERROR 
8790      ASSIGN @File TO Save_file$;FORMAT ON
8800      OUTPUT @File;Vdstr,Vgstr,Gate_length,Gate_width
8810      OUTPUT @File;Last_test,Vtext_init(Device)
8820      OUTPUT @File;Shift_data(*)
8830      OUTPUT @File;Meas_str_time(*)
8840      ASSIGN @File TO *
8850      !
8860      DEALLOCATE Shift_data(*)
8870      REDIM Meas_str_time(1:Meas_points)
8880    END IF
8890    SUBEXIT
8900    !
8910 Error:   !
8920    !
8930    OUTPUT @Hp415x;":DISP:WIND:ALL BAS"    ! All IBASIC screen
8940    IF ERRN=56 THEN 
8950      PRINT "Old";Save_file$;"exists. Purge old file and press [Continue]."
8960    ELSE
8970      PRINT ERRM$
8980      PRINT "Take measure(s) to prevent the error and press [Continue]."
8990    END IF
9000    PAUSE
9010    !
9020    CLEAR SCREEN
9030    OUTPUT @Hp415x;":DISP:WIND:ALL BST"    ! Display IBASIC status screen
9040    !
9050    RETURN 
9060    !
9070  SUBEND
9080    !
9090 Record_vtidata:SUB Record_vtidata(INTEGER Last_test,Save_at_last)
9100    COM @Hp415x,@Form_off,INTEGER Hpib_sc,Swm
9110    COM /Meas_info1/ INTEGER Meas_points,Present,Device,REAL Meas_str_time(*)
9120    COM /Meas_info3/ INTEGER Pin_port(*),Result(*),No_of_devices,Invalid(*)
9130    COM /Meas_info4/ INTEGER Gate_str,Source_str,Drain_str,Bulk_str
9140    COM /Meas_info5/ REAL Vdstr,Vgstr,Vdd,Vbb,Gate_length,Gate_width
9150    COM /File_name4/ Idlin_data$,Gmmax_data$,Vtext_data$,Vtci_data$
9160    COM /Meas_data1/ Vtci_init(*),Vtci_shift(*),Idlin_init(*),Idlin_shift(*)
9170    COM /Meas_data2/ Gmmax_init(*),Gmmax_shift(*),Vtext_init(*),Vtext_shift(*)
9180    !
9190    Save_file$=Vtci_data$&VAL$(Device)
9200    IF Last_test=0 THEN                   ! Invalid device
9210      ON ERROR GOSUB Error
9220      CREATE Save_file$,100
9230      OFF ERROR 
9240      ASSIGN @File TO Save_file$;FORMAT ON
9250      OUTPUT @File;Vdstr,Vgstr,Gate_length,Gate_width
9260      OUTPUT @File;Last_test,0
9270    ELSE                                  ! Valid device
9280      REDIM Meas_str_time(1:Last_test)
9290      ALLOCATE Shift_data(1:Last_test)
9300      !
9310      FOR I=1 TO Last_test
9320        Shift_data(I)=Vtci_shift(Device,I)
9330      NEXT I
9340      !
9350      ! ---------- Purge old Vtci data file ----------------
9360      IF Save_at_last=0 AND Present>=2 THEN 
9370        PURGE Save_file$
9380      END IF
9390      ! ---------- Create Vtci data file ----------------
9400      ON ERROR GOSUB Error
9410      CREATE Save_file$,100
9420      OFF ERROR 
9430      ASSIGN @File TO Save_file$;FORMAT ON
9440      OUTPUT @File;Vdstr,Vgstr,Gate_length,Gate_width
9450      OUTPUT @File;Last_test,Vtci_init(Device)
9460      OUTPUT @File;Shift_data(*)
9470      OUTPUT @File;Meas_str_time(*)
9480      ASSIGN @File TO *
9490      !
9500      DEALLOCATE Shift_data(*)
9510      REDIM Meas_str_time(1:Meas_points)
9520    END IF
9530    SUBEXIT
9540    !
9550 Error:   !
9560    !
9570    OUTPUT @Hp415x;":DISP:WIND:ALL BAS"    ! All IBASIC screen
9580    IF ERRN=56 THEN 
9590      PRINT "Old";Save_file$;"exists. Purge old file and press [Continue]."
9600    ELSE
9610      PRINT ERRM$
9620      PRINT "Take measure(s) to prevent the error and press [Continue]."
9630    END IF
9640    PAUSE
9650    !
9660    CLEAR SCREEN
9670    OUTPUT @Hp415x;":DISP:WIND:ALL BST"    ! Display IBASIC status screen
9680    !
9690    RETURN 
9700    !
9710  SUBEND
9720    !
9730 Stress_idgraph:SUB Stress_idgraph
9740    COM @Hp415x,@Form_off,INTEGER Hpib_sc,Swm
9750    COM /Meas_info1/ INTEGER Meas_points,Present,Device,REAL Meas_str_time(*)
9760    COM /Meas_data1/ Vtci_init(*),Vtci_shift(*),Idlin_init(*),Idlin_shift(*)
9770    COM /Meas_data2/ Gmmax_init(*),Gmmax_shift(*),Vtext_init(*),Vtext_shift(*)
9780    DIM Comment$[58]
9790    !
9800    REDIM Meas_str_time(1:Present)
9810    ALLOCATE Init_data(1:Present)
9820    ALLOCATE Shift_data(1:Present)
9830    !
9840    FOR I=1 TO Present
9850      Init_data(I)=Idlin_init(Device)
9860      Shift_data(I)=Idlin_shift(Device,I)
9870    NEXT I
9880    !
9890    Comment$="HCI Idlin Shift(Str="&VAL$(Meas_str_time(Present))&"sec,Device="&VAL$(Device)&")"
9900    OUTPUT @Hp415x;":PAGE:CHAN:COMM '"&Comment$&"'"
9910    !
9920    OUTPUT @Hp415x;":TRAC:DEL:ALL"
9930    OUTPUT @Hp415x;":TRAC:DEF 'Stress',"&VAL$(Present)
9940    OUTPUT @Hp415x;":TRAC:DEF 'IdINT',"&VAL$(Present)
9950    OUTPUT @Hp415x;":TRAC:DEF 'IdSFT',"&VAL$(Present)
9960    OUTPUT @Hp415x;":TRAC:UNIT 'Stress','sec'"
9970    OUTPUT @Hp415x;":TRAC:UNIT 'IdINT','A'"
9980    OUTPUT @Hp415x;":TRAC:UNIT 'IdSFT','%'"
9990    !
10000   OUTPUT @Hp415x;":FORM:DATA REAL,64"
10010   OUTPUT @Hp415x;":FORM:BORD NORM"
10020   OUTPUT @Hp415x;":TRAC 'IdINT',#0";
10030   OUTPUT @Form_off;Init_data(*),END
10040   OUTPUT @Hp415x;":TRAC 'Stress',#0";
10050   OUTPUT @Form_off;Meas_str_time(*),END
10060   OUTPUT @Hp415x;":TRAC 'IdSFT',#0";
10070   OUTPUT @Form_off;Shift_data(*),END
10080   !
10090   OUTPUT @Hp415x;":FORM:DATA ASCII"
10100   !
10110   DEALLOCATE Init_data(*)
10120   DEALLOCATE Shift_data(*)
10130   REDIM Meas_str_time(1:Meas_points)
10140   !
10150   OUTPUT @Hp415x;":PAGE:DISP:GRAP:X:NAME 'Stress'"
10160   OUTPUT @Hp415x;":PAGE:DISP:GRAP:Y1:NAME 'IdSFT'"
10170   OUTPUT @Hp415x;":PAGE:DISP:GRAP:X:SCAL LOG"
10180   OUTPUT @Hp415x;":PAGE:DISP:GRAP:X:MIN 10"
10190   OUTPUT @Hp415x;":PAGE:DISP:GRAP:X:MAX "&VAL$(MAX(Meas_str_time(Meas_points),2))
10200   OUTPUT @Hp415x;":PAGE:DISP:GRAP:Y1:SCAL LOG"
10210   OUTPUT @Hp415x;":PAGE:DISP:GRAP:Y1:MIN 1E-2"
10220   OUTPUT @Hp415x;":PAGE:DISP:GRAP:Y1:MAX 1E+2"
10230   OUTPUT @Hp415x;":PAGE:DISP:SET:GRAP:Y2:DEL"
10240   !
10250   OUTPUT @Hp415x;":PAGE:DISP:DVAR:DEL:ALL"
10260   OUTPUT @Hp415x;":PAGE:DISP:DVAR 'IdINT'"
10270   !
10280   OUTPUT @Hp415x;":PAGE:DISP:ANAL:LINE1:MODE DIS"
10290   OUTPUT @Hp415x;":PAGE:DISP:ANAL:LINE2:MODE DIS"
10300   OUTPUT @Hp415x;":PAGE:DISP:ANAL:MARK:DIS"
10310   !
10320   OUTPUT @Hp415x;":PAGE:GLIS:INT OFF"
10330   OUTPUT @Hp415x;":PAGE:GLIS:LINE OFF"
10340   OUTPUT @Hp415x;":PAGE:GLIS:MARK ON"
10350   OUTPUT @Hp415x;":PAGE:GLIS:MARK:DIR:X MAX"
10360   !
10370   OUTPUT @Hp415x;":DISP:WIND:STAT ON"
10380   OUTPUT @Hp415x;":DISP:WIND:STAT OFF"
10390   !
10400   !
10410 SUBEND
10420   !
10430 Stress_gmgraph:SUB Stress_gmgraph
10440   COM @Hp415x,@Form_off,INTEGER Hpib_sc,Swm
10450   COM /Meas_info1/ INTEGER Meas_points,Present,Device,REAL Meas_str_time(*)
10460   COM /Meas_data1/ Vtci_init(*),Vtci_shift(*),Idlin_init(*),Idlin_shift(*)
10470   COM /Meas_data2/ Gmmax_init(*),Gmmax_shift(*),Vtext_init(*),Vtext_shift(*)
10480   DIM Comment$[58]
10490   !
10500   REDIM Meas_str_time(1:Present)
10510   !
10520   ALLOCATE Init_data(1:Present)
10530   ALLOCATE Shift_data(1:Present)
10540   FOR I=1 TO Present
10550     Init_data(I)=Gmmax_init(Device)
10560     Shift_data(I)=Gmmax_shift(Device,I)
10570   NEXT I
10580   !
10590   Comment$="HCI Gmmax Shift(Str="&VAL$(Meas_str_time(Present))&"sec,Device="&VAL$(Device)&")"
10600   OUTPUT @Hp415x;":PAGE:CHAN:COMM '"&Comment$&"'"
10610   !
10620   OUTPUT @Hp415x;":TRAC:DEL:ALL"
10630   OUTPUT @Hp415x;":TRAC:DEF 'Stress',"&VAL$(Present)
10640   OUTPUT @Hp415x;":TRAC:DEF 'GmINT',"&VAL$(Present)
10650   OUTPUT @Hp415x;":TRAC:DEF 'GmSFT',"&VAL$(Present)
10660   OUTPUT @Hp415x;":TRAC:UNIT 'Stress','sec'"
10670   OUTPUT @Hp415x;":TRAC:UNIT 'GmINT','S'"
10680   OUTPUT @Hp415x;":TRAC:UNIT 'GmSFT','%'"
10690   !
10700   OUTPUT @Hp415x;":FORM:DATA REAL,64"
10710   OUTPUT @Hp415x;":FORM:BORD NORM"
10720   OUTPUT @Hp415x;":TRAC 'GmINT',#0";
10730   OUTPUT @Form_off;Init_data(*),END
10740   OUTPUT @Hp415x;":TRAC 'Stress',#0";
10750   OUTPUT @Form_off;Meas_str_time(*),END
10760   OUTPUT @Hp415x;":TRAC 'GmSFT',#0";
10770   OUTPUT @Form_off;Shift_data(*),END
10780   !
10790   OUTPUT @Hp415x;":FORM:DATA ASCII"
10800   !
10810   DEALLOCATE Init_data(*)
10820   DEALLOCATE Shift_data(*)
10830   REDIM Meas_str_time(1:Meas_points)
10840   !
10850   OUTPUT @Hp415x;":PAGE:DISP:GRAP:X:NAME 'Stress'"
10860   OUTPUT @Hp415x;":PAGE:DISP:GRAP:Y1:NAME 'GmSFT'"
10870   OUTPUT @Hp415x;":PAGE:DISP:GRAP:X:SCAL LOG"
10880   OUTPUT @Hp415x;":PAGE:DISP:GRAP:X:MIN 10"
10890   OUTPUT @Hp415x;":PAGE:DISP:GRAP:X:MAX "&VAL$(MAX(Meas_str_time(Meas_points),2))
10900   OUTPUT @Hp415x;":PAGE:DISP:GRAP:Y1:SCAL LOG"
10910   OUTPUT @Hp415x;":PAGE:DISP:GRAP:Y1:MIN 1E-1"
10920   OUTPUT @Hp415x;":PAGE:DISP:GRAP:Y1:MAX 1E+2"
10930   OUTPUT @Hp415x;":PAGE:DISP:SET:GRAP:Y2:DEL"
10940   !
10950   OUTPUT @Hp415x;":PAGE:DISP:DVAR:DEL:ALL"
10960   OUTPUT @Hp415x;":PAGE:DISP:DVAR 'GmINT'"
10970   !
10980   OUTPUT @Hp415x;":PAGE:DISP:ANAL:LINE1:MODE DIS"
10990   OUTPUT @Hp415x;":PAGE:DISP:ANAL:LINE2:MODE DIS"
11000   OUTPUT @Hp415x;":PAGE:DISP:ANAL:MARK:DIS"
11010   !
11020   OUTPUT @Hp415x;":PAGE:GLIS:INT OFF"
11030   OUTPUT @Hp415x;":PAGE:GLIS:LINE OFF"
11040   OUTPUT @Hp415x;":PAGE:GLIS:MARK ON"
11050   OUTPUT @Hp415x;":PAGE:GLIS:MARK:DIR:X MAX"
11060   !
11070   OUTPUT @Hp415x;":DISP:WIND:STAT ON"
11080   OUTPUT @Hp415x;":DISP:WIND:STAT OFF"
11090   !
11100 SUBEND
11110   !
11120 Stress_vtegraph:SUB Stress_vtegraph
11130   COM @Hp415x,@Form_off,INTEGER Hpib_sc,Swm
11140   COM /Meas_info1/ INTEGER Meas_points,Present,Device,REAL Meas_str_time(*)
11150   COM /Meas_data1/ Vtci_init(*),Vtci_shift(*),Idlin_init(*),Idlin_shift(*)
11160   COM /Meas_data2/ Gmmax_init(*),Gmmax_shift(*),Vtext_init(*),Vtext_shift(*)
11170   DIM Comment$[58]
11180   !
11190   REDIM Meas_str_time(1:Present)
11200   !
11210   ALLOCATE Init_data(1:Present)
11220   ALLOCATE Shift_data(1:Present)
11230   FOR I=1 TO Present
11240     Init_data(I)=Vtext_init(Device)
11250     Shift_data(I)=Vtext_shift(Device,I)
11260   NEXT I
11270   !
11280   !
11290   Comment$="HCI Vtext Shift(Str="&VAL$(Meas_str_time(Present))&"sec,Device="&VAL$(Device)&")"
11300   OUTPUT @Hp415x;":PAGE:CHAN:COMM '"&Comment$&"'"
11310   !
11320   OUTPUT @Hp415x;":TRAC:DEL:ALL"
11330   OUTPUT @Hp415x;":TRAC:DEF 'Stress',"&VAL$(Present)
11340   OUTPUT @Hp415x;":TRAC:DEF 'VteINT',"&VAL$(Present)
11350   OUTPUT @Hp415x;":TRAC:DEF 'VteSFT',"&VAL$(Present)
11360   OUTPUT @Hp415x;":TRAC:UNIT 'Stress','sec'"
11370   OUTPUT @Hp415x;":TRAC:UNIT 'VteINT','V'"
11380   OUTPUT @Hp415x;":TRAC:UNIT 'VteSFT','V'"
11390   !
11400   OUTPUT @Hp415x;":FORM:DATA REAL,64"
11410   OUTPUT @Hp415x;":FORM:BORD NORM"
11420   OUTPUT @Hp415x;":TRAC 'VteINT',#0";
11430   OUTPUT @Form_off;Init_data(*),END
11440   OUTPUT @Hp415x;":TRAC 'Stress',#0";
11450   OUTPUT @Form_off;Meas_str_time(*),END
11460   OUTPUT @Hp415x;":TRAC 'VteSFT',#0";
11470   OUTPUT @Form_off;Shift_data(*),END
11480   !
11490   OUTPUT @Hp415x;":FORM:DATA ASCII"
11500   !
11510   DEALLOCATE Init_data(*)
11520   DEALLOCATE Shift_data(*)
11530   REDIM Meas_str_time(1:Meas_points)
11540   !
11550   OUTPUT @Hp415x;":PAGE:DISP:GRAP:X:NAME 'Stress'"
11560   OUTPUT @Hp415x;":PAGE:DISP:GRAP:Y1:NAME 'VteSFT'"
11570   OUTPUT @Hp415x;":PAGE:DISP:GRAP:X:SCAL LOG"
11580   OUTPUT @Hp415x;":PAGE:DISP:GRAP:X:MIN 10"
11590   OUTPUT @Hp415x;":PAGE:DISP:GRAP:X:MAX "&VAL$(MAX(Meas_str_time(Meas_points),2))
11600   OUTPUT @Hp415x;":PAGE:DISP:GRAP:Y1:SCAL LOG"
11610   OUTPUT @Hp415x;":PAGE:DISP:GRAP:Y1:MIN 1E-6"
11620   OUTPUT @Hp415x;":PAGE:DISP:GRAP:Y1:MAX 1E-1"
11630   OUTPUT @Hp415x;":PAGE:DISP:SET:GRAP:Y2:DEL"
11640   !
11650   OUTPUT @Hp415x;":PAGE:DISP:DVAR:DEL:ALL"
11660   OUTPUT @Hp415x;":PAGE:DISP:DVAR 'VteINT'"
11670   !
11680   OUTPUT @Hp415x;":PAGE:DISP:ANAL:LINE1:MODE DIS"
11690   OUTPUT @Hp415x;":PAGE:DISP:ANAL:LINE2:MODE DIS"
11700   OUTPUT @Hp415x;":PAGE:DISP:ANAL:MARK:DIS"
11710   !
11720   OUTPUT @Hp415x;":PAGE:GLIS:INT OFF"
11730   OUTPUT @Hp415x;":PAGE:GLIS:LINE OFF"
11740   OUTPUT @Hp415x;":PAGE:GLIS:MARK ON"
11750   OUTPUT @Hp415x;":PAGE:GLIS:MARK:DIR:X MAX"
11760   !
11770   OUTPUT @Hp415x;":DISP:WIND:STAT ON"
11780   OUTPUT @Hp415x;":DISP:WIND:STAT OFF"
11790   !
11800 SUBEND
11810   !
11820 Stress_vtigraph:SUB Stress_vtigraph
11830   COM @Hp415x,@Form_off,INTEGER Hpib_sc,Swm
11840   COM /Meas_info1/ INTEGER Meas_points,Present,Device,REAL Meas_str_time(*)
11850   COM /Meas_data1/ Vtci_init(*),Vtci_shift(*),Idlin_init(*),Idlin_shift(*)
11860   COM /Meas_data2/ Gmmax_init(*),Gmmax_shift(*),Vtext_init(*),Vtext_shift(*)
11870   DIM Comment$[58]
11880   !
11890   REDIM Meas_str_time(1:Present)
11900   !
11910   ALLOCATE Init_data(1:Present)
11920   ALLOCATE Shift_data(1:Present)
11930   FOR I=1 TO Present
11940     Init_data(I)=Vtci_init(Device)
11950     Shift_data(I)=Vtci_shift(Device,I)
11960   NEXT I
11970   !
11980   !
11990   Comment$="HCI Vtci Shift(Str="&VAL$(Meas_str_time(Present))&"sec,Device="&VAL$(Device)&")"
12000   OUTPUT @Hp415x;":PAGE:CHAN:COMM '"&Comment$&"'"
12010   OUTPUT @Hp415x;":TRAC:DEL:ALL"
12020   OUTPUT @Hp415x;":TRAC:DEF 'Stress',"&VAL$(Present)
12030   OUTPUT @Hp415x;":TRAC:DEF 'VtiINT',"&VAL$(Present)
12040   OUTPUT @Hp415x;":TRAC:DEF 'VtiSFT',"&VAL$(Present)
12050   OUTPUT @Hp415x;":TRAC:UNIT 'Stress','sec'"
12060   OUTPUT @Hp415x;":TRAC:UNIT 'VtiINT','V'"
12070   OUTPUT @Hp415x;":TRAC:UNIT 'VtiSFT','V'"
12080   !
12090   OUTPUT @Hp415x;":FORM:DATA REAL,64"
12100   OUTPUT @Hp415x;":FORM:BORD NORM"
12110   OUTPUT @Hp415x;":TRAC 'VtiINT',#0";
12120   OUTPUT @Form_off;Init_data(*),END
12130   OUTPUT @Hp415x;":TRAC 'Stress',#0";
12140   OUTPUT @Form_off;Meas_str_time(*),END
12150   OUTPUT @Hp415x;":TRAC 'VtiSFT',#0";
12160   OUTPUT @Form_off;Shift_data(*),END
12170   !
12180   OUTPUT @Hp415x;":FORM:DATA ASCII"
12190   !
12200   DEALLOCATE Init_data(*)
12210   DEALLOCATE Shift_data(*)
12220   REDIM Meas_str_time(1:Meas_points)
12230   !
12240   OUTPUT @Hp415x;":PAGE:DISP:GRAP:X:NAME 'Stress'"
12250   OUTPUT @Hp415x;":PAGE:DISP:GRAP:Y1:NAME 'VtiSFT'"
12260   OUTPUT @Hp415x;":PAGE:DISP:GRAP:X:SCAL LOG"
12270   OUTPUT @Hp415x;":PAGE:DISP:GRAP:X:MIN 10"
12280   OUTPUT @Hp415x;":PAGE:DISP:GRAP:X:MAX "&VAL$(MAX(Meas_str_time(Meas_points),2))
12290   OUTPUT @Hp415x;":PAGE:DISP:GRAP:Y1:SCAL LOG"
12300   OUTPUT @Hp415x;":PAGE:DISP:GRAP:Y1:MIN 1E-6"
12310   OUTPUT @Hp415x;":PAGE:DISP:GRAP:Y1:MAX 1E-1"
12320   OUTPUT @Hp415x;":PAGE:DISP:SET:GRAP:Y2:DEL"
12330   !
12340   OUTPUT @Hp415x;":PAGE:DISP:DVAR:DEL:ALL"
12350   OUTPUT @Hp415x;":PAGE:DISP:DVAR 'VtiINT'"
12360   !
12370   OUTPUT @Hp415x;":PAGE:DISP:ANAL:LINE1:MODE DIS"
12380   OUTPUT @Hp415x;":PAGE:DISP:ANAL:LINE2:MODE DIS"
12390   OUTPUT @Hp415x;":PAGE:DISP:ANAL:MARK:DIS"
12400   !
12410   OUTPUT @Hp415x;":PAGE:GLIS:INT OFF"
12420   OUTPUT @Hp415x;":PAGE:GLIS:LINE OFF"
12430   OUTPUT @Hp415x;":PAGE:GLIS:MARK ON"
12440   OUTPUT @Hp415x;":PAGE:GLIS:MARK:DIR:X MAX"
12450   !
12460   OUTPUT @Hp415x;":DISP:WIND:STAT ON"
12470   OUTPUT @Hp415x;":DISP:WIND:STAT OFF"
12480   !
12490 SUBEND
12500   !
12510 Calibration:SUB Calibration
12520   COM @Hp415x,@Form_off,INTEGER Hpib_sc,Swm
12530   !
12540   OUTPUT @Hp415x;":PAGE:SYST:CDI"
12550   OUTPUT @Hp415x;":DISP:WIND:STAT ON"
12560   OUTPUT @Hp415x;":CAL:ALL?"
12570   ENTER @Hp415x;A
12580   SELECT A
12590   CASE 0
12600     OUTPUT @Hp415x;":PAGE:GLIS"
12610     OUTPUT @Hp415x;":DISP:WIND:STAT OFF"
12620   CASE ELSE
12630     PRINT 
12640     PRINT "     ##### Calibration FAIL ,TEST ABORTED #####"
12650     STOP
12660   END SELECT
12670 SUBEND
12680   !
12690 Connect:SUB Connect(INTEGER Port,Pin)
12700   OPTION BASE 1
12710   COM @Hp415x,@Form_off,INTEGER Hpib_sc,Swm
12720   COM /Meas_info3/ INTEGER Pin_port(*),Result(*),No_of_devices,Invalid(*)
12730   IF Port<0 OR Port>11 THEN CALL Error_rep(1)
12740   IF Pin<1 OR Pin>48 THEN CALL Error_rep(2)
12750   IF Pin_port(Pin)<0 THEN CALL Error_rep(3)
12760   OUTPUT @Hp415x;":PAGE:SCON:STOP"
12770   IF Pin_port(Pin)>=0 THEN Pin_port(Pin)=Port
12780   IF Port=10 THEN 
12790     OUTPUT Swm USING "2A,2Z,2A,2Z";"PC";Port;"ON";Pin
12800   ELSE
12810     OUTPUT Swm USING "2A,Z,2A,2Z";"PC";Port;"ON";Pin
12820   END IF
12830 SUBEND
12840 !
12850 Swm_connect:SUB Swm_connect
12860   COM @Hp415x,@Form_off,INTEGER Hpib_sc,Swm
12870   COM /Meas_info1/ INTEGER Meas_points,Present,Device,REAL Meas_str_time(*)
12880   COM /Meas_info2/ INTEGER Gate(*),Source(*),Drain(*),Bulk(*)
12890   !
12900   OUTPUT @Hp415x;":PAGE:SCON:STOP"
12910   Connect(FNSmu(1),Gate(Device))
12920   Connect(FNSmu(2),Source(Device))
12930   Connect(FNSmu(3),Drain(Device))
12940   Connect(FNSmu(4),Bulk(Device))
12950   !
12960 SUBEND
12970 Swm_clear:SUB Swm_clear
12980   OPTION BASE 1
12990   COM @Hp415x,@Form_off,INTEGER Hpib_sc,Swm
13000   COM /Meas_info3/ INTEGER Pin_port(*),Result(*),No_of_devices,Invalid(*)
13010   INTEGER I
13020   OUTPUT @Hp415x;":PAGE:SCON:STOP"
13030   FOR I=1 TO 48
13040     IF Pin_port(I)>0 THEN Pin_port(I)=0
13050   NEXT I
13060   OUTPUT Swm;"CL"
13070 SUBEND
13080 !
13090 DEF FNSmu(INTEGER Port)
13100   SELECT Port
13110   CASE 1 TO 4
13120     RETURN Port
13130   CASE -1
13140     RETURN 10
13150   CASE ELSE
13160     RETURN -32000
13170   END SELECT
13180 FNEND
13190 !
13200 Err_check:SUB Err_check
13210   COM @Hp415x,@Form_off,INTEGER Hpib_sc,Swm
13220   COM /Err/ Err_num(*),Err_message$(*)
13230   INTEGER I,J
13240   !
13250   OUTPUT @Hp415x;":PAGE:SCON:STOP"
13260   I=0
13270   REPEAT
13280     I=I+1
13290     OUTPUT @Hp415x;":SYST:ERR?"
13300     ENTER @Hp415x;Err_num(I),Err_message$(I)
13310   UNTIL Err_num(I)=0
13320   IF I=1 THEN 
13330     PRINT "No Error"
13340   ELSE
13350     PRINT 
13360     PRINT 
13370     FOR J=1 TO I-1
13380       PRINT "### ERROR Occurred ###:";Err_num(J);Err_message$(J)
13390       DISP "### ERROR Occurred ###:";Err_num(J);Err_message$(J)
13400     NEXT J
13410     OUTPUT @Hp415x;":DISP:WIND:STAT ON"
13420     OUTPUT @Hp415x;":DISP:WIND:ALL BAS"
13430     PRINT 
13440     PRINT "              === Test Aborted ==="
13450     STOP
13460   END IF
13470 SUBEND
13480 !
13490 Error_rep:SUB Error_rep(INTEGER N)
13500   BEEP 
13510   DISP "4085B ERROR";N;"  ";
13520   IF N=1 THEN DISP "Improper port assigned."
13530   IF N=2 THEN DISP "Improper pin assigned."
13540   IF N=3 THEN DISP "This pin board not present."
13550   IF N=4 THEN DISP "Improper port assigned."
13560   IF N=5 THEN DISP "Improper pin assigned."
13570   PAUSE
13580 SUBEND
13590  !
13600 Record_data:SUB Record_data
13610   COM @Hp415x,@Form_off,INTEGER Hpib_sc,Swm
13620   COM /Meas_info1/ INTEGER Meas_points,Present,Device,REAL Meas_str_time(*)
13630   !
13640   Save_file$="D"&VAL$(Device)&"P"&VAL$(Present)
13650   OUTPUT @Hp415x;":MMEM:STOR:TRAC DEF,'"&Save_file$&".DAT','DISK'"
13660   !
13670 SUBEND
13680  !
13690 Test_end:SUB Test_end
13700   COM @Hp415x,@Form_off,INTEGER Hpib_sc,Swm
13710   !
13720   OUTPUT @Hp415x;"*RST"                  ! Device reset
13730   OUTPUT @Hp415x;"*CLS"                  ! Clear status data
13740   OUTPUT @Hp415x;":DISP:WIND:STAT ON"    ! Screen update on
13750   OUTPUT @Hp415x;":DISP:WIND:ALL INST"   ! All instrument screen
13760   !
13770 SUBEND
