74
────────────────────────────────────────────────────
8.2 Sample programs
────────────────────────────────────────────────────
8.2 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 3157 is taken as 00000010
(baud rate: 9600bps, data length: 8 bits, parity: non, stop bit: 1 bit, delimiter:
CR).
(1) Basic settings and testing
This program sets the 3157 to the following test values:
・
Output current value: 25.0 A
・
Maximum test value: 0.100
Ω
・
Test time: 60.0 s
It carries out a single test measurement, and displays the result on the screen.
Program List
100 OPEN "COM1:9600,N,8,1" FOR RANDOM AS #1
110 STATE.CK1:
120 PRINT #1,":STAT?"
130 LINE INPUT #1,A$
140 IF A$="READY" THEN GOTO SETTING
150 PRINT #1,":STOP"
160 GOTO STATE.CK1
170 SETTING:
180 PRINT #1,":HEAD OFF"
190 PRINT #1,":CONF:CURR 25.0"
200 PRINT #1,":UNIT OHM"
210 PRINT #1,":UPP ON"
220 PRINT #1,":CONF:RUPP 0.100"
230 PRINT #1,":TIM ON"
240 PRINT #1,":CONF:TIM 60.0"
250 KEY.IN:
260 INPUT "Press any key to start",B$
270 PRINT #1,":STAR"
280 STATE.CK2:
290 PRINT #1,":STAT?"
300 LINE INPUT #1,C$
310 IF C$="TEST" THEN GOTO STATE.CK3
320 GOTO STATE.CK2
330 STATE.CK3:
340 PRINT #1,":STAT?"
350 LINE INPUT #1,D$
360 IF D$="TEST" THEN GOTO STATE.CK3
370 RESULT:
380 PRINT #1,":MEAS:RES:RES?"
390 LINE INPUT #1,E$
400 PRINT E$
410 CLOSE
420 END
Program comments
Line
Comment
100
Open the RS-232C circuit file.
110-160
Confirm that the 3157 is in the READY state.
Содержание 9593-02
Страница 2: ......
Страница 6: ...ii Introduction...
Страница 16: ...10 2 3 Specifications...
Страница 76: ...70 8 1 Sample program Flowchart...
Страница 86: ...80 8 2 Sample programs...
Страница 88: ...82...
Страница 89: ......
Страница 90: ......
Страница 91: ......
Страница 92: ......