YOKOGAWA WT110 User Manual page 155

Digital power meter
Table of Contents

Advertisement

Appendix 1.2 Sample Program
'*********************************************************************
'*
WT110/WT130
'*
Program for D/A output adjusting
'*
Turn ON the power while pressing the SHIFT key.
'*
'*********************************************************************
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$ = "CAL3": CALL IBWRT(WT%, CMD$): GOSUB ERRCHK
DO
CLS
PRINT "D/A output adjustment"
PRINT ""
PRINT "1-12 : Assigning D/A channel"
PRINT "S
PRINT "C
PRINT "Command >> "; : LINE INPUT CH$
IF CH$ = "S" THEN
ELSEIF CH$ = "C" THEN
ELSE
END IF
LOOP
'
PRGEND:
CALL IBLOC(WT%)
END
'
DACH:
CH$ = STR$(CH)
CMD$ = "CH" + CH$: CALL IBWRT(WT%, CMD$): GOSUB ERRCHK
CMD$ = "DO0": CALL IBWRT(WT%, CMD$): GOSUB ERRCHK
PRINT ""
PRINT "+5V has been output to"; CH$; "channel"
PRINT "Measure"; CH$; "channel's voltage"
PRINT "Measurement value = "; : LINE INPUT D$
CMD$ = "CD" + CH$ + "," + D$: CALL IBWRT(WT%, CMD$): GOSUB ERRCHK
FOR I = 0 TO 2000: NEXT I
CMD$ = "ENT": CALL IBWRT(WT%, CMD$): GOSUB ERRCHK
CMD$ = "DO1": CALL IBWRT(WT%, CMD$): GOSUB ERRCHK
PRINT ""
PRINT "-5V has been output to"; CH$; "channel"
PRINT "Measure"; CH$; "channel's voltage"
PRINT "Measurement value = "; : LINE INPUT D$
CMD$ = "CD" + CH$ + "," + D$: CALL IBWRT(WT%, CMD$): GOSUB ERRCHK
FOR I = 0 TO 2000: NEXT I
CMD$ = "ENT": CALL IBWRT(WT%, CMD$): GOSUB ERRCHK
RETURN
'
' 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
App1-14
Microsoft QuickBASIC 4.0/4.5 Version
: Adjustment values will be kept"
: Adjustment values will not be kept"
CMD$ = "END": CALL IBWRT(WT%, CMD$): GOSUB ERRCHK: EXIT DO
CMD$ = "CAN": CALL IBWRT(WT%, CMD$): GOSUB ERRCHK: EXIT DO
CH = VAL(CH$)
IF CH >= 1 AND CH <= 12 THEN
GOSUB DACH
END IF
*
*
*
*
IM 253401-01E

Advertisement

Table of Contents
loading

This manual is also suitable for:

Wt130

Table of Contents