(차이) ← 이전 판 | 최신판 (차이) | 다음 판 → (차이)
HP 6842A
1 ! 6842a-ibw.txt
10 ! 2019-03-22
20 ! 2020-09-08 트랜스포머 전압비 측정
30 ! 1 = 6842A 전압에 따라, 스스로 전류측정
40 ! 2 = 6842A 전압인가, 3458A 2차측 전압측정
50 ! 3 = 6842A 전압인가, 8842(add 03) 1차측 전류측정, 8842(add 02) 2차측 전압측정
60 OPTION BASE 1
70 ASSIGN @Ps TO 705
80 ASSIGN @Dmm TO 722
90 GOSUB Fileopen
100 GOSUB Measure
110 GOSUB Fileclose
120 STOP
130 Measure: !
140 INTEGER I,V_start,V_stop
150 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
160 Type=2 !1=자체에서 v,i측정 2=v인가 3458로 전압측정(트랜스측정)
170 V_start=1 !정수 !!!!!!
180 V_stop=110 !110 또는 220 까지 정수 !!!!!!
190 Curr_limit=1 !흐르는 최대 전류 !!!!!!!!!!!!!!! 주의
200 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
210 Y_max=12 ! 그래프에서 Y축 최대
220 ALLOCATE Yarray(V_stop),Xarray(V_stop)
230 DIM Id$[50]
240 OUTPUT @Ps;"*IDN?"
250 ENTER @Ps;Id$
260 DISP Id$
270 OUTPUT @Ps;"VOLT 0"
280 OUTPUT @Ps;"VOLT:PROT 221" !sets the overvoltage protection (OVP) level of the ac source
290 OUTPUT @Ps;"CURR:LEV ";Curr_limit ! Sets the rms current limit
300 OUTPUT @Ps;"CURR:PROT:STAT ON" ! enables the overcurrent (OC) protection function
310 OUTPUT @Ps;"OUTP ON"
320 SELECT Type
330 CASE 1
340 OUTPUT @File;"No.,Time[s],Volt[V],Curr[A],Apparent Power[VA],Real Power[W], Power Factor"
350 CASE 2
360 OUTPUT @File;"No.,Time[s],Vset[V],Vmeas[V],Vratio"
370 END SELECT
380 GOSUB Chart_var
390 GOSUB Init_chart
400 T0=TIMEDATE
410 FOR I=V_start TO V_stop
420 T=TIMEDATE-T0
430 OUTPUT @Ps;"VOLT ";I
440 SELECT Type
450 CASE 1
460 GOSUB Reading_ps
470 Pf=W/Va
480 PRINT I,T,Vset,Curr,Va,W,Pf
490 OUTPUT @File;I,T,Vset,Curr,Va,W,Pf
500 CASE 2
510 GOSUB Reading_ps
520 GOSUB Reading_dmm
530 PRINT I,T,Vset,Vmeas,Vmeas/Vset
540 OUTPUT @File;I,T,Vset,Vmeas,Vmeas/Vset
550 END SELECT
560 IF Vmeas>Y_max THEN Y_max=Vmeas
570 Xarray(I)=Vset
580 Yarray(I)=Vmeas
590 Y(1)=Vmeas
600 CONTROL @Strip;SET("POINT LOCATION":Xarray(I),"VALUES":Y(*))
610 NEXT I
620 OUTPUT @Ps;"OUTP OFF"
630 GOSUB Fileclose
640 RETURN
650 Reading_ps: !
660 OUTPUT @Ps;"MEASure:VOLTage:AC?"
670 ENTER @Ps;Vset
680 OUTPUT @Ps;"MEASure:CURRent:AC?"
690 ENTER @Ps;Curr
700 OUTPUT @Ps;"MEASure:POWer:AC:APParent?"
710 ENTER @Ps;Va
720 OUTPUT @Ps;"MEASure:POWer:AC:REAL?"
730 ENTER @Ps;W
740 RETURN
750 Reading_dmm: !
760 OUTPUT @Dmm;"TRIG SGL"
770 ENTER @Dmm;Vmeas
780 RETURN
790 Fileopen: !
800 DIM Filename$[20],Dhms$[8]
810 Time$=TIME$(TIMEDATE)
820 Date$=DATE$(TIMEDATE)
830 Dhms$=Date$[1;2]&Time$[1;2]&Time$[4;2]&Time$[7;2]
840 Filename$=Dhms$&".txt"
850 CREATE Filename$,1
860 ASSIGN @File TO Filename$;FORMAT ON
870 RETURN
880 Fileclose: !
890 ASSIGN @File TO *
900 RETURN
910 Chart_var: !
920 X_origin=V_start
930 X_range=V_stop-V_start
940 X_axis_label$="1st Volt[V]"
950 Y_origin=0
960 Y_range=Y_max
970 Y_axis_label$="2nd Volt[V]"
980 RETURN
990 Init_chart: !
1000 DIM X_axis_label$[25],Y_axis_label$[25]
1010 INTEGER Trace_num
1020 INTEGER Screen_dims(1:2),Gwindow_dims(1:4)
1030 REAL Y(1:1) !챠트가 하나
1040 GESCAPE CRT,36;Screen_dims(*) ! Get screen width and height.
1050 !
1060 ! Set the dimensions of the graphics window using GESCAPE 33 so
1070 ! that it is centered on the screen.
1080 !
1090 Gwindow_dims(1)=Screen_dims(1)*.25 ! X of upper left.
1100 Gwindow_dims(2)=Screen_dims(2)*.2 ! Y of upper left.
1110 Gwindow_dims(3)=Screen_dims(1)*.7 ! Width.
1120 Gwindow_dims(4)=Screen_dims(2)*.6 ! Height.
1130 GESCAPE CRT,33;Gwindow_dims(*) ! Set graphics window geometry.
1140 !
1150 GESCAPE CRT,35 ! Move the graphics window to the top.
1160 !
1170 ! Create a stripchart. Make it invisible until all changes are made.
1180 !
1190 ASSIGN @Strip TO WIDGET "STRIPCHART";SET("VISIBLE":0)
1200 !
1210 ! Set the overall attributes.
1220 !
1230 CONTROL @Strip;SET("TITLE":"Data Logger")
1240 CONTROL @Strip;SET("MINIMUM SCROLL":2)
1250 CONTROL @Strip;SET("MOVABLE":0)
1260 CONTROL @Strip;SET("MAXIMIZABLE":0)
1270 CONTROL @Strip;SET("X":0,"Y":0)
1280 !
1290 ! Size the stripchart to exactly fill the graphics window.
1300 !
1310 Vert_borders=26
1320 Horiz_borders=8
1330 Height=Gwindow_dims(4)-Vert_borders
1340 Width=Gwindow_dims(3)-Horiz_borders
1350 CONTROL @Strip;SET("WIDTH":Width,"HEIGHT":Height)
1360 !
1370 CONTROL @Strip;SET("CURRENT AXIS":"X")
1380 CONTROL @Strip;SET("ORIGIN":X_origin,"RANGE":X_range)
1390 CONTROL @Strip;SET("AXIS LABEL":X_axis_label$)
1400 !CONTROL @Strip;SET("DIGITS":5)
1410 !
1420 CONTROL @Strip;SET("CURRENT AXIS":"Y")
1430 CONTROL @Strip;SET("ORIGIN":Y_origin,"RANGE":Y_range)
1440 CONTROL @Strip;SET("AXIS LABEL":Y_axis_label$)
1450 !
1460 CONTROL @Strip;SET("VISIBLE":1) ! Show the stripchart.
1470 !
1480 RETURN
1490 END