238
────────────────────────────────────────────────────
11.5 Sample Program
────────────────────────────────────────────────────
1.5.1 RS-232C
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
OPEN "COM1:9600,N,8,1,RS,RB4096" FOR RANDOM
AS #1
PRINT #1, ":RESET"
LINE INPUT #1, tmp$: PRINT tmp$
PRINT #1, ":DISP:INTE 3"
LINE INPUT #1, tmp$: PRINT tmp$
PRINT #1, ":DRES"
LINE INPUT #1, tmp$: PRINT tmp$
PRINT #1, ":VOLT:RANG 150"
LINE INPUT #1, tmp$: PRINT tmp$
PRINT #1, ":CURR:RANG 100"
LINE INPUT #1, tmp$: PRINT tmp$
PRINT #1, ":WIRING 1"
LINE INPUT #1, tmp$: PRINT tmp$
PRINT #1, ":SCALE:PT 1"
LINE INPUT #1, tmp$: PRINT tmp$
PRINT #1, ":SCALE:CT 1"
LINE INPUT #1, tmp$: PRINT tmp$
PRINT #1, ":OPER OFF"
LINE INPUT #1, tmp$: PRINT tmp$
PRINT #1, ":INTE:STAR:METH MANUAL"
LINE INPUT #1, tmp$: PRINT tmp$
PRINT #1, ":INTE:STOP:METH TIMER"
LINE INPUT #1, tmp$: PRINT tmp$
PRINT #1, ":INTE:TIME 1,0,0"
LINE INPUT #1, tmp$: PRINT tmp$
PRINT #1, ":HEAD OFF"
LINE INPUT #1, tmp$: PRINT tmp$
PRINT #1, ":INTE:START"
LINE INPUT #1, tmp$: PRINT tmp$
GOSUB wait3sec:
PRINT #1, ":INTE:STAT?"
INPUT #1, stat$
IF stat$ <> "1" THEN 390
PRINT #1, ":MEAS:INTE?
0,0,0,0,0,0,0,0,0,0,255,255,255"
LINE INPUT #1, MEAS$
PRINT MEAS$
CLOSE
END
wait3sec:
SEC = VAL(MID$(TIME$, 7, 2))
SEC2 = VAL(MID$(TIME$, 7, 2))
IF SEC2 < SEC THEN SEC2 = SEC2 + 60
IF (SEC2 ‑ SEC) < 3 THEN 500
RETURN
NOTE
Program list Program comments
100 Open the RS-232C line file
110 Executes a system reset.
120 Waits for a response
130 Displays the Integrated value display screen
(page 1/2 ).
150 Resets the integration data.
170 Sets the voltage to the 150V range.
190 Sets the current to the 100A range.
210 Sets the wiring to single-phase, two-wire.
230 Sets the PT ratio to "1".
250 Sets the CT ratio to "1".
270 Sets the reactive power method so that it is not
used.
290 Sets "manual start" for integration.
310 Sets integration to the stop timer.
330 Sets them timer (integration time) to 1 hour.
350 Turns the response header off.
370 Starts integrated measurement.
390 Waits for approximately 3 seconds.
400 Inquires about the integration status.
420 Jumps to 390 if stat$ is not "1" (Has the effect
of waiting until integrated measurement is
complete.)
430 Gets the integrated data.
450 Displays the integrated data on the personal
computer screen.
460 Closes the RS-232C line file.
480 to 530 Three-second wait routine
・Follow commands with "LINE INPUT #1, tmp$" in the next line. (tmp$ is
optional.)
・The display language is shifted to Japanese by executing a reset command.