83
_____________________________________________________________________________________________
_____________________________________________________________________________________________
Chapter 6
Sample Programs
The following sample programs are all written for the Microsoft Quick
BASIC.
For more details on the Quick BASIC, refer to the Quick BASIC
documentation.
All commands in the sample programs are used in the short form, and the
communication condition setting switches of the 3532-50 or 3522-50 is
taken as 00000010 (baud rate: 9600bps, data length: 8 bits, parity: non, stop
bit: 1 bit, delimiter: CR).
(1) Open- and short-circuit compensation
Summary
This program carries out open- and short-circuit compensation on the 3532-
50or 3522-50.
Program List
10 OPEN "COM1:9600,N,8,1" FOR RANDOM AS #1
20 PRINT #1, ":HEAD OFF"
30 PRINT #1, "
*
CLS"
40 CORR.OPEN:
50 INPUT "Prepare unit for open circuit compensation, then press Enter", A$
60 PRINT "Collecting open circuit compensation data"
70 PRINT #1, ":CORR:OPEN ALL"
80 OPEN.LOOP:
90 PRINT #1, ":ESR0?"
100 INPUT #1, A
110 IF (A AND 1) = 0 THEN GOTO OPEN.LOOP
120 PRINT #1, "*ESR?"
130 INPUT #1, A
140 IF (A AND 8) = 0 THEN GOTO CORR.SHORT
150 PRINT "Open circuit compensation failed"
160 GOTO CORR.OPEN
170 CORR.SHORT:
180 INPUT "Prepare unit for short circuit compensation, then press Enter", A$
190 PRINT "Collecting short circuit compensation data"
200 PRINT #1, ":CORR:SHOR ALL"
210 SHORT.LOOP:
220 PRINT #1, ":ESR0?"
230 INPUT #1, A
240 IF (A AND 1) = 0 THEN GOTO SHORT.LOOP
250 PRINT #1, "*ESR?"
260 INPUT #1, A
270 IF (A AND 8) = 0 THEN GOTO CORR.END