YOKOGAWA WT110 User Manual page 198

Digital power meter
Table of Contents

Advertisement

'*********************************************************************
'*
'*
'*
'*
'*
'*
'*
'*
'*
'*********************************************************************
REM $INCLUDE: 'qbdecl4.bas'
N = 53
DIM D$(N)
BORD$ = "GPIB0": CALL IBFIND(BORD$, BD%)
IF BD% < 0 THEN GOTO ERRDISP
CALL IBSIC(BD%): GOSUB ERRCHK
DEVICE$ = "WT": CALL IBFIND(DEVICE$, WT%)
IF WT% < 0 THEN GOTO ERRDISP
CALL IBCLR(WT%): GOSUB ERRCHK
V% = 1: CALL IBSRE(BD%, V%)
CLS
' Settings related to harmonic analysis
' Element=1, PLL source=V1, Computation method of harmonic distortion=IEC
CMD$ = "HARMONICS:STATE ON;ELEMENT 1;SYNCHRONIZE V,1;THD IEC"
CALL IBWRT(WT%, CMD$): GOSUB ERRCHK
' Sets the communication output items.
' Sets all functions OFF. Sets only necessary functions ON.
CMD$ = "MEASURE:HARMONICS:ITEM:PRESET CLEAR"
CALL IBWRT(WT%, CMD$): GOSUB ERRCHK
CMD$ = "MEASURE:HARMONICS:ITEM:SYNCHRONIZE ON;ATHD ON;A ON"
CALL IBWRT(WT%, CMD$): GOSUB ERRCHK
' Sets the filter to detect the end of data updating
CMD$ = "STATUS:FILTER1 FALL"
CALL IBWRT(WT%, CMD$): GOSUB ERRCHK
' Reads the analysis data and displays them (10 times)
FOR I = 1 TO 10
NEXT I
PRGEND:
CALL IBLOC(WT%)
END
'
' When IBFIND call failed
ERRDISP:
PRINT " ===== No such board or device name ===== "
GOTO PRGEND
'
' GP-IB error check
ERRCHK:
IF IBSTA% >= 0 THEN RETURN
PRINT " ===== Error ===== "
GOTO PRGEND
IM 253401-01E
WT110/WT130
Executes harmonic analysis for element 1 and displays the
following:
* Frequency of the PLL source(=voltage of element 1)
* Harmonic distortion factor of the current(ATHD)
* Rms values of the 1st to 50th order current
* Fundamental(1st order) and harmonic analysis values(2nd to
50th order)currents
CMD$ = "STATUS:EESR?"
CALL IBWRT(WT%, CMD$): GOSUB ERRCHK
BUF$ = SPACE$(255)
CALL IBRD(WT%, BUF$): GOSUB ERRCHK
' Waiting until data are finished updating
CMD$ = "COMMUNICATE:WAIT 1"
CALL IBWRT(WT%, CMD$): GOSUB ERRCHK
CMD$ = "MEASURE:VALUE?"
CALL IBWRT(WT%, CMD$): GOSUB ERRCHK
BUF$ = SPACE$(1000)
CALL IBRD(WT%, BUF$): GOSUB ERRCHK ' Reads analysis data
K = 1
FOR J = 1 TO N
IF J < N THEN S = INSTR(K, BUF$, ",") ELSE S = INSTR(K, BUF$, CHR$(10))
D$(J) = MID$(BUF$, K, S - K)
K = S + 1
NEXT J
' Displaying analysis data
PRINT "V1 FREQ", D$(1)
PRINT "A1 THD(IEC)", D$(2)
PRINT "A1 RMS", D$(3)
FOR J = 1 TO N-3 STEP 2
PRINT "A1 Order" + STR$(J), D$(J + 3),
PRINT "A1 Order" + STR$(J + 1), D$(J + 4)
NEXT J
Appendix 2.5 Sample Program
Microsoft QuickBASIC 4.0/4.5 Version
' Array D$(53) is prepared for receiving data
' Clears the extended event register
' Requests output of analysis data
' Order of output data
' Frequency of PLL source
' Harmonic distortion of current
' Rms values of the 1st to 50th order
' Fundamental/higher harmonics analysis values
' odd numbered component
' even numbered component
' End
*
*
*
*
*
*
*
*
*
App
App2-41

Advertisement

Table of Contents
loading

This manual is also suitable for:

Wt130

Table of Contents