YOKOGAWA WT110 User Manual page 152

Digital power meter
Table of Contents

Advertisement

Sample Program
'*********************************************************************
'*
WT110/WT130
'*
Program to read measurement data 10 times and then display them
'*
'*********************************************************************
REM $INCLUDE: 'qbdecl4.bas'
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
'
CMD$ = "HD0"
CALL IBWRT(WT%, CMD$): GOSUB ERRCHK
CMD$ = "FL0"
CALL IBWRT(WT%, CMD$): GOSUB ERRCHK
CMD$ = "SC0"
CALL IBWRT(WT%, CMD$): GOSUB ERRCHK
CMD$ = "AG0"
CALL IBWRT(WT%, CMD$): GOSUB ERRCHK
CMD$ = "DA1;EA1"
CALL IBWRT(WT%, CMD$): GOSUB ERRCHK
CMD$ = "DB2;EB1"
CALL IBWRT(WT%, CMD$): GOSUB ERRCHK
CMD$ = "DC3;EC1"
CALL IBWRT(WT%, CMD$): GOSUB ERRCHK
CMD$ = "RV7;RA7"
CALL IBWRT(WT%, CMD$): GOSUB ERRCHK
CMD$ = "MN0"
CALL IBWRT(WT%, CMD$): GOSUB ERRCHK
' Output items for comm. = default setting for normal measurement
CMD$ = "OFD0"
CALL IBWRT(WT%, CMD$): GOSUB ERRCHK
' Delimiter for Comm. output = CR+LF+EOI
CMD$ = "DL0"
CALL IBWRT(WT%, CMD$): GOSUB ERRCHK
BUF$ = SPACE$(255)
FOR I = 1 TO 10
FOR J = 0 TO 5000: NEXT J
CMD$ = "OD"
CALL IBWRT(WT%, CMD$): GOSUB ERRCHK
DO
LOOP WHILE LEFT$(BUF$, 3) <> "END"
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
Microsoft QuickBASIC 4.0/4.5 Version
CALL IBRD(WT%, BUF$): GOSUB ERRCHK
PRINT LEFT$(BUF$, IBCNT% - 2)
Appendix 1.2 Sample Program
' Hold OFF
' Filter OFF
' Scaling OFF
' Averaging OFF
' Display A = V1
' Display B = A1
' Display C = W1
' Measurement range = 150V/5A
' Measurement mode = RMS
' Waiting
*
*
*
App
App1-11

Advertisement

Table of Contents
loading

This manual is also suitable for:

Wt130

Table of Contents