2420-01.txt

Togotech (토론 | 기여)님의 2020년 5월 16일 (토) 16:59 판 (새 문서: Keithley 2420 <pre> 50 OPTION BASE 1 60 DIM Id$[81] 70 INTEGER I,Count,Nop 80 Nop=1001 90 ALLOCATE D(Nop,3) 100 ASSIGN @Src TO 724 110 OUTPUT @Src;"*RST"...)
(차이) ← 이전 판 | 최신판 (차이) | 다음 판 → (차이)

Keithley 2420

50     OPTION BASE 1
60     DIM Id$[81]
70     INTEGER I,Count,Nop
80     Nop=1001
90     ALLOCATE D(Nop,3)
100    ASSIGN @Src TO 724
110    OUTPUT @Src;"*RST"
120    WAIT 1
130    OUTPUT @Src;"*IDN?"
140    ENTER @Src;Id$
150    CLEAR SCREEN
160    DISP LEN(Id$),Id$
170    GOSUB Fileopen
180    GOSUB Measure0  !ASCII
190 !  GOSUB Measure1  !REAL,64  !안된다.
200    GOSUB Fileclose
210    STOP
220 Measure0: !
230    OUTPUT @Src;"FORM:DATA ASC "
240    OUTPUT @Src;"FORM:ELEM VOLT,CURR,TIME"
250 ! xxx = VOLT : CURR
260    Source$="CURR"
270    Sense$="VOLT"
280    OUTPUT @Src;"SOUR:FUNC CURR"
290    OUTPUT @Src;"SOUR:CURR:MODE SWE"     !Select sweep sourcing mode
300    OUTPUT @Src;"SOUR:DEL 0"          !Set source delay 0sec
310 !  OUTPUT @Src;"SOUR:DEL:AUTO ON"       !Enable/disable auto delay
320 ! logarithmic sweeps
330    OUTPUT @Src;"SOUR:SWE:SPAC LOG"      !Select sweep scale LIN | LOG
340 !  OUTPUT @Src;"SOUR:SWE:RANG BEST"     !Select source ranging BEST ! AUTO ! FIXed
350    OUTPUT @Src;"SOUR:CURR:STAR 0.00001" !Specify sweep start level  min = 10uA
360    OUTPUT @Src;"SOUR:CURR:STOP 0.1"     !Specify sweep stop level
370    OUTPUT @Src;"SOUR:SWE:POIN ";Nop     !Set number of sweep points 2~2500
380    OUTPUT @Src;"SENS:FUNC ""VOLT"""     !Sense$ !Select measure function
390    OUTPUT @Src;"SENS:VOLT:NPLC 0.01"    !
400    OUTPUT @Src;"SENS:VOLT:RANG:AUTO ON" !
410    OUTPUT @Src;"TRIG:COUN ";Nop         !Set trigger count to 5.
420    OUTPUT @Src;"*OPC?"
430    ENTER @Src;Tmp
440    OUTPUT @Src;"SYST:TIME:RES"          !Reset timestamp to zero seconds 실행해야 시간 정밀도 높아짐
450    OUTPUT @Src;"OUTP ON"                !Turn output on. BEEP
460    OUTPUT @Src;"READ?"                  !Trigger sweep and acquire data.
470    ENTER @Src;D(*)
480    OUTPUT @Src;"OUTP OFF"               !Turn output off.
490    OUTPUT @File;"No.,Time[s],Volt[V],Curr[A]"
500    FOR I=1 TO Nop
510      PRINT I,D(I,3),D(I,1),D(I,2)
520      OUTPUT @File;I,D(I,3),D(I,1),D(I,2)
530    NEXT I
540    RETURN
550 Measure1:  !REAL,64
560    ASSIGN @Src1 TO 724;FORMAT OFF,SWAP ON  !???????????
570 !  DIM H$[2]
580    OUTPUT @Src;"FORM:DATA REAL,64"
590    OUTPUT @Src;"FORM:ELEM VOLT,CURR,TIME"
600 ! xxx = VOLT : CURR
610    Source$="CURR"
620    Sense$="VOLT"
630    OUTPUT @Src;"SOUR:FUNC CURR"
640    OUTPUT @Src;"SOUR:CURR:MODE SWE"     !Select sweep sourcing mode
650    OUTPUT @Src;"SOUR:DEL 0"          !Set source delay 0sec
660 !  OUTPUT @Src;"SOUR:DEL:AUTO ON"       !Enable/disable auto delay
670 ! logarithmic sweeps
680    OUTPUT @Src;"SOUR:SWE:SPAC LOG"      !Select sweep scale LIN | LOG
690 !  OUTPUT @Src;"SOUR:SWE:RANG BEST"     !Select source ranging BEST ! AUTO ! FIXed
700    OUTPUT @Src;"SOUR:CURR:STAR 0.00001" !Specify sweep start level  min = 10uA
710    OUTPUT @Src;"SOUR:CURR:STOP 0.1"     !Specify sweep stop level
720    OUTPUT @Src;"SOUR:SWE:POIN ";Nop     !Set number of sweep points 2~2500
730    OUTPUT @Src;"SENS:FUNC ""VOLT"""     !Sense$ !Select measure function
740    OUTPUT @Src;"SENS:VOLT:NPLC 0.01"    !
750    OUTPUT @Src;"SENS:VOLT:RANG:AUTO ON" !
760    OUTPUT @Src;"TRIG:COUN ";Nop         !Set trigger count to 5.
770    OUTPUT @Src;"*OPC?"
780    ENTER @Src;Tmp
790    OUTPUT @Src;"OUTP ON"                !Turn output on. BEEP
800    OUTPUT @Src;"READ?"                  !Trigger sweep and acquire data.
810    ENTER @Src1 USING "%,1A";H1$           !#
820    ENTER @Src1 USING "%,1A";H2$           !0
830    DISP H1$,H2$
840    ENTER @Src1;D(*)
850    ENTER @Src1 USING "%,1A";H1$           !#
860    OUTPUT @Src;"OUTP OFF"               !Turn output off.
870    OUTPUT @File;"No.,Time[s],Volt[V],Curr[A]"
880    FOR I=1 TO Nop
890      PRINT I,D(I,3)-D(1,3),D(I,1),D(I,2)
900      OUTPUT @File;I,D(I,3)-D(1,3),D(I,1),D(I,2)
910    NEXT I
920    RETURN
930 Fileopen:  !
940    DIM Filename$[20],Dhms$[8]
950    Time$=TIME$(TIMEDATE)
960    Date$=DATE$(TIMEDATE)
970    Dhms$=Date$[1;2]&Time$[1;2]&Time$[4;2]&Time$[7;2]
980    Filename$=Dhms$&".txt"
990    CREATE Filename$,1
1000   ASSIGN @File TO Filename$;FORMAT ON
1010   RETURN
1020 Fileclose:!
1030   ASSIGN @File TO *
1040   RETURN
1050 Chart_var:   !
1060   X_origin=0
1070   X_range=Rate*Nop
1080   X_axis_label$="Time [sec]"
1090   Y_origin=0
1100   Y_range=Y_max
1110   Y_axis_label$="Curr [A]"
1120   RETURN
1130 Init_chart:   !
1140   DIM X_axis_label$[25],Y_axis_label$[25]
1150   INTEGER Trace_num
1160   INTEGER Screen_dims(1:2),Gwindow_dims(1:4)
1170   REAL Y(1:1)  !챠트가 하나
1180   GESCAPE CRT,36;Screen_dims(*) ! Get screen width and height.
1190  !
1200  ! Set the dimensions of the graphics window using GESCAPE 33 so
1210  ! that it is centered on the screen.
1220  !
1230   Gwindow_dims(1)=Screen_dims(1)*.25 ! X of upper left.
1240   Gwindow_dims(2)=Screen_dims(2)*.2  ! Y of upper left.
1250   Gwindow_dims(3)=Screen_dims(1)*.7  ! Width.
1260   Gwindow_dims(4)=Screen_dims(2)*.6  ! Height.
1270   GESCAPE CRT,33;Gwindow_dims(*)     ! Set graphics window geometry.
1280  !
1290   GESCAPE CRT,35 ! Move the graphics window to the top.
1300  !
1310  ! Create a stripchart.  Make it invisible until all changes are made.
1320  !
1330   ASSIGN @Strip TO WIDGET "STRIPCHART";SET("VISIBLE":0)
1340  !
1350  ! Set the overall attributes.
1360  !
1370   CONTROL @Strip;SET("TITLE":"Data Logger")
1380   CONTROL @Strip;SET("MINIMUM SCROLL":2)
1390   CONTROL @Strip;SET("MOVABLE":0)
1400   CONTROL @Strip;SET("MAXIMIZABLE":0)
1410   CONTROL @Strip;SET("X":0,"Y":0)
1420  !
1430  ! Size the stripchart to exactly fill the graphics window.
1440  !
1450   Vert_borders=26
1460   Horiz_borders=8
1470   Height=Gwindow_dims(4)-Vert_borders
1480   Width=Gwindow_dims(3)-Horiz_borders
1490   CONTROL @Strip;SET("WIDTH":Width,"HEIGHT":Height)
1500  !
1510   CONTROL @Strip;SET("CURRENT AXIS":"X")
1520   CONTROL @Strip;SET("ORIGIN":X_origin,"RANGE":X_range)
1530   CONTROL @Strip;SET("AXIS LABEL":X_axis_label$)
1540  !CONTROL @Strip;SET("DIGITS":5)
1550  !
1560   CONTROL @Strip;SET("CURRENT AXIS":"Y")
1570   CONTROL @Strip;SET("ORIGIN":Y_origin,"RANGE":Y_range)
1580   CONTROL @Strip;SET("AXIS LABEL":Y_axis_label$)
1590  !
1600   CONTROL @Strip;SET("VISIBLE":1) ! Show the stripchart.
1610  !
1620   RETURN
1630   END