1000 !*************************************************
1010 !*
1020 !* FILE       :  SWEAT
1030 !* DESCRIPTION:  Program for SWEAT.
1040 !*
1070 !* PRODUCT    :  4155,4156
1080 !* REVISION   :  Rev.A.01.02
1090 !*
1100 !*   (c) Copyright Agilent Technologies 1994
1110 !*              All rights reserved.
1120 !*
1130 !*
1140 !*  Customer shall have the personal, non-
1150 !* transferable right to use, copy or modify
1160 !* this SAMPLE PROGRAM for Customer's internal
1170 !* operations.  Customer shall use the SAMPLE
1180 !* PROGRAM solely and exclusively for its own
1190 !* purpose and shall not license, lease, market
1200 !* or distribute the SAMPLE PROGRAM or modification
1210 !* or any part thereof.
1220 !*
1230 !*  Agilent shall not be liable for the quality,
1240 !* performance or behavior of the SAMPLE PROGRAM.
1250 !* Agilent especially disclaims that the operation
1260 !* of the SAMPLE PROGRAM shall be uninterrupted or
1270 !* error free.  This SAMPLE PROGRAM is provided
1280 !* AS IS.
1290 !*
1300 !*  AGILENT DISCLAIMS THE IMPLIED WARRANTIES OF
1310 !* MERCHANTABILITY AND FITNESS FOR A PARTICULAR
1320 !* PURPOSE.
1330 !*
1340 !*  Agilent shall not be liable for any infringement
1350 !* of any patent, trademark copyright or other
1360 !* proprietary rights by the SAMPLE PROGRAM or
1370 !* its use. Agilent does not warrant that the SAMPLE
1380 !* PROGRAM is free from infringements or such
1390 !* right of third parties. However, Agilent will not
1400 !* knowingly infringe or deliver a software that
1410 !* infringes the patent, trademark, copyright or
1420 !* other proprietary right of a third party.
1430 !*
1440 !*************************************************
1450  COM @Hp415x
1460  COM /Data/ @File1
1470  COM /Fname/ Ri_file$[12],Ist_file$[12]  ! file names
1480  INTEGER I,Ex_cond
1490  DIM Iforce(0:10000),Cttf(0:10000),Time(0:10000)
1500  !
1510  ASSIGN @Hp415x TO 800               !  Address setting
1520  !
1530  File$=TIME$(TIMEDATE)                    !
1540  File$=File$[1,2]&File$[4,5]&File$[7,7]   ! Creating
1550  CREATE File$,1                           !     Data
1560  ASSIGN @File1 TO File$;FORMAT ON         !       File
1570  !
1580  !----- File name setting -------------
1590  Ri_file$="RINIT.MES"        !  Rinit measurement setup file
1600  Ist_file$="IFVM.MES"        !  Istress measurement setup file
1610  !
1620  !----- Parameter setting -------------
1630  Tcr=.002                    ! Temperature Coefficient of R (1/K)
1640  Rinit_fail=1000             ! Unallowable initial resistance value (ohm)
1650  Tttf=190                    ! Target Time to Failure (sec.)
1660  Ttt=1000                    ! Total Testing Time (sec.)
1670  Troom=298                   ! Room Temperature (K)
1680  Vcomp=20                    ! Voltage compliance of every ports
1690  Isrc_max=1                  ! Current Limit of HPSMU
1700  Errband=2                   ! Allowable Error Band (sec.)
1710  Area=1.E-8                  ! Narrowest cross section (cm^2)
1720  Jstart=.01/Area             ! Initial current density
1730  Rf_set=0                    ! Rfail setting flag
1740  Rfail=0                     ! Dummy Rfail value
1750  Rroom=9.999999E+6           ! Dummy value (Updated after Rinit meas.)
1760  I=0
1770  !
1780  !----- Measurement Body --------------
1790  Init_hp415x                           ! Initialize HP4155/56
1800  Rinit_meas(Rinit)                     ! Rinit measurement
1810  !
1820  PRINT "Rinit measurement end"
1830  !
1840  IF Rinit>Rinit_fail THEN                    !
1850    Ex_cond=10000                             !   Checks Rinit value
1860    PRINT "Initial Resistance is too large."  !
1870    STOP                                      !
1880  END IF                                      !
1890  !
1900  Rref=Rinit                            ! R at room temperature
1910  Calc_cttf(Cttf(0),Jstart,Troom)       ! Initial CTTF calculation
1920  OUTPUT @File1;"CTTF(0)=";Cttf(0)      ! Store 1st CTTF
1930  Get_file(Ist_file$)                   ! Load "Istress" from floppy
1940  !
1950  OUTPUT @Hp415x;":DISP OFF"           ! display lock on
1960  !
1970  Iforce(0)=Jstart*Area           !
1980  Iforce(1)=Iforce(0)             ! 1st I force value
1990  OUTPUT @Hp415x;":PAGE:SCON:STAN ON"   ! Set standby mode
2000  Time(0)=TIMEDATE
2010  !
2020  LOOP
2030    I=I+1
2040    !
2050    OUTPUT @Hp415x;":PAGE:MEAS:SAMP:CONS:SMU5 "&VAL$(Iforce(I))! Update Ifrc
2060    OUTPUT @Hp415x;":PAGE:SCON:STAN ON" ! Set standby mode
2070    !
2080    OUTPUT @Hp415x;":PAGE:SCON:SING"   ! trigger single measurement
2090    OUTPUT @Hp415x;"*OPC?"             ! Wait for operation
2100    ENTER @Hp415x;A                    !            completion
2110    Time(I)=TIMEDATE-Time(0)
2120    !
2130    OUTPUT @Hp415x;"TRAC? 'R'"         ! Extract R_now
2140    ENTER @Hp415x;R_now                !
2150    !
2160    Calc_tmp(Tcr,Rref,Troom,R_now,T_now)    ! Calculate T_now
2170    Calc_cttf(Cttf(I),Iforce(I)/Area,T_now) ! CTTF calculation
2180    !
2190    IF Cttf(I)<Tttf-Errband OR Cttf(I)>Tttf+Errband THEN
2200      Delta_ifrc=Iforce(I)-Iforce(I-1)
2210      IF Delta_ifrc=0 THEN Delta_ifrc=1.E-6
2220      Delta=Delta_ifrc*(Tttf-Cttf(I))/Cttf(I)-Cttf(I-1)
2230      IF Delta>.05 THEN Delta=.05
2240      IF Delta<-.05 THEN Delta=-.05
2250      Iforce(I+1)=Iforce(I)+Delta
2260    ELSE 
2270      IF Rf_set=0 THEN        !
2280        Rfail=R_now*1.5       ! Set Rfail value
2290        Rf_set=1              !
2300      END IF 
2310      Iforce(I+1)=Iforce(I)
2320    END IF 
2330    !
2340    IF Rf_set AND R_now>Rfail THEN Ex_cond=1   ! End test normally
2350    IF Time(I)>Ttt THEN Ex_cond=2              ! Total Testing Time expired
2360    IF Iforce(I+1)>Isrc_max THEN Ex_cond=3     ! Calculated I is too big
2370    IF Iforce(I+1)<=0 THEN Ex_cond=3           ! Calculated I is too small
2380  OUTPUT @Hp415x;":STAT:MEAS?"
2390  ENTER @Hp415x;Meas_stat
2400  IF Meas_stat>=8 AND Ex_cond=0 THEN Ex_cond=4
2410  EXIT IF Ex_cond<>0
2420  END LOOP 
2430  !
2440  Sweat_graph(I,Time(*),Cttf(*))
2450  !
2460  OUTPUT @Hp415x;":PAGE:SCON:STAN OFF"   ! Standby mode OFF
2470  !
2480  OUTPUT @File1;"Exit Condition = ";Ex_cond,"    Loop =";I   ! Store
2490  OUTPUT @File1;"Time to Fail =";Time(I);"(sec.)"            !  Output
2500  OUTPUT @File1;"Fail Resistance =";R_now;"(ohm)"            !   Parameters
2510  OUTPUT @File1;"Fail Temperature =";T_now;"(K)"             !     to a file
2520  OUTPUT @File1;"Fail J =";Iforce(I)/Area;"(A/cm^2)"         !
2530  !
2540  OUTPUT @Hp415x;"PAGE:DISP:GRAP:Y1:MAX "&VAL$(2*Tttf)
2550  OUTPUT @Hp415x;":PAGE:GLIS"       ! Display Graphic page
2560  OUTPUT @Hp415x;":DISP ON"         ! Update Display
2570  ASSIGN @File1 TO *
2580  END
2590  !
2600 Init_hp415x: SUB Init_hp415x
2610    COM @Hp415x
2620    !
2630    CLEAR @Hp415x
2640    OUTPUT @Hp415x;"*CLS;*RST"
2650    OUTPUT @Hp415x;"*ESE 60;*SRE 32;*OPC?"
2660    ENTER @Hp415x;A
2670    OUTPUT @Hp415x;":DISP:WIND:ALL BST"
2680    OUTPUT @Hp415x;":DISP ON"    ! display lock off
2690    PRINT "   <<< SWEAT Test >>>"
2700  SUBEND
2710    !
2720 Get_file:SUB Get_file(Fname$)
2730    COM @Hp415x
2740    OUTPUT @Hp415x;":MMEM:COPY '"&Fname$&"','DISK','MEM1.MES','MEMORY'"
2750    OUTPUT @Hp415x;":MMEM:LOAD:STAT 0,'MEM1.MES','MEMORY'"
2760  SUBEND
2770    !
2780 Rinit_meas:SUB Rinit_meas(Rinit)
2790    COM @Hp415x
2800    COM /Data/ @File1
2810    COM /Fname/ Ri_file$,Ist_file$     !  File names
2820    Get_file(Ri_file$)        ! Load "RINIT" from floppy
2830    OUTPUT @Hp415x;":PAGE:CHAN:COMM 'Rinit measurement'"  ! show comment
2840    OUTPUT @Hp415x;":PAGE:SCON:SING"   ! trigger single measurement
2850    OUTPUT @Hp415x;"*OPC?"             ! Wait operation complete
2860    ENTER @Hp415x;A                    !
2870    OUTPUT @Hp415x;"TRAC? 'Rinit'"
2880    ENTER @Hp415x;Rinit
2890    PRINT 
2900    PRINT "  Rinit=";Rinit;"(ohm)"
2910    PRINT 
2920    OUTPUT @File1;"Rinit=";Rinit;"(ohm)"
2930  SUBEND
2940  !
2950 Calc_cttf:SUB Calc_cttf(Cttf,J_now,T)
2960    COM @Hp415x
2970    COM /Data/ @File1
2980    !
2990    !----- parameter setting -------------
3000    Acc=1.E+10                           ! Acceleration factor (s*A^2/cm^4)
3010    Blk=2                                ! Dimensionless const for Black
3020    Ea=.6                                ! Activation Energy (eV)
3030    K=8.62E-5                            ! Boltzman coeff (eV/K)
3040    !
3050    Exp_p=Ea/(K*T)
3060    IF ABS(Exp_p)>709 AND Acc/J_now^Blk>1 THEN   !
3070      Exp_p=709                                  !  Prevent Real Overflow
3080      Acc=1                                      !
3090      J_now=1                                    !
3100    END IF                                       !
3110    Cttf=Acc*EXP(Exp_p)/J_now^Blk
3120  SUBEND
3130  !
3140 Calc_tmp:SUB Calc_tmp(Tcr,Rref,Tref,R_now,T_now)
3150    COM @Hp415x
3160    COM /Data/ @File1
3170    !
3180    T_now=(R_now-Rref)/(Tcr*Rref)+Tref
3190  SUBEND
3200    !
3210 Sweat_graph:SUB Sweat_graph(INTEGER Meas_points,REAL Time(*),Cttf(*))
3220    COM @Hp415x
3230    COM /Data/ @File1
3240    DIM Time_d(1:10001),Cttf_d(1:10001)
3250    REDIM Time_d(1:Meas_points),Cttf_d(1:Meas_points)
3260    !
3270    FOR I=1 TO Meas_points
3280      Time_d(I)=Time(I)
3290      Cttf_d(I)=Cttf(I)
3300    NEXT I
3310    !
3320    !---- Graphic Axis Setting -----
3330    OUTPUT @Hp415x;"PAGE:DISP:GRAP:X:NAME 'Time'"
3340    OUTPUT @Hp415x;"PAGE:DISP:GRAP:X:SCAL LIN"
3350    OUTPUT @Hp415x;"PAGE:DISP:GRAP:X:MIN 0"
3360    OUTPUT @Hp415x;"PAGE:DISP:GRAP:X:MAX "&VAL$(PROUND(Time_d(Meas_points)+1,0))
3370    OUTPUT @Hp415x;"PAGE:DISP:GRAP:Y1:NAME 'CTTF'"
3380    OUTPUT @Hp415x;"PAGE:DISP:GRAP:Y1:SCAL LIN"
3390    OUTPUT @Hp415x;"PAGE:DISP:GRAP:Y1:MIN 0"
3400    OUTPUT @Hp415x;"PAGE:DISP:GRAP:Y1:MAX "&VAL$(PROUND(2*Cttf_d(Meas_points),0))
3410    !---- Data transfer ------
3420    OUTPUT @Hp415x;"TRAC:DEL:ALL"   ! Delete stored data
3430    OUTPUT @Hp415x;"TRAC:DEF 'Time',"&VAL$(Meas_points)  ! Resize UV
3440    OUTPUT @Hp415x;"TRAC:UNIT 'Time','sec'"              ! Define UNIT
3450    OUTPUT @Hp415x;"TRAC:DEF 'CTTF',"&VAL$(Meas_points)
3460    OUTPUT @Hp415x;"TRAC:UNIT 'CTTF','sec'"              ! Define UNIT
3470    OUTPUT @Hp415x;"TRAC:DATA 'Time',";Time_d(*)      ! Transfer Data to UV
3480    OUTPUT @Hp415x;"TRAC:DATA 'CTTF',";Cttf_d(*)
3490    !
3500    OUTPUT @Hp415x;":PAGE:GLIS"     ! Display Graphic page
3510  SUBEND
