"Ta720-1.bas"의 두 판 사이의 차이

(새 문서: TA720 <pre> 10 ! 2020-02-15 최초 작성 20 CLEAR SCREEN 30 OPTION BASE 1 40 DIM A$[155],Id$[23] 50 ASSIGN @Ta720 TO 705 ! 60 OUTPUT @Ta720;"*CLS"...)
 
(차이 없음)

2020년 2월 15일 (토) 13:07 기준 최신판

TA720

10     ! 2020-02-15 최초 작성
20     CLEAR SCREEN
30     OPTION BASE 1
40     DIM A$[155],Id$[23]
50     ASSIGN @Ta720 TO 705  !
60     OUTPUT @Ta720;"*CLS"             !clear
70     OUTPUT @Ta720;"*IDN?"  !YOKOGAWA,704510,0,F1.01  !23자,제조회사 모델 S/N(항상0) 펌웨어
80     ENTER @Ta720;Id$
90     DISP Id$
100    OUTPUT @Ta720;"CALC:PAR:AVER ON"
110    OUTPUT @Ta720;"CALC:PAR:SDEV ON"
120    OUTPUT @Ta720;"CALC:PAR:FLUT ON"
130    OUTPUT @Ta720;"CALC:PAR:PTOP ON"
140  !  OUTPUT @Ta720;"COMM:HEAD OFF"    !응답 데이터에 헤더를 사용한다 하지 않는다.
150    GOSUB Fileopen
160    GOSUB Measure
170    GOSUB Fileclose
180    STOP
190 Measure:  !
200    Set_time=3600  ! x축 그래프 최대 시간 [초]
210    OUTPUT @File;"No.,Time[s],Avg[s],P2P[s],Std[s],CV[%],Nop"
220    Count=0
230    GOSUB Chart_var
240    GOSUB Init_chart
250    T0=TIMEDATE
260    LOOP
270      Time=(TIMEDATE-T0)
280      GOSUB Reading
290      Count=Count+1
300      Y(1)=Avg
310      Y(2)=Std
320      CONTROL @Strip;SET("POINT LOCATION":Time,"VALUES":Y(*))
330      PRINT "Count=";Count;", T=";PROUND(Time,-3);", Avg=";Avg;", Std=";Std;", CV=";Cv
340      OUTPUT @File;Count,Time,Avg,P2p,Std,Cv,Nop
350    EXIT IF Time>Set_time
360    END LOOP 
370    RETURN
380 Reading:  ! 이 계측기는 한 명령이 끝날 때까지 다음 명령을 기다리는 기술을 사용해야 한다.
390    OUTPUT @Ta720;"SST"          !single
410    LOOP  !이 명령어를 수행하면 화면 업데이트가 안된다.
420      OUTPUT @Ta720;"STAT:COND?"
430      ENTER @Ta720;Bit
440    EXIT IF Bit=1
450    END LOOP 
460    WAIT .1  !화면 업데이트를 하는 시간
470    OUTPUT @Ta720;"CALC:AVER?"   !avg
480    ENTER @Ta720;A$
490    Avg=VAL(A$)
500    OUTPUT @Ta720;"CALC:PTOP?" !p2p
510    ENTER @Ta720;A$
520    P2p=VAL(A$)
530    OUTPUT @Ta720;"CALC:SDEV?" !sigma
540    ENTER @Ta720;A$
550    Std=VAL(A$)
560    OUTPUT @Ta720;"CALC:FLUT?"   !sigma/avg
570    ENTER @Ta720;A$
580    Cv=VAL(A$)
590    OUTPUT @Ta720;"CALC:SNUM?"   !
600    ENTER @Ta720;A$
610    Nop=VAL(A$)
620    RETURN
630 Fileopen:  !
640    DIM Filename$[20],Dhms$[8]
650    Time$=TIME$(TIMEDATE)
660    Date$=DATE$(TIMEDATE)
670    Dhms$=Date$[1;2]&Time$[1;2]&Time$[4;2]&Time$[7;2]
680    Filename$=Dhms$&".txt"
690    CREATE Filename$,1
700    ASSIGN @File TO Filename$;FORMAT ON
710    RETURN
720 Fileclose: !
730    ASSIGN @File TO *
740    RETURN
750 Chart_var:    !
760    X_origin=0
770    X_range=500
780    X_axis_label$="Sampling Count"
790    Y_origin=(1/1.E+7)-1.E-11
800    Y_range=2.E-11
810    Y_axis_label$="%"
820    RETURN
830 Init_chart:    !
840    DIM X_axis_label$[25],Y_axis_label$[25]
850    INTEGER Trace_num
860    INTEGER Screen_dims(1:2),Gwindow_dims(1:4)
870    REAL Y(1:2)   !Y(1) avg (2) sigma/avg
880    GESCAPE CRT,36;Screen_dims(*) ! Get screen width and height.
890   !
900   ! Set the dimensions of the graphics window using GESCAPE 33 so
910   ! that it is centered on the screen.
920   !
930    Gwindow_dims(1)=Screen_dims(1)*.25 ! X of upper left.
940    Gwindow_dims(2)=Screen_dims(2)*.2  ! Y of upper left.
950    Gwindow_dims(3)=Screen_dims(1)*.7  ! Width.
960    Gwindow_dims(4)=Screen_dims(2)*.6  ! Height.
970    GESCAPE CRT,33;Gwindow_dims(*)     ! Set graphics window geometry.
980   !
990    GESCAPE CRT,35 ! Move the graphics window to the top.
1000  !
1010  ! Create a stripchart.  Make it invisible until all changes are made.
1020  !
1030   ASSIGN @Strip TO WIDGET "STRIPCHART";SET("VISIBLE":0)
1040  !
1050  ! Set the overall attributes.
1060  !
1070   CONTROL @Strip;SET("TITLE":"Data Logger")
1080   CONTROL @Strip;SET("MINIMUM SCROLL":2)
1090   CONTROL @Strip;SET("MOVABLE":0)
1100   CONTROL @Strip;SET("MAXIMIZABLE":0)
1110   CONTROL @Strip;SET("X":0,"Y":0)
1120  !
1130  ! Size the stripchart to exactly fill the graphics window.
1140  !
1150   Vert_borders=26
1160   Horiz_borders=8
1170   Height=Gwindow_dims(4)-Vert_borders
1180   Width=Gwindow_dims(3)-Horiz_borders
1190   CONTROL @Strip;SET("WIDTH":Width,"HEIGHT":Height)
1200  !
1210   CONTROL @Strip;SET("CURRENT AXIS":"X")
1220   CONTROL @Strip;SET("ORIGIN":X_origin,"RANGE":X_range)
1230   CONTROL @Strip;SET("AXIS LABEL":X_axis_label$)
1240  !CONTROL @Strip;SET("DIGITS":5)
1250  !
1260   CONTROL @Strip;SET("CURRENT AXIS":"Y")
1270   CONTROL @Strip;SET("ORIGIN":Y_origin,"RANGE":Y_range)
1280   CONTROL @Strip;SET("AXIS LABEL":Y_axis_label$)
1290  !
1300   CONTROL @Strip;SET("VISIBLE":1) ! Show the stripchart.
1310  !
1320   RETURN
1330   END