
18
Magtrol Model 5300 Three Phase Power AnalyzerChapter 7- Instruction Set
'Read 5300 PA full data - Magtrol Inc., 91 rt
'Primary address set to 14
Bdname$ = "DEV14"
CALL IBFIND(Bdname$, bd%) 'initialize GPIB
cl$ = CHR$(13) + CHR$(10) 'assign carriage return and line feed.
CLS
'Set PA for "FULL" data
wrt$ = "FULL" + cl$
CALL ibwrt(bd%, wrt$)
'Set PA for "SYNC" transfer timing.
wrt$ = "SYNC" + cl$
CALL ibdwrt(bd%, wrt$)
'Assign input word length.
rd$ = SPACE$(68)
LOCATE 20,50: PRINT "Any key ends..."
DO: s$ = UCASE$(INKEY$) 'Loop starts here.
CALL IBRD(bd%, rd$)
'Amps - convert from string to numeric and sum.
ap1$ = MID$(rd$, 3, 5) 'Extract Phase 1 amps.
ap2$ = MID$(rd$, 25, 5) 'phase 2.
ap3$ = MID$(rd$, 47, 5) 'phase 3.
amps = VAL(ap1$) + VAL(ap2$) + VAL(ap3$)
'Volts, conv' numeric, average, and conv' from phase to line voltage.
vp1$ = MID$(rd$, 10, 5) 'extract phase 1 volts.
vp2$ = MID$(rd$, 32, 5) 'phase 2.
vp2$ = MID$(rd$, 54, 5) 'phase 3.
volts = (VAL(vp1$) + VAL(vp2$) + VAL(vp3$) * .57735 ' = |3/3
'Power, convert to numeric, sum and convert to KW.
wp1$ = MID$(rd$, 17, 6) 'extract phase 1 watts.
wp2$ = MID$(rd$, 39, 6) 'phase 2 watts.
wp3$ = MID$(rd$, 61, 6) 'phase 3 watts.
Kw = (VAL(wp1$) + VAL(wp2$) + VAL(wp3$)) / 1000
LOCATE 12, 10: PRINT "Line Volts = ";
PRINT USING "###.#"; volts
LOCATE 13, 10: PRINT "Amperes = ";
PRINT USING "###.#"; amps
LOCATE 14,10: PRINT "3-phase KW = "; Kw
LOOP WHILE s$ = ""
END
Comentários a estes Manuais